aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* pci-arbiter: fix cross-buildSamuel Thibault2018-11-281-1/+1
| | | | * pci-arbiter/Makefile (HURDLIBS): Add iohelp and ihash.
* random: Do not require the latest gcrypt version, just use a version known ↵Samuel Thibault2018-11-181-1/+1
| | | | | | | | | to work This helps with dependency management of binary packages. * trans/random.c (pool_initialize): Pass "1.8.0" to gcry_check_version instead of GCRYPT_VERSION.
* build: Distribute tarball compressed with xz instead of bzip2Guillem Jover2018-11-061-3/+3
| | | | | | * Makefile (dist): Change bz2 to xz. (%.xz): Add target. (%.bz2): Remove target.
* tmpfs: Document issue with removed shm filesSamuel Thibault2018-11-051-0/+2
|
* pci-arbiter: Add TODO fileSamuel Thibault2018-10-301-0/+15
| | | | * pci-arbiter/TODO: New file.
* PCI ArbiterJoan Lledó2018-10-3027-2/+3782
|
* libports: Fix typoSamuel Thibault2018-10-081-1/+1
|
* lwip: Fix build against glibc 2.28Samuel Thibault2018-08-151-0/+1
| | | | lwip/startup.c: Include <signal.h>.
* lwip: Fix a buffer overflow and clear compiler warningsJoan Lledó2018-08-142-2/+2
| | | | | | | GCC 8 new warning -Wstringop-truncation detected some buffer overflows. * lwip/options.c (parse_opt): Fix the buffer overflow. * lwip/pfinet-ops.c (dev_ifconf): Likewise.
* lwip: return EINTR when a select() IPC thread is cancelledJoan Lledó2018-08-141-0/+8
| | | | | | | Needed to properly support poll in glibc (_hurd_select). * lwip/io-ops.c (lwip_io_select_common): Detect when the current RPC is cancelled by checking the reply port.
* lwip: refactor main demuxer to avoid code duplicationJoan Lledó2018-08-141-31/+11
| | | | * lwip/main.c (lwip_demuxer): Refactored.
* lwip: poll(): return EIO when POLLERR is setJoan Lledó2018-08-141-0/+3
| | | | | | | Needed to properly support poll in glibc (_hurd_select). * lwip/io-ops.c (lwip_io_select_common): If POLLERR is set, return EIO.
* Hurd patches (fix compilation)Luca Weiss2018-06-1311-14/+16
| | | | | | | | | | | | | | | | | | * isofs/rr.c (rrip_work): Use gnu_dev_makedev instead of makedev. * libdiskfs/file-set-trans.c (diskfs_S_file_set_translator): Likewise. * libnetfs/file-set-translator.c (netfs_S_file_set_translator): Likeiwse. * nfs/nfs.c (xdr_decode_fattr): Likewise. * storeio/storeio.c (parse_opt): Likewise. * libfshelp/fetch-root.c (fshelp_short_circuited_callback1): Use gnu_dev_major and gnu_dev_minor instead of major and minor. * libnetfs/file-get-translator.c (netfs_S_file_get_translator): Likewise. * nfs/ops.c (netfs_attempt_link): Likewise. * storeio/storeio.c (trivfs_append_args): Likewise. * trans/fakeroot.c (netfs_attempt_mkdev): Likewise. * pfinet/glue-include/linux/mm.h: Include <mach/vm_param.h>. * term/users.c: Include <signal.h>
* console-run: do not complain when running with empty /devSamuel Thibault2018-06-031-1/+4
| | | | | * daemons/console-run.c (open_console): Do not complain if errno is ENOENT on opening /dev/console.
* 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.