aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* lwip translator: Remove unused reference to config.hJoan Lledó2018-05-021-1/+0
|
* Revert "MAX_SOCKETS: New patch implementing unlimited number of sockets"Samuel Thibault2018-05-021-247/+0
| | | | This reverts commit 05403a6e3a72c085e25b46c3173efde4cf64c21f.
* Include required sockets headersJoan Lledó2018-05-014-0/+6
| | | | | | | * lwip/iioctl-ops.c: Include <lwip/inet.h>. * lwip/lwip-util.c: Likewise. * lwip/pfinet-ops.c: Include <lwip/sockets.h> and <lwip/inet.h>. * lwip/port/netif/hurdethif.c: Likewise.
* MAX_SOCKETS: New patch implementing unlimited number of socketsJoan Lledó2018-05-011-0/+247
|
* Fix DESTDIR supportSamuel Thibault2018-04-228-48/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding $(DESTDIR) to paths in config.make.in brings redundant additions when e.g. datarootdir is "${datadir}". The viable way is to just fix the installation rules. * Makeconf (install, install-headers): Prepend $(DESTDIR) to dependencies. ($(DESTDIR)$(installationdir)): New rule. ($(addprefix $(installationdir)/,$(installable))): Prepend $(DESTDIR). ($($(includedir)/$(installhdrsubdir))): Likewise. ($(addprefix $(libdir)/$(libname),_p.a .a _pic.a)): Likewise. ($(libdir)/$(libname).so.$(hurd-version)): Likewise. ($(libdir)/$(libname).so): Likewise. ($(addprefix $(includedir)/$(installhdrsubdir)/,$(installhdrs))): Likewise. ($(installationdirlist)): Likewise. * config.make.in (hurddir, libdir, bindir, sbindir, includedir, libexecdir, bootdir, infodir, sysconfdir, localstatedir, sharedstatedir, datadir, datarootdir): Remove $(DESTDIR). * config/Makefile (install): Prepend $(DESTDIR) to dependencies. ($(sysconfdir)/login): Prepend $(DESTDIR). ($(installed_logins)): Likewise. ($(installed_conf)): Likewise. * console-client/Makefile (install): Prepend $(DESTDIR) to dependencies. ($(module-dir)): Prepend $(DESTDIR). ($(module-dir)/%): Likewise. ($(XKB_BASE)): Likewise. ($(XKB_BASE)/%): Likewise. * hurd/Makefile (install-headers, install-msgids): Prepend $(DESTDIR) to dependencies. ($(includedir)/hurd/%): Prepend $(DESTDIR). ($(datadir)/msgids, $(includedir)/hurd): Prepend $(DESTDIR). * include/Makefile (install): Prepend $(DESTDIR) to dependencies. ($(includedir)/%): Prepend $(DESTDIR). * libstore/Makefile (install): Prepend $(DESTDIR) to dependencies. ($(store-types:%=$(libdir)/libstore_%.a): Prepend $(DESTDIR). * sutils/Makefile (install): Prepend $(DESTDIR) to dependencies. ($(prefix)/dev/MAKEDEV): Prepent $(DESTDIR). ($(prefix)/dev): Likewise.
* exec: Leave room for mmaps etc. before PIE binariesSamuel Thibault2018-04-221-0/+3
| | | | | | | | otherwise there might not even be enough room to run RPCs during rtld bootstrap. * exec/exec.c (do_exec): Add 128MiB to anywhere_start before loading program.
* exec: Fix else branchSamuel Thibault2018-04-221-19/+21
| | | | | | | which happened to have no nefarious consequences by luck. * exec/exec.c (load_section): Add braces around commented code to fix else branch.
* exec: document why mask code is currently commentedSamuel Thibault2018-04-221-0/+5
|
* Support $(DESTDIR)Samuel Thibault2018-04-021-13/+13
| | | | | | | as reported by Sergei Trofimovich * config.make.in (hurddir, libdir, bindir, sbindir, includedir, libexecdir, bootdir, infodir, sysconfdir, localstatedir, sharedstatedir, datadir, datarootdir): Prepend $(DESTDIR).
* Add file_utimens RPC to use a struct timespecFlávio Cruz2018-03-0522-136/+341
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and update the servers to use UTIME_NOW and UTIME_OMIT. * console-client/trans.c (netfs_attempt_utimes): Do not set current time ourself. * console/console.c (netfs_attempt_utimes): Likewise. * ftpfs/netfs.c (netfs_attempt_utimes): Likewise. * hostmux/node.c (netfs_attempt_utimes): Likewise. * usermux/node.c (netfs_attempt_utimes): Likewise. * nfs/ops.c (netfs_attempt_utimes): Likewise. * doc/hurd.texi (file_utimens): Add documentation. * hurd/fs.defs (file_utimens): Add RPC. * libdiskfs/file-utimes.c (diskfs_S_file_utimes): Move implementation and replace with translation layer with... (diskfs_S_file_utimens): ... new function. * libnetfs/file-utimes.c (netfs_S_file_utimes): Likewise with... (netfs_S_file_utimens): ... new function. * libnetfs/init-init.c: Include <error.h>. (netfs_mtime): New variable. (netfs_init): New function. * libnetfs/netfs.h (netfs_attempt_utimes): Update documentation. * libnetfs/priv.h (netfs_mtime): Declare variable. * libtreefs/s-file.c (treefs_S_file_utimes): Convert time values and call treefs_s_file_utimens instead of treefs_s_file_utimes. * libtreefs/treefs-hooks.h: Replace TREEFS_HOOK_S_FILE_UTIMES with TREEFS_HOOK_S_FILE_UTIMENS. * libtreefs/treefs-s-hooks.h: Replace s_file_utimes with s_file_utimens. * libtrivfs/file-utimes.c (trivfs_S_file_utimens): New function. * libtrivfs/times.c (trivfs_set_atime): Try to use file_utimens before using file_utimes. (trivfs_set_mtime): Likewise. * nfsd/ops.c (complete_setattr): Likewise. * trans/fakeroot.c (netfs_attempt_utimes): Likewise. * nfs/nfs.c (xdr_encode_sattr_times): Do not set atime or mtime when they are NULL. * configure.ac: Look for file_futimens, and define UTIME_NOW/OMIT, for compatibility with old glibcs.
* Fix warningsSamuel Thibault2018-03-0527-11/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libdiskfs/boot-start.c (diskfs_start_bootstrap): Fix printf format. * libfshelp/delegate.c: Include <alloca.h> and <stdlib.h>. * libfshelp/start-translator-long.c: Include <stdlib.h>. * libshouldbeinlibc/ugids-verify-auth.c (server_verify_make_auth): Fix prototypes for password_check_group and password_check_user. * libstore/argp.c: Include <stdlib.h>. * libstore/task.c: Include <stdlib.h>. * exec/exec.c: Include <mach/vm_param.h>. * libbpf/bpf_impl.c: Include <stdlib.h>. * proc/info.c (S_proc_getloginpids): Remove local variables leader_task and leader_sub. * proc/main.c (main): Remove local variable original_argv. * boot/boot.c (task_died, S_mach_notify_new_task): Fix printf format. * exec/elfcore.c: Include <alloca.h> and <mach/vm_param.h>. * trans/crash.c: Include <hurd/msg.h>. * trans/random.c: Include <signal.h>. * utils/login.c: Include <signal.h>. * utils/id.c: Include <hurd/msg.h>. * utils/devprobe.c: Include <stdlib.h>. * utils/addauth.c: Include <hurd/msg.h>. * utils/frobauth-mod.c: Include <hurd/msg.h>. * utils/storeread.c: Include <stdlib.h>. * utils/msgport.c: Include <hurd/msg.h>. * sutils/clookup.c (file_name_lookup_carefully): Fix lookup function prototype, make head and tail const. * utils/rpcscan.c: Include <stdlib.h>. * sutils/bless.c: Include <stdlib.h>. * fstests/fstests.c: Include <stdlib.h>. * startup/startup.c (argz_task_insert_right): Fix printf format. * init/init.c: Include <stdlib.h>.
* Add missing includeSamuel Thibault2018-03-051-0/+1
| | | | * libshouldbeinlibc/wire.c: Include <mach/vm_param.h>.
* Avoid using loff_tSamuel Thibault2018-03-041-2/+2
| | | | | | | It may not be available depending on standard selection. * hurd/hurd_types.h (off_array_t, const_off_array_t): Use __loff_t instead of loff_t.
* Add missing lib in linkSamuel Thibault2018-02-111-1/+2
| | | | * Makefile (rpcscan): Depend on ../libshouldbeinlibc/libshouldbeinlibc.a.
* Add compatibility with previous value of _POSIX_VDISABLESamuel Thibault2018-01-291-2/+6
| | | | | | | | Setting _POSIX_VDISABLE to -1 was actually not POSIX compliant, so it was changed to '\0'. Keep the compatibility for now. * term/munge.c (term/munge.c): Consider (unsigned char) -1 as _POSIX_VDISABLE.
* Add const MIG typesSamuel Thibault2018-01-282-0/+10
| | | | | | | | * hurd/default_pager_types.h (const_recnum_array_t, const_vm_size_array_t): New types. * hurd/hurd_types.h (const_data_t, const_intarray_t, const_fd_mask_t, const_portarray_t, const_pidarray_t, const_idarray_t, const_off_array_t, *const_procinfo_t): New types.
* Fix warningsSamuel Thibault2018-01-281-4/+4
| | | | | * utils/nullauth.c (argp_program_version, options, doc[], args_doc): Drop duplicate const qualifier.
* Fix warningSamuel Thibault2018-01-281-1/+1
| | | | | * trans/streamio.c (io_select_common): Do not needlessly check that buffer_writable is not NULL, it is a static inline.
* Fix warningSamuel Thibault2018-01-281-0/+1
| | | | * libiohelp/iouser-create.c: Include <stdlib.h>.
* Fix firmlinks showing up in /proc/mountsSamuel Thibault2018-01-161-0/+8
| | | | | | | mtab checks for fsys_get_options. * trans/firmlink.c: Include <argz.h>. (trivfs_append_args): New function.
* Revert "libdiskfs: Shutdown pagers on startup_dosync."Samuel Thibault2018-01-151-1/+33
| | | | | | | | | | | This reverts commit 89a49ec8b3a847f3b770cff6a4a80b98b94ad7bf. There was a typo in diskfs_shutdown (FSYS_GOAWAY_FORCE || FSYS_GOAWAY_RECURSE) which was making it FSYS_GOAWAY_NOWAIT, and thus not actually syncing if there happens to be clients (it was then returning EBUSY). Fixing this into FSYS_GOAWAY_FORCE | FSYS_GOAWAY_RECURSE then makes it wait for clients (and NOWAIT is not supported), and there are very often some left, thus not syncing either.
* Implement /proc/<pid>/exeSamuel Thibault2018-01-0810-3/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by adding proc_set/get_exe to the proc server, making exec call proc_set_exe, and libps call proc_get_exe. procfs can then just retrieve the information to make the "exe" symlink. * hurd/process.defs (proc_set_exe, proc_get_exe): New RPCs. * hurd/process_request.defs: Likewise. * hurd/process_reply.defs: Add skips for proc_set_exe and proc_get_exe RPCs. * proc/proc.h (struct proc): Add `exe' field. * proc/info.c (S_proc_set_exe, S_proc_get_exe): New functions. * proc/mgt.c (process_has_exited): Free p->exe. (S_proc_child): Duplicate parent `exe' into child's `exe'. * exec/exec.c (do_exec): Call proc_set_exe when a filename is available. * libps/ps.h (struct proc_stat): Add `exe_vm_alloced', `exe', and `exe_len' field. (PSTAT_EXE): New macro. (PSTAT_USER_BASE): Change value to make room. (proc_stat_exe, proc_stat_exe_len): New macros. * libps/procstat.c (proc_stat_set_flags): Handle PSTAT_EXE case by calling proc_get_exe. * libps/spec.c (ps_get_exe): New function. (ps_exe_getter): New structure. (ps_fmt_spec): Add "Exe" specification. * procfs/process.c (process_file_symlink_make_node, process_file_gc_exe): New functions. (procfs_dir_entry): Add "exe" entry. * startup/startup.c (launch_core_servers): Set exe paths for startup, auth, proc, and fs servers. (frob_kernel_process): Set exe path for kernel task. (S_startup_essential_task): Set exe path for exec server.
* Add support for $ORIGIN rpath expansionSamuel Thibault2018-01-081-4/+83
| | | | | * exec/exec.c (do_exec): When abspath is absolute, record its dirname into the LD_ORIGIN_PATH environment variable.
* Fix exec_paths through fakeroot or chrootJustus Winter2018-01-081-42/+51
| | | | | | | | | | | | | | | | | | | | | | If file_name_exec is not given, check_hashbang will try to locate the file. If argv[0] contains a '/', the file path is assumed to be absolute and it will try to open the file. Otherwise, the file is searched in the PATH. In either case, the resulting file identity port is compared to the identity port of the original file handle passed to check_hashbang. exec_paths_exec.patch explicitly provides the script files path in file_name_exec. According to the comment, if this path is provided, it is assumed to be the path to the script file and no attempt at locating the script file is done. However, the identity ports are still compared. This cannot succeed if fakeroot or chroot is used, because the process doing the exec and thus the initial file lookup is running in the chrooted environment, while the exec server is not. Fix this by skipping the identity test if file_name_exec is provided. * exec/hashexec.c (check_hashbang): Skip the file identity test if the file_name_exec is provided.
* rpctrace: Pass prefixed_name to _hurd_exec_paths.Kalle Olavi Niemitalo2018-01-081-2/+5
| | | | | | | | | | | | | | | | | | | | | This fixes the following test case: mkdir testy echo '#! /bin/bash' > testy/prog echo 'printf "%s\n" "$0"' >> testy/prog chmod +x testy/prog PATH=$(pwd)/testy /bin/rpctrace -E PATH=/usr/bin:/bin -o /dev/null prog Before this patch, the output is: /bin/bash: prog: No such file or directory After this patch, the output is similar to: /home/kalle/testy/prog * utils/rpctrace.c (traced_spawn): Get prefixed_name from file_name_path_lookup and pass it to _hurd_exec_paths.
* Use the new _hurd_exec_file_name functionEmilio Pozuelo Monfort2018-01-084-6/+18
| | | | | | | | | * configure.in: Check for _hurd_exec_paths. * utils/fakeauth.c: Call _hurd_exec_paths instead of _hurd_exec if it's available. * utils/shd.c: Likewise. * utils/rpctrace.c: Get prefixed_name from file_name_path_lookup and pass it to _hurd_exec_paths instead of calling _hurd_exec.
* Add a file_exec_file_name RPCEmilio Pozuelo Monfort2018-01-0814-109/+395
| | | | | | | | | | | | | | | | | | | | | | * hurd/fs.defs (file_exec): Deprecate in favor of... (file_exec_paths): ...this new RPC. * TODO: Update. * doc/hurd.texi: Update RPC name. * hurd/hurd_types.h: Update RPC name. * libdiskfs/boot-start.c: Update RPC name. * configure.ac: Check for presence of RPC stubs file_exec_paths exec_exec_paths. * exec/hashexec.c (check_hashbang): When file_exec_paths is available, use it instead of file_exec. * startup/startup.c (run, run_for_real, start_child): Likewise. * utils/login.c (main): Likewise. * libfshelp/start-translator-long.c (fshelp_start_translator_long): Likewise. * libdiskfs/file-exec.c (diskfs_S_file_exec): Move code to new function diskfs_S_file_exec_paths and call it. (diskfs_S_file_exec_paths): New function, use exec_exec_paths when available instead of exec_exec * libnetfs/file-exec.c (netfs_S_file_exec, netfs_S_file_exec_paths): Likewise. * trans/fakeroot.c (netfs_S_file_exec, netfs_S_file_exec_paths): Likewise. * libtrivfs/file-exec.c (trivfs_S_file_exec_paths): New function.
* Add a new exec_exec_paths RPCEmilio Pozuelo Monfort2018-01-085-16/+84
| | | | | | | | | | | | * hurd/exec.defs (exec_exec): Label as deprecated. (exec_exec_paths): New RPC. * doc/hurd.texi: Update accordingly. * exec/hashexec.c (check_hashbang): Add file_name_exec argument. Don't guess the file name if file_name_exec is set. * exec/priv.h (check_hashbang): Add path argument. * exec/exec.c (S_exec_exec): Label as deprecated. (S_exec_exec_paths): New function. (do_exec): Add path and abspath arguments, pass path to check_hashbang.
* libfshelp/get-identity.c: Simplify checking weak referencesSamuel Thibault2018-01-061-5/+4
| | | | | * libfshelp/get-identity.c (id_clean): Test whether i is still in the hash table instead of counting weak references.
* libihash: Make sure we do not remove a locp several timesSamuel Thibault2018-01-062-0/+3
| | | | | | | | Suggested by Brent W. Baccala. * libihash/ihash.c: Include <assert-backtrace.h>. (locp_remove): Assert that item->value is valid. * libihash/Makefile (HURDLIBS): Add shouldbeinlibc.
* libfshelp/get-identity.c: Avoid spurious ihash removalSamuel Thibault2018-01-061-2/+5
| | | | | | | | | | | | Reported by Brent W. Baccala. While some thread has converted a hardref to a weakref and tries to release the hash weakref, another thread might reacquire a hardref, and then convert it to a weakref and try to release it. We thus have to make sure that we really have the last weakref before removing from the hash. * libfshelp/get-identity.c (id_clean): Also check that there are only two weak refs left.
* libfshelp/get-identity: Use 64bit hashing for inodesSamuel Thibault2018-01-061-4/+32
| | | | | | | | | | | | | | Reported by Brent W. Baccala. hurd_ihash_key_t is 32bit only on 32bit platforms, so we need the same hashing functions as in libdiskfs/node-cache.c. * libfshelp/get-identity.c (mix_fasthash): New macro. (hash, compare): New functions. (idhash): Use HURD_IHASH_INITIALIZER_GKI instead of HURD_IHASH_INITIALIZER to pass hash and compare. (fshelp_get_identity): Pass address of fileno to hurd_ihash_find and hurd_ihash_add instead of fileno itself.
* libfshelp/get-identity.c: add FIXMESamuel Thibault2018-01-051-0/+1
| | | | | * libfshelp/get-identity.c (fshelp_get_identity): Add FIXME for FS with inode numbers bigger than 4 billion.
* libfshelp: Add weak reference for hash table referenceSamuel Thibault2017-12-191-2/+10
| | | | | | | | | | | Fixes reference w/o send right crash. * libfshelp/get-identity.c (fshelp_get_identity): Get weak reference for the hash table reference. (id_initialize): Pass id_clean as dropweak_routine instead of clean_routine to ports_create_class. (id_clean): Remove from hash table only if there are no hard references left, i.e. we didn't reacquired a port right in between.
* lwip: Add LwIP-based TCP/IP translatorJoan Lledó2017-12-1828-0/+4892
| | | | | | | | * Makefile (prog-subdirs): Add lwip. * config.make.in (HAVE_LIBLWIP, liblwip_CFLAGS, liblwip_LIBS): Define variables. * configure.ac: Check for liblwip. * lwip/: New directory.
* Record executable entry for PIE core dumpsSamuel Thibault2017-12-117-0/+53
| | | | | | | | | | | | * hurd/process.defs (proc_set_entry, proc_get_entry): New RPCs. * hurd/process_reply.defs: Add skips for proc_set_entry, proc_get_entry. * hurd/process_request.defs: Likewise. * exec/exec.c (do_exec): Call proc_set_entry. * proc/proc.h (proc): Add p_entry field. * proc/mgt.c (S_proc_set_entry, S_proc_get_entry): New RPC implementations. * exec/elfcore.c (dump_core): Add at_entry note, call proc_get_entry to get it, and write it with WRITE_NOTE.
* Reserve IDs for proc_set_exe and proc_get_exeSamuel Thibault2017-12-113-0/+9
| | | | | | * hurd/process.defs: Reserve IDs for proc_set_exe and proc_get_exe * hurd/process_reply.defs: Likewise. * hurd/process_request.defs: Likewise.
* Make devprobe able to talk with userland driversSamuel Thibault2017-11-071-0/+13
| | | | | | | * utils/devprobe.c: Include <fcntl.h> (options): Add "master-device" ('M') option. (main): Handle 'M' option by opening the given filename for `device_master'.
* pfinet: Fix array size hardcoded valueSamuel Thibault2017-09-261-1/+1
| | | | | | | as hinted by Joan Lledó * pfinet/iioctl-ops.c (get_dev): Set ifname size to IFNAMSIZ instead of hardcoded value
* pfinet: Avoid returning udp errors unless requestedSamuel Thibault2017-09-261-21/+6
| | | | | | | This comes from Linux 2.3.40 to 2.3.41 changes, to fix its behavior according to common practice. Unconnected udp sockets notably should not report errors, since the application doesn't have a way to relate it with previous sends.
* eth-multiplexer: Avoid copying data multiple times.Justus Winter2017-09-252-22/+15
| | | | | | | * eth-multiplexer/vdev.c (broadcast_pack): Construct message just once. (deliver_pack): Remove function. (deliver_msg): Make function static. * eth-multiplexer/vdev.h (deliver_{msg,pack}): Remove declarations.
* eth-multiplexer: Remove unused macro.Justus Winter2017-09-251-1/+0
| | | | * eth-multiplexer/vdev.h (MAX_SERVERS): Remove.
* eth-multiplexer: Fix debug macro.Justus Winter2017-09-251-3/+3
| | | | * eth-multiplexer/util.h (debug): Avoid format string warning.
* eth-multiplexer: Simplify device creation.Justus Winter2017-09-253-14/+7
| | | | | | * eth-multiplexer/vdev.c (add_vdev): Remove class and bucket parameter. * eth-multiplexer/vdev.h (add_vdev): Likewise. * eth-multiplexer/device_impl.c (ds_device_open): Update callsite.
* eth-multiplexer: Remove unused function.Justus Winter2017-09-252-8/+0
| | | | | * eth-multiplexer/vdev.c (has_vdev): Drop function. * eth-multiplexer/vdev.h (has_vdev): Drop declaration.
* libdiskfs: Improve error message.Justus Winter2017-09-251-1/+1
| | | | | * libdiskfs/init-main.c (diskfs_init_main): Use name of the function that failed as error message.
* fshelp: Fix fetching control ports.Justus Winter2017-09-251-5/+1
| | | | | * libfshelp/fetch-control.c (fshelp_fetch_control): When a port is stale, do not try to deallocate it.
* libdiskfs: Shutdown pagers on startup_dosync.Justus Winter2017-09-121-33/+1
| | | | | | | | | * libdiskfs/init-startup.c (diskfs_S_startup_dosync): Simplify the code by just using 'diskfs_shutdown' with the force flag. This also shuts down pagers, which potentially affects other tasks, but getting rid of the pagers allows us to commit a clean and consistent state to the disk before shutting down. Crashing other tasks just before the system powers down seems like a small price to pay.
* Traverse translator hierarchies using the fsys protocol.Justus Winter2017-09-1218-474/+367
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we used the fs protocol to traverse the translator hierarchies. This, however, is conceptually flawed, because translators are bound to nodes, and a node can have zero or more links in the file system. Therefore, the previous method of returning a list of paths to the client and expecting them to be able to follow these to reach the child translators was always unreliable. Fix this by using the fsys protocol to traverse the hierarchy, and returning the control ports of all children. This is more robust, and also conceptually cleaner, because the fsys protocol is about translator linkage, hence this is the point to implement traversal. Also move the get source routine over. A per-node source really does not fit the reality of most translators, while a per-translator source makes sense in many cases. * hurd/fs.defs (file_get_children): Drop routine. (file_get_source): Likewise. * hurd/fsys.defs (fsys_get_children): New routine. (fsys_get_source): Likewise. * libdiskfs/Makefile (FSYSSRCS): Remove files, add files. * libdiskfs/file-get-children.c: Remove file. * libdiskfs/fsys-get-children.c: New file. * libdiskfs/file-get-source.c: Remove file. * libdiskfs/fsys-get-source.c: New file. * libfshelp/fshelp.h (fshelp_filter): Remove type. (fshelp_get_active_translators): Remove filter and prefix argument, return list of control ports. * libfshelp/translator-list.c (fshelp_get_active_translators): Likewise. * libnetfs/Makefile (FSSRCS): Move 'get-source.c' too OTHERSRCS. (FSYSSRCS): Remove files, add files. * libnetfs/file-get-children.c: Remove file. * libnetfs/fsys-get-children.c: New file. * libnetfs/file-get-source.c: Remove file. * libnetfs/fsys-get-source.c: New file. * libtrivfs/Makefile: Move 'get-source.c' too OTHERSRCS. (FSYSSRCS): Remove files, add files. * libtrivfs/file-get-children.c: Remove file. * libtrivfs/fsys-get-children.c: New file. * libtrivfs/file-get-source.c: Remove file. * libtrivfs/fsys-get-source.c: Add file. * trans/Makefile (mtab): Build client stubs until the libc has caught on. * trans/mtab.c (target_control): New variable. (insecure): Drop variable. (all_translators): Likewise. (MAX_DEPTH): New macro. (max_depth): New variable. (options): Remove '--insecure' and '--all-translators', add '--depth'. (parse_opt): Adapt accordingly. (trivsfs_append_args): Likewise. (main): Get the control port of the target translator, then drop privileges. (is_filesystem_translator): Remove function. (mtab_mark_as_seen): Simplify. Just check if the control port is known. (mtab_populate): Limit depth of recursion, adapt to traversing over the control ports, simplify. (open_hook): Remove scary comment, it is not applicable anymore because we no longer dir_lookup child translators.
* libfshelp: Use node instead of name as key.Justus Winter2017-09-126-33/+35
| | | | | | | | | | | | | | | | | | | | | | Previously, libfshelp used the name of an translator as key in the hash table. This however is flawed, because a translator is bound to a node, and a node can have zero or more links in the file system. Use the nodes address (or rather, the address of the transbox embedded in the node) as key instead. * libfshelp/fshelp.h (fshelp_set_active_translator): Instead of the control port, hand the whole transbox to the function. * libfshelp/translator-list.c (struct translator): New field 'locp'. (hash): Hash pointer. (compare): Compare pointer. (translator_ihash): Use an location pointer. (fshelp_set_active_translator): Use the address of the transbox as key. (fshelp_remove_active_translator): Remove using the location pointer. * libdiskfs/dir-lookup.c (diskfs_S_dir_lookup): Fix callsite. * libdiskfs/file-set-trans.c (diskfs_S_file_set_translator): Likewise. * libnetfs/dir-lookup.c (netfs_S_dir_lookup): Likewise. * libnetfs/file-set-translator.c (netfs_S_file_set_translator): Likewise.