summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-09-15libnetfs: add fsys_get_childrenJustus Winter
Keep track of active translators and handle fsys_get_children requests. * libnetfs/Makefile (FSYSSRCS): Add fsys-get-children.c. * libnetfs/dead-name.c (ports_dead_name): Remove dead translators. * libnetfs/file-set-translator.c (netfs_S_file_set_translator): Register active translators. * libnetfs/fsys-get-children.c: New file.
2013-09-15libdiskfs: add fsys_get_childrenJustus Winter
Keep track of active translators and handle fsys_get_children requests. * libdiskfs/Makefile (FSYSSRCS): Add fsys-get-children.c. * libdiskfs/dead-name.c (ports_dead_name): Remove dead translators. * libdiskfs/file-set-trans.c (diskfs_S_file_set_translator): Register active translators. * libdiskfs/fsys-get-children.c: New file.
2013-09-15libfshelp: add translator-list.cJustus Winter
Add functions that maintain a list of active translators. * libfshelp/translator-list.c: New file. * libfshelp/fshelp.h: Add function declarations. * libfshelp/Makefile: Add translator-list.c, link against libihash.
2013-09-15libnetfs: track file name in struct peropenJustus Winter
Track the relative path used to obtain a file handle in the struct peropen. * libnetfs/netfs.h (struct peropen): New field path. * libnetfs/make-peropen.c (netfs_make_peropen): Initialize path. * libnetfs/release-peropen.c (netfs_release_peropen): Free path. * libnetfs/fsys-getroot.c (netfs_S_fsys_getroot): Initialize path. * libnetfs/dir-lookup.c (netfs_S_dir_lookup): Preserve the path.
2013-09-15libdiskfs: track file name in struct peropenJustus Winter
Track the relative path used to obtain a file handle in the struct peropen. * libdiskfs/diskfs.h (struct peropen): New field path. * libdiskfs/peropen-make.c (diskfs_make_peropen): Initialize path. * libdiskfs/peropen-rele.c (diskfs_release_peropen): Free path. * libdiskfs/fsys-getroot.c (diskfs_S_fsys_getroot): Initialize path. * libdiskfs/dir-lookup.c (diskfs_S_dir_lookup): Preserve the path.
2013-09-15libihash: add HURD_IHASH_ITERATE_ITEMS macroJustus Winter
Add a macro HURD_IHASH_ITERATE_ITEMS that iterates over all elements in the hash table making both the key and the value available. * libihash/ihash.h (HURD_IHASH_ITERATE_ITEMS): New macro.
2013-09-15proc: Remove unused declaration of zombie_listJustus Winter
* proc/proc.h (zombie_list): Remove declaration.
2013-09-15proc: remove unused file exc-reply.defsJustus Winter
* proc/exc-reply.defs: Delete file.
2013-09-15exec: keep track of the range where executable segments are mappedJustus Winter
Keep track of the range where executable segments are mapped into memory and hand that information over to the proc server. * exec/priv.h (struct execdata): Add {start,end}_code. * exec/exec.c (prepare): Initialize {start,end}_code. (load_section): Update {start,end}_code. (do_exec): Use proc_set_code to hand {start,end}_code to the proc server.
2013-09-15hurd: add proc_{get,set}_codeJustus Winter
Add routines to set and query the processes start_code and end_code locations. Any executable segments loaded from the ELF binary are in this range. * hurd/process.defs: Add proc_{get,set}_code. * hurd/process_reply.defs: Add proc_{get,set}_code. * hurd/process_request.defs: Add proc_{get,set}_code_request.
2013-09-15proc: keep track of {start,end}_codeJustus Winter
Any executable segments loaded from the ELF binary are in this range. * proc/proc.h (struct proc): Add {start,end}_code. * proc/mgt.h (S_proc_set_code): New function. * proc/mgt.h (S_proc_get_code): New function.
2013-09-10Fix variable namesSamuel Thibault
* utils/Makefile (mount-LDLIBS): Define to libblkid_LIBS instead of libblkid-LIBS (mount-CPPFLAGS): Likewise.
2013-09-09mount: handle -t autoJustus Winter
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.
2013-08-29Fix buildSamuel Thibault
* utils/umount.c: Do not include useless <blkid/blkid.h>.
2013-08-29trans: register symlink translators as importantJustus Winter
Register any symlink translators running as root as important processes at the proc server. * trans/symlink.c (main): Mark us as important.
2013-08-29mach-defpager: register mach-defpager translators as importantJustus Winter
Register any mach-defpager translators running as root as important processes at the proc server. * mach-defpager/main.c (main): Mark us as important.
2013-08-29libtrivfs: register libtrivfs-based translators as importantJustus Winter
Register libtrivfs-based translators running as root as important processes at the proc server. * libtrivfs/startup.c (trivfs_startup): Mark us as important.
2013-08-29libnetfs: register libnetfs-based translators as importantJustus Winter
Register libnetfs-based translators running as root as important processes at the proc server. * libnetfs/init-startup.c (netfs_startup): Mark us as important.
2013-08-29libdiskfs: register libdiskfs-based translators as importantJustus Winter
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.
2013-08-29init: Mark all of inits children and init itself as importantJustus Winter
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.
2013-08-29hurd: add proc_mark_importantJustus Winter
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.
2013-08-29proc: add proc_mark_important server codeJustus Winter
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.
2013-08-29proc: make the function check_owner availableJustus Winter
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.
2013-08-29Reserve RPC ID for proc_set_init_taskSamuel Thibault
* hurd/process.defs: Reserve RPC ID for proc_set_init_task. * hurd/process_reply.defs: Likewise. * hurd/process_request.defs: Likewise.
2013-08-29Merge branch 'master-merge'Samuel Thibault
2013-08-29Merge branch 'master-merge2' into master-mergeSamuel Thibault
2013-08-29umount: add a umount utilityJustus Winter
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.
2013-08-29libnetfs: handle dead-name notificationsJustus Winter
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.
2013-08-29libnetfs: implement file_get_translator_cntlJustus Winter
This is a trivially adapted version of libdiskfs/file-get-transcntl.c. * libnetfs/file-get-transcntl.c: New file.
2013-08-29daemons: fix setsid(2) in console-runJustus Winter
Only run setsid(2) if the process is not already the group leader. * daemons/console-run.c (open_console): Fix setsid(2).
2013-08-29hurd: add missing routines in process_reply.defsJustus Winter
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.
2013-08-29exec: remove the BFD codeJustus Winter
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.
2013-08-28exec: Remove #ifdef 0-out code for user specified exec servers.Justus Winter
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.
2013-08-28Do not build gzip/bzip2 supportSamuel Thibault
* exec/Makefile (SRCS): Remove gzip and bzip2 sources. (OBJS): Remove gzip and bzip2 objects.
2013-08-28Disable transparent gzip/bzip2 decompressionSamuel Thibault
* exec/Makefile (CPPFLAGS): Do not define GZIP and BZIP2 macros.
2013-08-28utils: add nullauth utilityJustus Winter
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.
2013-08-28tmpfs: drop privileges in the tmpfs translatorJustus Winter
* tmpfs/tmpfs.c (main): Drop privileges.
2013-08-28trans: drop privileges in the null translatorJustus Winter
* trans/null.c (main): Drop privileges.
2013-08-28libshouldbeinlibc: Add nullauth.{c,h}Justus Winter
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}.
2013-08-28console-client: add daemonizing supportJustus Winter
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.
2013-08-28Add configure checks for libdaemonJustus Winter
* configure.ac: Add check for libdaemon. * config.make.in: Make the libdaemon specific variables available.
2013-08-28Define and use symbolic names for important processesJustus Winter
* 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.
2013-08-28Optimize translator string copySamuel Thibault
* libnetfs/file-get-translator.c (netfs_S_file_get_translator): Call memcpy instead of memmove.
2013-08-28libnetfs: properly respond to file_get_translator requestsJustus Winter
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.
2013-08-28umount: add a umount utilityJustus Winter
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.
2013-08-28sutils: fix the semantic of -t, --types in fstab.cJustus Winter
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.
2013-08-28sutils: allow multiple entries for the device "none"Justus Winter
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".
2013-08-28mount: ignore mounted filesystems if --all is givenJustus Winter
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.
2013-08-28mount: implement -O, --test-optsJustus Winter
--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.
2013-08-28mount: add -f and --fake argumentsJustus Winter
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.