summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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.
2016-04-24Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurdSamuel Thibault
2016-04-24Fix access mode of temporary filesSamuel Thibault
* libnetfs/dir-mkfile.c (netfs_S_dir_mkfile): Keep flags out of OPENONLY_STATE_MODES, instead of flags of OPENONLY_STATE_MODES, for the peropen's openstat.
2016-04-20libfshelp: pass cookie to the callback functionJustus Winter
Previously, NULL was passed as cookie. That notably caused some 'peropen' objects to be created without context. Fixes 0bb14d0b. * libfshelp/fetch-root.c (fshelp_fetch_root): Pass cookie to the callback function.
2016-04-19mach-defpager: fix error handlingJustus Winter
* mach-defpager/default_pager.c (S_default_pager_storage_info): Fix error handling.
2016-04-18Make make install idempotentSamuel Thibault
* sutils/Makefile ($(prefix)/dev/MAKEDEV): Add -f to ln command.
2016-04-17utils/settrans: add option to specify the underlying nodeJustus Winter
* utils/settrans.c (options): Add '--underlying'. (main): Handle new option. (open_node): Open the node if given.
2016-04-17utils/settrans: get an authenticated root node in chroot modeJustus Winter
* utils/settrans.c (get_credentials): New function. (main): Get an authenticated root node for the process we are chrooting. Signed-off-by: Justus Winter <justus@gnupg.org>
2016-04-17isofs: make superblock detection more robustJustus Winter
* isofs/isofs.h (disk_image_len): New variable. * isofs/main.c (read_sblock): Avoid out of bounds access. * isofs/pager.c (disk_image_len): New variable. (create_disk_pager): Initialize 'disk_image_len'.
2016-04-15Update NEWS fileJustus Winter
2016-04-04Use posix types for mig definitions.Flavio Cruz
* hurd/hurd_types.defs: Use posix types. * libfshelp/start-translator-long.c: Use uint32_t instead of unsigned32_t.
2016-03-24Use swapon path as pager partition pathSamuel Thibault
When /dev/hd* entries are parted-partition storeio, the store name is only the disk name, thus not unique. We should just use the path being used instead. * sutils/swapon.c (swaponoff): Use `file' instead of `store->name' to default_pager_paging_file. (main): Drop hardcoded "/dev/". * procfs/rootdir.c (rootdir_gc_swaps): Drop hardcoded "/dev/".
2016-03-24Fix swap information numbersSamuel Thibault
* procfs/rootdir.c (rootdir_gc_swaps): Fix default_pager_storage_info call parameter order. * sutils/swapon.c (main): Likewise.
2016-03-21netfs: Remove global reference count lock.Flavio Cruz
* 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.
2016-03-20pflocal: Add support for access() on pipesSamuel Thibault
bash's '<(' helper creates a pipe and gives /dev/fd/63 to the program, and gcc would then run access() on it. So we actually need to support at least some FS operations on pipes. * pflocal/fs.c: New file. * pflocal/mig-mutate.h (FILE_INTRAN, FILE_INTRAN_PAYLOAD, FILE_DESTRUCTOR, FILE_IMPORTS): New macros. * pflocal/sserver.c: Include "fs_S.h". (sock_demuxer): Call fs_server_routine. * pflocal/Makefile (SRCS): Add fs.c. (MIGSTUBS): Add fsServer.o.
2016-03-19Fix spurious port deallocationSamuel Thibault
* libfshelp/fetch-root.c (fshelp_fetch_root): When translator has died, do not deallocate its control port twice.
2016-03-18ext2fs: Fix off-by-oneSamuel Thibault
* ext2fs/pager.c (disk_cache_init): Do not add disk_cache_info[disk_cache_blocks] to disk_cache_info_free.
2016-03-16Add getting swap information from swapon and procfsSamuel Thibault
* 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.
2016-03-15Show firmlink mounts to mount pointsSamuel Thibault
* trans/mtab.c (mtab_populate): Always open the underlying node, and pass it to mtab_mark_as_seen instead of the translated node.
2016-03-15Add get_source support to firmlinkSamuel Thibault
* trans/firmlink.c (trivfs_get_source): New function.
2016-03-15ext2fs: Fix adding blocks to free blocks cacheSamuel Thibault
* ext2fs/pager.c (disk_cache_info_free_push): Add prototype. (disk_pager_notify_evict): When dropping DC_INCORE flag, if the block becomes free (no reference and no DC_DONT_REUSE flags), call disk_cache_info_free_push. (disk_cache_block_deref): Only call disk_cache_info_free_push if the flags of the block do not contain DC_DONT_REUSE flags.
2016-03-13Add missing RPC definitionsSamuel Thibault
* hurd/process_request.defs (proc_make_task_namespace_request): New definition. * hurd/process_reply.defs (proc_make_task_namespace_reply): Skip definition.
2016-03-07utils/fakeauth: fix invocation of programs from PATHJustus Winter
* utils/fakeauth.c (main): Replace the right element of the argument vector. This fixes running scripts from PATH using fakeroot.
2016-02-29Fix parallel buildSamuel Thibault
* console-client/Makefile (parser.tab.h): Redefine the standard yacc rule to make it build the header too, to avoid concurrency between the standard yacc rule and the rule that builds the header. * sutils/Makefile (OBJS): Append .o suffix to $(progs) instead of .c.
2016-02-28Fix use-after-free in libps.Esa Peuha
* libps/fmt.c (_fmt_create): Free new_fmt->src before new_fmt if reallocating fields fails.
2016-02-28Fix mustbedir mechanism for symlinksSamuel Thibault
* libdiskfs/dir-lookup.c (diskfs_S_dir_lookup): When following a symlink, if mustbedir is true, always append a slash to the symlink target, not only when the target is absolute. Reset mustbedir to 0 before continuing the lookup loop. * libnetfs/dir-lookup.c (netfs_S_dir_lookup): When following a symlink, if mustbedir is true, append a slash to the symlink target. Reset mustbedir to 0 before continuing the lookup loop. * libtreefs/dir-lookup.c (_treefs_s_dir_lookup): Likewise.
2016-02-27Fix parallel installSamuel Thibault
* sutils/Makefile (install): Do not depend on $(prefix)/dev. ($(prefix)/dev/MAKEDEV): Depend on $(prefix)/devĀ²
2016-02-23libports: preserve the complex message flagJustus Winter
* libports/manage-multithread.c (internal_demuxer): Preserve all message flags when we store the objects address as payload in the message. * libports/manage-one-thread.c (internal_demuxer): Likewise.