Age | Commit message (Collapse) | Author |
|
Use libblkid to detect the filesystem type if "auto" is given as
type. Remove the translator localization from main, this is also done
in do_mount and any errors are propagated properly. This way "auto" is
handled correctly if given on the command line or used as filesystem
type in the fstab.
* configure.ac: Add check for libblkid.
* config.make.in: Make libblkid specific values available.
* utils/Makefile: Use libblkid specific values.
* utils/mount.c (DEFAULT_FSTYPE): Use "auto" as default type.
(do_mount): Detect type using libblkid.
(main): Drop translator localization.
|
|
* utils/umount.c: Do not include useless <blkid/blkid.h>.
|
|
Register any symlink translators running as root as important
processes at the proc server.
* trans/symlink.c (main): Mark us as important.
|
|
Register any mach-defpager translators running as root as
important processes at the proc server.
* mach-defpager/main.c (main): Mark us as important.
|
|
Register libtrivfs-based translators running as root as important
processes at the proc server.
* libtrivfs/startup.c (trivfs_startup): Mark us as important.
|
|
Register libnetfs-based translators running as root as important
processes at the proc server.
* libnetfs/init-startup.c (netfs_startup): Mark us as important.
|
|
Register libdiskfs-based translators running as root as important
processes at the proc server.
* libdiskfs/init-startup.c (_diskfs_init_completed): Mark us as important.
|
|
This is based on a fragment of Guillem Jovers patch presented here:
http://lists.gnu.org/archive/html/bug-hurd/2006-02/msg00081.html
It has been refreshed, updated and the copyright year is adjusted
properly. It has been complemented with the necessary features to
address the issues the original patch set out to address, namely
that killall5 freezes the proc translator before it tries to walk
over /proc/*/stat to decide which process to kill. Prior to this
patch (and the one marking the procfs server as important
process), killall5 would deadlock trying to walk over the proc
file system.
Ironically it would not have killed any process later on even if
it had the chance, since two values obtained from /proc/*/stat
are currently hardcoded to zero in our procfs. Patches addressing
the problem as a whole are prepared and will be sent as a follow
up.
* init/init.c (launch_core_servers): Mark init, auth, proc and fs
servers as important.
(start_child): Mark the real init as important.
(S_startup_important_task): Mark exec server as important.
|
|
This is based on a fragment of Guillem Jovers patch presented here:
http://lists.gnu.org/archive/html/bug-hurd/2006-02/msg00081.html
It has been refreshed, updated and the copyright year is adjusted
properly. It has been complemented with the necessary features to
address the issues the original patch set out to address, namely
that killall5 freezes the proc translator before it tries to walk
over /proc/*/stat to decide which process to kill. Prior to this
patch (and the one marking the procfs server as important
process), killall5 would deadlock trying to walk over the proc
file system.
Ironically it would not have killed any process later on even if
it had the chance, since two values obtained from /proc/*/stat
are currently hardcoded to zero in our procfs. Patches addressing
the problem as a whole are prepared and will be sent as a follow
up.
* hurd/process.defs (proc_mark_important): New routine definitions.
* hurd/process_reply.defs (proc_mark_important_request): Likewise.
* hurd/process_request.defs (proc_mark_important_request): Likewise.
|
|
This is based on a fragment of Guillem Jovers patch presented here:
http://lists.gnu.org/archive/html/bug-hurd/2006-02/msg00081.html
It has been refreshed, updated and the copyright year is adjusted
properly. It has been complemented with the necessary features to
address the issues the original patch set out to address, namely
that killall5 freezes the proc translator before it tries to walk
over /proc/*/stat to decide which process to kill. Prior to this
patch (and the one marking the procfs server as important
process), killall5 would deadlock trying to walk over the proc
file system.
Ironically it would not have killed any process later on even if
it had the chance, since two values obtained from /proc/*/stat
are currently hardcoded to zero in our procfs. Patches addressing
the problem as a whole are prepared and will be sent as a follow
up.
* proc/proc.h (struct proc): Add p_important field.
* proc/pgrp.c (S_proc_getpgrppids): Exclude important system processes.
(S_proc_mark_important): New function.
* proc/mgt.c (create_startup_proc): Mark init as important.
|
|
Make the function check_owner available for use in other files.
* proc/info.c (check_owner): Drop attributes static and inline.
* proc/proc.h (check_owner): Add prototype.
|
|
* hurd/process.defs: Reserve RPC ID for proc_set_init_task.
* hurd/process_reply.defs: Likewise.
* hurd/process_request.defs: Likewise.
|
|
|
|
|
|
This adds a umount utility that implements most of the functions that
the Linux umount utility provides, especially that subset that is used
by the Debian package initscripts.
* utils/umount.c: New file.
|
|
Handle dead-name notifications the same way libdiskfs does. In fact,
dead-name.c is a verbatim copy with trivial modifications. It clears
np->sockaddr if the dead name notification was for that port.
* libnetfs/dead-name.c: New file.
* libnetfs/Makefile (OTHERSRCS): Add dead-name.c.
|
|
This is a trivially adapted version of libdiskfs/file-get-transcntl.c.
* libnetfs/file-get-transcntl.c: New file.
|
|
Only run setsid(2) if the process is not already the group leader.
* daemons/console-run.c (open_console): Fix setsid(2).
|
|
Add the appropriate simpleroutine or skip directives to
hurd/process_reply.defs matching the ones in hurd/process.defs.
* hurd/process_reply.defs: Add missing routine declarations.
|
|
This commit removes the parts of the exec server that were once using
the Binary File Descriptor library.
As I understand it, the BFD code stopped working because it uses stdio
streams and the glue code for that has never been ported to libio. The
code has been #ifdefed out ever since. It may or may not work in its
current state, so it is removed. If someone is interested, it can
always be recovered from the version control system.
* exec/exec.c: Remove all BFD related code.
* exec/priv.h: Likewise.
* TODO: Remove the corresponding item.
|
|
This code was meant to allow the user to specify alternative exec
servers using an environment variable. The Hurd uses the file system
as namespace for server lookups, so the proper way to use one's own
exec server seems to be the remap translator.
* exec/exec.c (S_exec_exec): Remove unused code.
|
|
* exec/Makefile (SRCS): Remove gzip and bzip2 sources.
(OBJS): Remove gzip and bzip2 objects.
|
|
* exec/Makefile (CPPFLAGS): Do not define GZIP and BZIP2 macros.
|
|
nullauth drops all authentication credentials and runs the given
program. This is also useful to drop privileges on behalf of
translators that do not need any credentials in some circumstances,
e.g.
% settrans -ap /hurd/nullauth -- /hurd/storeio -Tzero
makes storeio run without any credentials.
* utils/nullauth.c: New file.
* utils/Makefile: Build nullauth.
|
|
* tmpfs/tmpfs.c (main): Drop privileges.
|
|
* trans/null.c (main): Drop privileges.
|
|
setnullauth () obtains an empty authentication handle and uses it for
further authentication purposes. This effectively drops all Unix
privileges.
* libshouldbeinlibc/nullauth.c: New file.
* libshouldbeinlibc/nullauth.h: Likewise.
* libshouldbeinlibc/Makefile: Add nullauth.{c,h}.
|
|
This patch adds daemonizing support using libdaemon.
* console-client/console.c (daemonize): New variable.
(options): Add --daemonize argument.
(parse_opt): Handle --daemonize argument.
(daemon_error): New error(3) like macro.
(main): Daemonize.
* console-client/Makefile: Use libdaemon specific build flags.
|
|
* configure.ac: Add check for libdaemon.
* config.make.in: Make the libdaemon specific variables available.
|
|
* include/pids.h: New file.
* init/init.c (frob_kernel_process): Use symbolic name for kernel process.
* exec/exec.c (S_exec_init): Use symbolic name for startup process.
* libdiskfs/boot-start.c (diskfs_S_fsys_init): Likewise.
* libdiskfs/init-startup.c (_diskfs_init_completed): Likewise.
* pfinet/main.c (arrange_shutdown_notification): Likewise.
* proc/mgt.c (create_startup_proc): Likewise.
* proc/main.c (main): Use symbolic name for proc process.
|
|
* libnetfs/file-get-translator.c (netfs_S_file_get_translator): Call memcpy
instead of memmove.
|
|
Properly respond to file_get_translator requests for nodes with a
passive translator record.
* libnetfs/file-get-translator.c (netfs_S_file_get_translator): Handle
passive translator records.
|
|
This adds a umount utility that implements most of the functions that
the Linux umount utility provides, especially that subset that is used
by the Debian package initscripts.
* utils/umount.c: New file.
|
|
The mount utility on both Linux and FreeBSD allows one to either
specify a whitelist or a blacklist of filesystem types to consider for
--all. Prefixing the list with "no" indicates that the list is a
blacklist. Furthermore, Linux' mount utility ignores a "no" prefix on
any entry in the given list.
Previously the Hurd variant first applied whitelist containing all
positive values given and then filtered the resulting list using all
negative values. But this makes little sense because each entry only
has one value for the filesystem type (mnt_type) and all values are
mutually exclusive.
This patch adjusts the fstab handling code so that our mount utility
behaves like the Linux mount utility. This code is used by both mount
and fsck. The same argumentation applies to fsck as well.
Like implemented in Linux mount, any "no" prefix is ignored to retain
compatibility with the old behavior.
* sutils/fstab.c (fstab_argp_create): Fix semantic of --types.
|
|
Previously it was not possible to add two mount entries with the same
device information to an fstab structure. This is easily fixed by
breaking the assumption, that there is only one possible mount entry
for the "none" device as used by many purely virtual file systems.
* utils/fstab.c (fstab_find_device): Return NULL if name is "none".
|
|
Linux' mount utility ignores mounted filesystems if mount --all is
invoked. This patch makes our mount do the same.
utils/mount.c (main): Ignore mounted filesystems if --all is given.
|
|
--test-opts in combination with --all mounts only those filesystems
with options matching the given set of options.
Note that the semantic of the inverting "no" prefix differs from
--types: While --types=nonfs,ufs means neither nfs nor ufs,
--test-opts=nofoo,bar means not foo, but bar.
* utils/match-options.h: New file.
* utils/match-options.c: Likewise.
(test_opts): New variable.
(test_opts_len): Likewise.
(match_options): New function.
* utils/mount.c (parse_opt): Handle -O, --test-opts.
(main): Use match_options as filter.
|
|
Add -f and --fake arguments. This makes our mount more compatible with
Linux mount.
* utils/mount.c (argp_opts): Add -f and --fake.
(do_mount): Fake the translator startup if --fake is given.
|
|
This fixes mount -oremount when just given the mountpoint, e. g.:
% mount -oremount,ro /tmp
* util/mount.c (main): Add a one-argument form for remount.
|
|
Add -n and --no-mtab arguments. As we do not write an mtab file, this
is a trivial patch that just ignores this argument to be more
compatible with Linux mount.
* utils/mount.c (argp_opts): Add -n and --no-mtab.
(parse_opt): Do nothing on 'n'.
|
|
remap.sh uses /bin/sh to first change the working directory and then
execute the given program in the remap context. But the arguments
given on the command line were not properly escaped:
% '/bin/sh' '-c' 'echo $0'
/bin/sh
% remap '/bin/sh' '-c' 'echo $0'
<empty line>
% remap-fixed '/bin/sh' '-c' 'echo $0'
/bin/sh
* utils/remap.sh: Escape arguments handed to /bin/sh so that they are
not evaluated prematurely.
|
|
fakeroot.sh uses /bin/sh to first change the working directory and
then execute the given program in the fakeroot context. But the
arguments given on the command line were not properly escaped:
% '/bin/sh' '-c' 'echo $0'
/bin/sh
% fakeroot-tcp '/bin/sh' '-c' 'echo $0'
/bin/sh
% fakeroot-hurd '/bin/sh' '-c' 'echo $0'
<empty line>
% fakeroot-hurd-fixed '/bin/sh' '-c' 'echo $0'
/bin/sh
* utils/fakeroot.sh: Escape arguments handed to /bin/sh so that they
are not evaluated prematurely.
|
|
* pfinet/tunnel.c (io_select_common): Also handle `SELECT_WRITE' case.
|
|
* config.make.in (datarootdir,LEX,YACC): New variables.
* configure.ac (XKB_BASE): Drop extraneous "/share" from path.
* configure.ac: Reset pkg-config status between tests.
|
|
kfree_s expects a pointer and a size argument. Currently the
sizeof(cache) is used as size argument, this is certainly not what was
intented.
For reference, this code was present in Linux up to version 2.3.14 and
was replaced in 2.3.15.
Found using coccinelle and
https://raw.github.com/coccinelle/coccinellery/master/sz/sz.cocci.
* pfinet/linux-src/net/ipv4/ipmr.c (ipmr_cache_delete): Fix kfree_s call.
|
|
Previously the macro argument err was expanded and thus potentially
evaluated multiple times. This is fine for simple values or pure
functions, but not for say iohelp_create_iouser. Fix this by
evaluating the macro argument only once.
|
|
passive is not a zero terminated string but a char * combined with a
length. If passivelen == 0, passive may very well be not NULL, and
dereferencing that pointer might not be safe. At the very least the
consistency check is wrong. Fix that by checking passivelen instead of
passive.
* libnetfs/file-set-trans.c (netfs_S_file_set_translator): Fix sanity check.
|
|
passive is not a zero terminated string but a char * combined with a
length. If passivelen == 0, passive may very well be not NULL, and
dereferencing that pointer might not be safe. At the very least the
consistency check is wrong. Fix that by checking passivelen instead of
passive.
* libdiskfs/file-set-trans.c (diskfs_S_file_set_translator): Fix sanity check.
|
|
checkpath browses directories up to look against renaming a directory into
itself. It used to assume being able to stop at the root of the filesystem. But
some per-opens have a shadow_root, where recursion has to stop too.
This means checkpath does not check up to the root any more. This is fine, since
we already prevent cross-shadow-root renames very early in dir-rename.c, we
do not need to check outside of this shadow root.
* libdiskfs/dir-renamed.c (checkpath): Also stop at the per-open shadow_root.
|
|
This patch adds a --verbose argument to swapon and swapoff to make it
more compatible with the corresponding Linux' utilities. Note that our
swapon is verbose by default and has a --quiet argument to make it
quiet, so a --verbose argument on it's own does nothing at all.
* sutils/swapon.c (main): Handle -v argument.
|