summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-08-09Support MSG_DONTWAIT in pflocal send/recvChristian Seiler
* pflocal/socket.c (S_socket_send): Also test for MSG_DONTWAIT in `flags' for the `noblock' parameter of pipe_send call. (S_socket_recv): Likewise for pipe_recv call.
2016-08-09sutils: New utility 'bless'.Justus Winter
* sutils/Makefile (progs): Add 'bless'. * sutils/bless.c: New file.
2016-08-08proc: Fix permission check.Justus Winter
* proc/mgt.c (S_proc_mark_important): Fix checking whether the receiver is a child of startup.
2016-08-08startup: Make the kernel a child of startup.Justus Winter
* startup/startup.c (frob_kernel_process): Make the kernel a child of startup, improve error reporting.
2016-08-07libpager: provide 'pager_create_alloc'Justus Winter
Add a variant to 'pager_create' that allocates memory for the user hook next to the pager data increasing locality. * console/pager.c (pager_clear_user_data): Fix type of 'idx', do not free 'upi'. (user_pager_create): Use the new function. * doc/hurd.texi: Document new function. * ext2fs/pager.c (pager_clear_user_data): Don't free 'upi'. (diskfs_get_filemap): Use the new function. * fatfs/pager.c (pager_clear_user_data): Don't free 'upi'. (diskfs_get_filemap): Use the new function. * isofs/pager.c (pager_clear_user_data): Don't free 'upi'. (diskfs_get_filemap): Use the new function. * libpager/pager-create.c (_pager_create): New generic allocation function. (pager_create): Use the new generic function. (pager_create_alloc): New function. * libpager/pager.h (pager_create_alloc): New prototype.
2016-08-07proc: Fix references to the startup server.Justus Winter
* proc/main.c: Fix references to the startup server in code and comments. * proc/mgt.c: Likewise. * proc/msg.c: Likewise. * proc/proc.h: Likewise.
2016-06-14pfinet: fix memory leakRichard Braun
* pfinet/socket-ops.c (S_socket_recv): Unmap data on error.
2016-06-07trans/crash: fix blunderJustus Winter
* trans/crash.c (S_crash_dump_task): Fix error handling.
2016-06-04Do not make io_select return errors on unsupported READ/WRITE modeSamuel Thibault
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.
2016-06-04trans/crash: fix resource leaksJustus Winter
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'.
2016-06-03nfs: appease the stricter reference counting mechanismJustus Winter
* nfs/cache.c (netfs_node_norefs): Do not re-acquire a reference to np. This worked previously, but the new reference counting primitives consider this a use after free. A reference is really not necessary here, we are about to deallocate np anyway. Amends 5eef605e.
2016-06-01Fix pipe_send() with no dataRichard Braun
* libpipe/pipe.c (pipe_send): Set value pointed to by amount to 0 if if nothing is written.
2016-05-30Complete allocation hooksSamuel Thibault
* mach-defpager/kalloc.c (realloc_hook, memalign_hook): New functions. (init_hook): Set __realloc_hook to realloc_hook and __memalign_hook to memalign_hook.
2016-05-30Revert "drop the deprecated malloc/free hooks in hurd/mach-defpager"Samuel Thibault
This reverts commit 8c49801c8f7e3f800cabedf8fca8ccec3cf35a22. The malloc hook is needed for calloc.
2016-05-23Revert part of "fix compiler warnings in hurd/exec"Thomas Schwinge
This reverts part of commit 05c3ffac543052c8d0b171a5f77bb977d5316a61. These type casts are no longer needed after the commit e914bfc3d6e5ddf6f8c5e93a4334873a48a24ddf changes. * exec/elfcore.c: Revert type casts added in commit 05c3ffac543052c8d0b171a5f77bb977d5316a61.
2016-05-23Make <sys/procfs.h> self-contained againThomas Schwinge
Commit e914bfc3d6e5ddf6f8c5e93a4334873a48a24ddf made <sys/procfs.h> Autoconf/configure tests change as follows: checking sys/procfs.h usability... [-yes-]{+no+} checking sys/procfs.h presence... yes {+configure: WARNING: sys/procfs.h: present but cannot be compiled+} {+configure: WARNING: sys/procfs.h: check for missing prerequisite headers?+} {+configure: WARNING: sys/procfs.h: see the Autoconf documentation+} {+configure: WARNING: sys/procfs.h: section "Present But Cannot Be Compiled"+} {+configure: WARNING: sys/procfs.h: proceeding with the compiler's result+} checking for sys/procfs.h...[-yes-]{+no+} [-checking for prstatus_t in sys/procfs.h... no-] [-checking for prstatus32_t in sys/procfs.h... no-] [-checking for prstatus_t.pr_who in sys/procfs.h... no-] [-checking for prstatus32_t.pr_who in sys/procfs.h... no-] [-checking for pstatus_t in sys/procfs.h... yes-] [-checking for pxstatus_t in sys/procfs.h... no-] [-checking for pstatus32_t in sys/procfs.h... no-] [-checking for prpsinfo_t in sys/procfs.h... no-] [-checking for prpsinfo_t.pr_pid in sys/procfs.h... no-] [-checking for prpsinfo32_t in sys/procfs.h... no-] [-checking for prpsinfo32_t.pr_pid in sys/procfs.h... no-] [-checking for psinfo_t in sys/procfs.h... yes-] [-checking for psinfo_t.pr_pid in sys/procfs.h... yes-] [-checking for psinfo32_t in sys/procfs.h... no-] [-checking for psinfo32_t.pr_pid in sys/procfs.h... no-] [-checking for lwpstatus_t in sys/procfs.h... yes-] [-checking for lwpxstatus_t in sys/procfs.h... no-] [-checking for lwpstatus_t.pr_context in sys/procfs.h... no-] [-checking for lwpstatus_t.pr_reg in sys/procfs.h... yes-] [-checking for lwpstatus_t.pr_fpreg in sys/procfs.h... yes-] [-checking for win32_pstatus_t in sys/procfs.h... no-] That is because of: $ echo '#include <sys/procfs.h>' | gcc -x c - -o /dev/null -S In file included from <stdin>:1:0: /usr/include/sys/procfs.h:66:3: error: unknown type name ‘vm_address_t’ vm_address_t pr_argv; /* Original argument vector address. */ ^ /usr/include/sys/procfs.h:67:3: error: unknown type name ‘vm_address_t’ vm_address_t pr_envp; /* Original environment vector address. */ ^ * include/sys/procfs.h: Include <mach/std_types.h> to make file self-contained again.
2016-05-22ext2fs: fix pager use-after-freeJustus Winter
Previously, pagers had no reference for being part of a node, only for having a send right made for them. Hence we sometimes saw use-after-free errors if the kernel did give up that send right, typically while deleting files. Keep a weak reference as long as the pager is referenced by a node. * ext2fs/pager.c (pager_clear_user_data): Assert that 'pager' has been NULLed. (pager_dropweak): Drop the weak reference and NULL 'pager'. (diskfs_get_filemap): Simplify. Acquire a weak reference.
2016-05-22libdiskfs: fix error handlingJustus Winter
* libdiskfs/dir-rmdir.c (diskfs_S_dir_rmdir): Initialize 'np'.
2016-05-19Avoid superfluous locking of nodeJustus Winter
* libdiskfs/io-restrict-auth.c (diskfs_S_io_restrict_auth): Do not lock the associated node. No operation here needs synchronization. * libnetfs/io-restrict-auth.c (netfs_S_io_restrict_auth): Likewise.
2016-05-19utils/settrans: implement active translator stackingJustus Winter
* utils/settrans.c (OPT_STACK): New macro. (options): New option. (main): Handle new option. (open_node): Use different flags for the lookup of the underlying node.
2016-05-19libnetfs: treat disconnected shadow roots as virtual rootsJustus Winter
* libnetfs/dir-lookup.c (netfs_S_dir_lookup): Treat a shadow_root with null shadow_root_parent as a "virtual root". Analog to 6875a586.
2016-05-19Unify the short-circuit translator logicJustus Winter
* libdiskfs/dir-lookup.c (short_circuited_callback1): Move function to libfshelp. (diskfs_S_dir_lookup): Use the function from libfshelp instead. * libdiskfs/fsys-getroot.c (diskfs_S_fsys_getroot): Adapt accordingly. * libdiskfs/trans-callback.c (_diskfs_translator_callback2_fn): Likewise. * libfshelp/fetch-root.c (fshelp_short_circuited_callback1): New function. * libfshelp/fshelp.h (struct fshelp_stat_cookie): New definition. (fshelp_short_circuited_callback1): New prototype. * libnetfs/dir-lookup.c (short_circuited_callback1): Drop function. (netfs_S_dir_lookup): Use the function from libfshelp instead. * libnetfs/fsys-getroot.c (netfs_S_fsys_getroot): Adapt accordingly. * libnetfs/trans-callback.c (_netfs_translator_callback2_fn): Likewise.
2016-05-19libdiskfs: cosmetic changesJustus Winter
* libdiskfs/dir-lookup.c (diskfs_S_dir_lookup): Rename identifiers to be more idiomatic and closer to libnetfs and the interface specification. Massage the code so that it aligns closer with the dir_lookup server function in libnetfs. It should not change the behavior.
2016-05-19libnetfs: rename 'diruser' to 'dircred'Justus Winter
* libnetfs/dir-lookup.c (netfs_S_dir_lookup): Rename 'diruser' to 'dircred'.
2016-05-19libnetfs: rename 'error' to 'err'Justus Winter
* libnetfs/dir-lookup.c (netfs_S_dir_lookup): Rename 'error' to 'err'.
2016-05-19mach-defpager: fix panic invocationJustus Winter
* mach-defpager/default_pager.c (default_pager_thread): Fix panic invocation.
2016-05-18GNU Hurd 0.8Thomas Schwinge
* configure.ac (AC_INIT): Set version to 0.8. * NEWS: Finalize for 0.8.
2016-05-16Complete changes to use -L instead of -Wl,-rpath-linkThomas Schwinge
Changes missing from commit c9c29eb890527fe68900e4a0af7c2df9a9fa5b40. * console-client/Makefile (%.so.$(hurd-version)): Use $(lpath) instead of $(rpath) * libstore/Makefile (libstore_%.so.$(hurd-version)): Likewise.
2016-05-09startup: fix blunderJustus Winter
Fixes b04364bc. Thanks to Esa Peuha for spotting this. * startup/startup.c (run): Fix blunder.
2016-05-03libihash: enable fast insertions replacing tombstonesJustus Winter
* libihash/ihash.c (hurd_ihash_locp_add): Also replace tombstones.
2016-05-03libihash: fix corner caseJustus Winter
* libihash/ihash.c (hurd_ihash_locp_find): Set SLOT to NULL if the hash table has not been allocated.
2016-05-03Fix privileged operations on trivfs-translated nodesJustus Winter
Amends d18ea50e. * libtrivfs/fsys-getroot.c: When the user is privileged, make a verbatim copy of the real node instead of making an auth-restricted copy.
2016-05-03Fix buildSamuel Thibault
* trans/crash.c: Include <assert.h>.
2016-04-29libihash: rehash if effective load exceeds the thresholdJustus Winter
Previously, if a hash table was not growing anymore but entries were regularly replaced, the tombstones would accumulate slowing down lookups and insertions. A possible solution is to rehash the table if the effective load exceeds the configured threshold. The effective load also takes tombstones into account. * libihash/ihash.c (hurd_ihash_locp_add): Use the effective load. (hurd_ihash_add): Likewise. Use the load to decide whether we want to enlarge the table, otherwise we merely rehash.
2016-04-29libihash: keep track of free slotsJustus Winter
* libihash/ihash.c (hurd_ihash_init): Init new field 'nr_free'. (add_one): Decrement counter if a free slot is used. (hurd_ihash_locp_add): Likewise. (hurd_ihash_add): Reset counter on reallocation. * libihash/ihash.h (struct hurd_ihash): New field 'nr_free'. (hurd_ihash_get_effective_load): New function.
2016-04-29libihash: fix index computationJustus Winter
Previously, find_index would return a suboptimal slot if a tombstone was in the optimal slot. * libihash/ihash.c (find_index): Fix index computation.
2016-04-29Fix root operations on trivfs-translated nodesSamuel Thibault
* libtrivfs/fsys-getroot.c: When `uids` contain 0, make a verbatim copy of the real node instead of making an auth-restricted copy.
2016-04-28startup: write all messages to stderrJustus Winter
This avoids the need to flush the buffer and works around a weird problem with 'puts' not printing a newline. * startup/startup.c: Write all messages to stderr.
2016-04-28startup: use the generated default server implementationsJustus Winter
* startup/Makefile: Set appropriate flags. * startup/startup.c: Drop most stub functions.
2016-04-28startup: add verbose parameterJustus Winter
* startup/startup.c: Add verbose parameter and inform about progress through the bootstrap procedure if it is given.
2016-04-28startup: implement bits of the fs and io protocolsJustus Winter
* startup/Makefile: Build fs and io server with default implementations. (mung_msg_S.h): Tune regexp only to match the include guard. * startup/startup.c (mig_reply_setup): New function. (demuxer): Add new protocols. Nicer implementation. (S_file_check_access): New function. (S_io_restrict_auth): Likewise.
2016-04-28Unify and document the way fsids are handled in trivfs translatorsJustus Winter
* 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.
2016-04-27libshouldbeinlibc: use the new assert in the refcount primitivesJustus Winter
* libshouldbeinlibc/refcount.h: Use 'assert_backtrace'.
2016-04-27libshouldbeinlibc: add assert(3) variant that prints backtracesJustus Winter
* libshouldbeinlibc/Makefile: Add new files * libshouldbeinlibc/assert-backtrace.{c,h}: New files.
2016-04-27libpager: add missing includeJustus Winter
* libpager/demuxer.c: Include <assert.h>.
2016-04-26libdiskfs: Reject LFS seeks and read/writesSamuel Thibault
vm_offset_t (used by pager_memcpy) is not 64bit-ready yet. Reject requests which go further than this. * libdiskfs/io-seek.c (diskfs_S_io_seek): Return EFBIG when requested offset is beyond limits of vm_offset_t. * libdiskfs/rdwr-internal.c (_diskfs_rdwr_internal): Return EFBIG when request goes beyond limits of vm_offset_t.
2016-04-26Fix supporting >4GiB files in ext2fsSamuel Thibault
* ext2fs/inode.c (diskfs_user_read_node): When sizeof(off_t) >= 8, add di->i_size_high as high-64bit part to st->st_size. Drop setting unused info->i_high_size. (write_node): When sizeof(off_t) >= 8, write high-64bit part of st->st_size to di->i_size_high. * ext2fs/ext2_fs_i.h (ext2_inode_info): Remove i_high_size field. * pfinet/linux-src/include/linux/ext2_fs_i.h (ext2_inode_info): Likewise.
2016-04-26libtrivfs: fix notion of privileged userJustus Winter
Set 'is_root' if the node has been opened by the root user (this was the old behavior) or if it has been opened by the user the translator is executing under. This fixes the irritating bug that an unprivileged user cannot control her own trivfs-based translators. It does not change how privileged trivfs translators work. * libtrivfs/io-reauthenticate.c (trivfs_S_io_reauthenticate): Use the new function to compute 'isroot'. * libtrivfs/io-restrict-auth.c (trivfs_S_io_restrict_auth): Likewise. * libtrivfs/open.c (trivfs_open): Likewise. * libtrivfs/priv.h (_is_privileged): New function. * libtrivfs/trivfs.h (struct peropen): Clarify what 'isroot' means.
2016-04-26libtrivfs: fix error handlingJustus Winter
* libtrivfs/times.c (trivfs_set_{a,m}time): Fix error handling.
2016-04-26libdiskfs: improve error handlingJustus Winter
* libdiskfs/boot-start.c (diskfs_start_bootstrap): Improve error handling.