Age | Commit message (Collapse) | Author |
|
* trans/crash.c (corefile_template_lock): New variable.
(S_crash_dump_task): Serialize access to 'corefile_template'.
(parse_opt): Likewise. Also strdup the template.
(trivfs_append_args): Serialize access to 'corefile_template'.
|
|
* trans/crash.c (parse_opt): Use empty core file templates to disable
the feature.
|
|
* trans/crash.c (parse_opt): Avoid 'error' in favor of the appropriate
argp error reporting mechanism.
* trans/remap.c (parse_opt): Likewise.
* utils/msgids.c (parse_opt): Likewise.
|
|
|
|
* trans/remap.c (parse_opt): Error out if some path is not absolute.
|
|
Add an option to specify a template used to construct core file names.
This way core files can be collected at a predictable central
location.
* hurd/crash.defs (crash_dump_task): Return EEXIST if the core file
has been written elsewhere.
* trans/crash.c (corefile_template): New variable.
(template_valid): New function.
(template_make_file_name): Likewise.
(S_crash_dump_task): Use the template to construct a name, open the
file, and write the core dump there instead of the handle provided by
the caller.
(argp_option): New option.
(doc): Document the format.
(parse_opt): Handle new option
(trivfs_append_args): Likewise.
|
|
* trans/crash.c (S_crash_dump_task): Fix error handling.
|
|
The descriptor is valid, it is just the mode which is not available.
* console-client/kbd-repeat.c (repeater_select): Drop SELECT_URG flag from
`type'. Return 0 instead of EINVAL if `type' contains SELECT_WRITE.
* console-client/pc-mouse (repeater_select): Likewise.
* trans/mtab.c (trivfs_S_io_select): Return 0 instead of EBADF when the
openmodes do not match the requested modes in `type'.
* trans/new-fifo.c (io_select_common): Likewise.
* trans/fifo.c (io_select_common): Likewise.
* trans/null.c (trivfs_S_io_select): Likewise.
* trans/streamio.c (io_select_common): Likewise.
|
|
Previously, 'task', 'core_file', and 'ctty_id' were not deallocated if
crash was configured to write core files, and 'ctty_id' was leaked if
the crashing task was suspended. This lead to resources not being
released in the kernel, the filesystem, and the terminal subsystem,
and could very well be responsible for making the Debian/Hurd shutdown
hang.
* trans/crash.c (S_crash_dump_task): Properly deallocate 'task',
'core_file', and 'ctty_id'.
|
|
* trans/crash.c: Include <assert.h>.
|
|
* doc/hurd.texi: Clarify what happens if 'trivfs_fsid' is zero.
* login/utmp.c: Leave 'trivfs_fsid' at zero.
* pfinet/main.c: Likewise.
* trans/ifsock.c: Likewise.
* trans/proxy-defpager.c: Likewise.
|
|
* libnetfs/drop-node.c: Remove use of netfs_node_refcnt_lock.
* libnetfs/init-init.c: Remove netfs_node_refcnt_lock.
* libnetfs/make-node.c: Initialize refcounts in refcounts_init.
* libnetfs/netfs.h: Use refcounts_t for tracking node references. Remove
netfs_node_refcnt_lock. Add netfs_nref_light, netfs_nrele_light and
handler netfs_try_dropping_softrefs. Adjust comments.
* libnetfs/nput.c: Use refcounts_t. Call netfs_try_dropping_softrefs to
remove any soft reference that the translator might have acquired
during the lifetime of the node. Implement empty
netfs_try_dropping_softrefs.
* libnetfs/nref.c: Implement netfs_nref_light.
* libnetfs/nrele.c: Use refcounts_t and netfs_try_dropping_softrefs.
Implement netfs_nrele_light.
* ftpfs/dir.c: Use netfs_nref without locking the old
netfs_node_refcnt_lock.
* ftpfs/node.c: Likewise.
* usermux/mux.c: Use netfs_nref to increase hard references of the node.
* hostmux/mux.c: Use netfs_nref to increase hard references of the node.
* trans/fakeroot.c (new_node): Use a light reference when storing a node in the
hash table.
* trans/fakeroot.c (netfs_try_dropping_softrefs): Implement
netfs_try_dropping_softrefs to remove the node from the hash table.
* trans/fakeroot.c (netfs_node_norefs): Remove code to remove the node
from the hash table.
* trans/fakeroot.c (netfs_S_dir_lookup): Simplify lookup code since we
don't need to lock netfs_node_refcnt_lock anymore.
* procfs/netfs.c: Remove use of netfs_node_refcnt_lock.
* nfs/cache.c: Add mutex to handle exclusive access to nodehash. This
replaces the use of netfs_node_refcnt_lock.
* nfs/cache.c (lookup_handle): Use nodehash_ihash_lock when accessing
nodehash. Use netfs_nref_light to add one soft reference to the node
just added to nodehash.
* nfs/cache.c (netfs_node_norefs): Use netfs_nref. Don't use
netfs_node_refcnt_lock and don't remove the node from nodehash here.
* nfs/cache.c (netfs_try_dropping_softrefs): Drop the light reference
when the node has no more hard references.
* nfs/cache.c (recache_handle): Use nodehash_ihash_lock instead.
* nfs/ops.c (netds_attempt_unlink): Use refcounts_references.
* console/console.c (netfs_node_norefs): Use a soft reference to store
a node in dir_node, cons_node, disp_node, inp_node.
* console/console.c (netfs_try_dropping_softrefs): When dropping all
soft references remove node pointer from the fields above.
|
|
* hurd/default_pager.defs (default_pager_storage_info): New RPC.
* hurd/default_pager_reply.defs: Skip default_pager_storage_info RPC.
* hurd/default_pager_types.h: Include <mach/machine/vm_types.h>.
(vm_size_array_t): New type.
* mach-defpager/priv.h (part): Add `name' field.
* mach-defpager/default_pager.c (new_partition): Allocate and fill
`part->name' field. Free it on error.
(destroy_paging_partition): Free `part->name' field.
(S_default_pager_storage_info): New function.
* procfs/Makefile (SRCS): Add default_pagerUser.c.
* procfs/rootdir.c: Include "default_pager_U.h".
(rootdir_gc_swaps): New function.
(rootdir_entries): Add "swaps" entry.
* sutils/swapon.c: Include <argz.h>
(show): New variable.
(options): Add --show/-S option.
(def_pager, dev_master): New variables
(swaponoff): Move getting `def_pager' to...
(get_def_pager): ... new function.
(main): Support 'S' option.
* trans/proxy-defpager.c (S_default_pager_storage_info): New function.
|
|
* trans/mtab.c (mtab_populate): Always open the underlying node, and pass
it to mtab_mark_as_seen instead of the translated node.
|
|
* trans/firmlink.c (trivfs_get_source): New function.
|
|
* trans/crash.c (S_crash_dump_task): Fix looking up 'user_proc'.
|
|
* trans/fakeroot.c (netfs_demuxer): When forwarding an unknown request fail,
forward the error instead of crashing.
|
|
One needs to keep the port being reauthenticated alive until we are sure the
server has complete authentication.
* libfshelp/fetch-root.c (fshelp_fetch_root): Deallocate `port' after
auth_user_authenticate has completed.
* trans/fakeroot.c (netfs_S_dir_lookup): Likewise with `file'.
|
|
On Thu, Dec 31, 2015 at 04:28:14PM +0100, Justus Winter wrote:
> Quoting Samuel Thibault (2015-12-31 16:11:30)
> > Flavio Cruz, on Thu 31 Dec 2015 15:56:31 +0100, wrote:
> > > This fixes three compiler warnings about ports_payload_get_name.
> > >
> > > * devnode/Makefile: Define DEVICE_IMPORTS.
> > > * term/Makefile: Likewise.
> > > * trans/Makefile: Likewise.
> >
> > Why not adding them to the corresponding mig-mutate.h?
>
> Sometimes we don't have a mig-mutate.h, e.g. for most (all?)
> translators in trans/. I prefer stuffing that in a .h as well, but I
> wouldn't be opposed to just applying the patch, as we use both ways of
> mutating the mig types.
Agreed. I think only devnode should include it in mig-mutate.h. For
term, only some stubs are including mig-mutate.h. For trans, there's no
mig-mutate.h at all. Here's the modified patch.
|
|
This fixes several linking problems I had in my recent cross-compilation
of the Hurd. I added missing static libraries and also organized some of
the targets for more concise rules.
* console-client/Makefile: Add libiohelp.a and libihash.a.
* daemons/Makefile: Add libihash.a and libshouldbeinlibc.a.
* devnode/Makefile: Add iohelp and ihash to HURDLIBS.
* random/Makefile: Likewise.
* trans/Makefile: Reorder targets alphabetically and add libiohelp.a and
libihash.a.
* utils/Makefile: Add libihash.a.
|
|
trans: Fix compiler warnings.
* trans/mtab.c (mtab_mark_as_seen): Cast idport to hurd_ihash_value_t.
* trans/streamio.c (dev_open): Cast name to char *.
|
|
Handle multiple request types as recommended by the Mach Server
Writer's Guide section 4, subsection "Handling Multiple Request
Types". This avoids initializing the reply message in every X_server
function.
* trans/proxy-defpager.c (proxy_defpager_demuxer): Improve the demuxer
function.
* trans/streamio.c (demuxer): Likewise.
|
|
Various realworld tests would otherwise think they can write to /, while
they actually can't.
* trans/fakeroot.c (netfs_report_access): Call file_check_access instead of
returning O_RDWR|O_EXEC when faking mode too.
|
|
So we will always be able to re-open them.
* trans/fakeroot.c (netfs_S_dir_lookup): Call real_from_fake_mode() on modes
before calling the underlying filesystem's dir_lookup.
|
|
libtrivfs contains two ways of managing more than one port class and
bucket. There is the old way of using a statically allocated array
with explicit length, and the new way with dynamically allocated
vectors.
Converting all users to the new way of handling multiple classes
and/or buckets, we can simplify the code in libtrivfs. In many cases,
the code will be simpler and more expressive for the user.
This also fixes a severe bug. As no classes are given to
`trivfs_startup', they are created and inserted into the dynamic
vector of classes. The helper function `allowed', however, used the
first item of the previously used static array, which is NULL. This
circumvented the typecheck, allowing the default pager protocol to be
spoken over control ports, likely resulting in a crash.
* trans/proxy-defpager.c: Convert to dynamic classes and buckets.
|
|
libtrivfs contains two ways of managing more than one port class and
bucket. There is the old way of using a statically allocated array
with explicit length, and the new way with dynamically allocated
vectors.
Converting all users to the new way of handling multiple classes
and/or buckets, we can simplify the code in libtrivfs. In many cases,
the code will be simpler and more expressive for the user.
This also fixes a mild bug. The classes and buckets given to
`trivfs_startup' end up in the dynamic vectors too, making the object
lookup code use the more complicated code path.
* trans/password.c: Convert to dynamic classes and buckets.
|
|
libtrivfs contains two ways of managing more than one port class and
bucket. There is the old way of using a statically allocated array
with explicit length, and the new way with dynamically allocated
vectors.
Converting all users to the new way of handling multiple classes
and/or buckets, we can simplify the code in libtrivfs. In many cases,
the code will be simpler and more expressive for the user.
This also fixes a mild bug. The classes and buckets given to
`trivfs_startup' end up in the dynamic vectors too, making the object
lookup code use the more complicated code path.
* trans/new-fifo.c: Convert to dynamic classes and buckets.
|
|
libtrivfs contains two ways of managing more than one port class and
bucket. There is the old way of using a statically allocated array
with explicit length, and the new way with dynamically allocated
vectors.
Converting all users to the new way of handling multiple classes
and/or buckets, we can simplify the code in libtrivfs. In many cases,
the code will be simpler and more expressive for the user.
This also fixes a severe bug. As no classes are given to
`trivfs_startup', they are created and inserted into the dynamic
vector of classes. The server function `trivfs_S_fsys_forward',
however, used the first item of the previously used static array,
which is NULL. This circumvented the typecheck.
* trans/magic.c: Convert to dynamic classes and buckets.
|
|
libtrivfs contains two ways of managing more than one port class and
bucket. There is the old way of using a statically allocated array
with explicit length, and the new way with dynamically allocated
vectors.
Converting all users to the new way of handling multiple classes
and/or buckets, we can simplify the code in libtrivfs. In many cases,
the code will be simpler and more expressive for the user.
This also fixes a mild bug. The classes and buckets given to
`trivfs_startup' end up in the dynamic vectors too, making the object
lookup code use the more complicated code path.
* trans/ifsock.c: Convert to dynamic classes and buckets.
|
|
libtrivfs contains two ways of managing more than one port class and
bucket. There is the old way of using a statically allocated array
with explicit length, and the new way with dynamically allocated
vectors.
Converting all users to the new way of handling multiple classes
and/or buckets, we can simplify the code in libtrivfs. In many cases,
the code will be simpler and more expressive for the user.
This also fixes a mild bug. The classes and buckets given to
`trivfs_startup' end up in the dynamic vectors too, making the object
lookup code use the more complicated code path.
* trans/crash.c: Convert to dynamic classes and buckets.
|
|
We should not wait for a writer in that case, since that will be ourself.
* trans/fifo.c (open_hook): Do not wait for a writer when flags contains
O_WRITE.
|
|
Otherwise some scripts may try to modify system files just because they find
they seem to be able to.
* trans/fakeroot.c (netfs_report_access): When FAKE_MODE is not set on
`np', call file_check_access on the underlying node instead of returning
O_RDWR|O_EXEC.
|
|
Fakeroot does not support faking them anyway, and they may change on the
underlying fs, e.g. when creating a local socket.
* trans/fakeroot.c (netfs_validate_stat): Return S_IFMT part of st_mode as
provided by underlying filesystem.
|
|
As well as other potential mode changes which are indeed supposed to still
work as root.
* trans/fakeroot.c (netfs_attempt_chmod): Always set S_IRUSR and S_IWUSR in
real_mode, and set S_IXUSR also when this is a directory.
|
|
Huge thanks to Svante Signell for having tracked the bug.
* trans/fakeroot.c (netfs_attempt_chmod): Make the file_chmod call
additionally include the modes from nn->openmodes.
|
|
* trans/fakeroot.c (check_openmodes): Make comment clearer about missing new
openmodes.
|
|
Thanks Svante Signell for the investigation and proposed patch.
* trans/fakeroot.c (new_node): Assert that `openmodes' includes only
O_RDWR|O_EXEC
(check_openmodes): Likewise with `newmodes'.
(netfs_S_dir_lookup): Keep only O_RDWR|O_EXEC from `flags' when calling
new_node.
|
|
* trans/fakeroot.c (netfs_set_translator): New function.
|
|
|
|
* trans/fakeroot.c (new_node): Initialize faked field to FAKE_DEFAULT.
|
|
Their faked field was not initialized.
Thanks a lot to Svante Signell for the investigation
* trans/fakeroot.c (new_node): Initialize faked field of nn to 0.
(netfs_attempt_mkfile): Call set_default_attributes on newly-allocated node,
and if the real mode is not the same as the requested mode, fake the mode.
|
|
`fsysServer' is only used by the symlink translator which does not use
libports. Therefor, it is not necessary to use the default payload to
port translation function.
* trans/Makefile (fsys-MIGSFLAGS): Disable the default payload to port
translation function.
|
|
* trans/Makefile (device_reply-MIGSFLAGS): Define MACH_PAYLOAD_TO_PORT.
|
|
* trans/Makefile (password-MIGSFLAGS): Add mutator.
|
|
* trans/Makefile (ifsock-MIGSFLAGS): Add mutator.
|
|
* trans/fakeroot.c (netfs_demuxer): Make the demuxer payload-aware.
|
|
* trans/mtab.c (struct mtab): Add a hash table to keep track of seen
ports.
(mtab_mark_as_seen): New function that records the identity port of a
given node in the hash table and reports whether it has been there
before.
(mtab_populate): Use the new function to avoid running in circles.
(main, open_hook): Initialize hash table.
(close_hook): Free ports and destroy hash table.
|
|
Fixes https://savannah.gnu.org/bugs/?15806 .
* trans/hello-mt.c (trivfs_append_args): Escape contents.
* trans/hello.c (trivfs_append_args): Likewise.
|
|
Make the memory_object parameter of default_pager_object_create
polymorphic. This fixes https://savannah.gnu.org/bugs/?26751 .
* hurd/default_pager.defs (default_pager_object_create): Make
memory_object parameter polymorphic.
* mach-defpager/default_pager.c (S_default_pager_object_create):
Adjust accordingly.
* trans/proxy-defpager.c (S_default_pager_object_create): Likewise.
|
|
* trans/mtab.c (main): Use setnullauth to drop privileges.
|