aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* sutils: allow multiple entries for the device "none"Justus Winter2013-08-281-2/+10
| | | | | | | | | 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".
* mount: ignore mounted filesystems if --all is givenJustus Winter2013-08-281-0/+9
| | | | | | | 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.
* mount: implement -O, --test-optsJustus Winter2013-08-284-4/+121
| | | | | | | | | | | | | | | | | --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.
* mount: add -f and --fake argumentsJustus Winter2013-08-281-1/+28
| | | | | | | | 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.
* mount: fix mount -oremount with one parameterJustus Winter2013-08-281-6/+23
| | | | | | | | This fixes mount -oremount when just given the mountpoint, e. g.: % mount -oremount,ro /tmp * util/mount.c (main): Add a one-argument form for remount.
* mount: add -n and --no-mtab argumentsJustus Winter2013-08-281-0/+5
| | | | | | | | | Add -n and --no-mtab arguments. As we do not write an mtab file, this is a trivial patch that just ignores this argument to be more compatible with Linux mount. * utils/mount.c (argp_opts): Add -n and --no-mtab. (parse_opt): Do nothing on 'n'.
* utils: escape arguments in remap.shJustus Winter2013-08-251-1/+7
| | | | | | | | | | | | | | | | remap.sh uses /bin/sh to first change the working directory and then execute the given program in the remap context. But the arguments given on the command line were not properly escaped: % '/bin/sh' '-c' 'echo $0' /bin/sh % remap '/bin/sh' '-c' 'echo $0' <empty line> % remap-fixed '/bin/sh' '-c' 'echo $0' /bin/sh * utils/remap.sh: Escape arguments handed to /bin/sh so that they are not evaluated prematurely.
* utils: escape arguments in fakeroot.shJustus Winter2013-08-251-2/+8
| | | | | | | | | | | | | | | | | | fakeroot.sh uses /bin/sh to first change the working directory and then execute the given program in the fakeroot context. But the arguments given on the command line were not properly escaped: % '/bin/sh' '-c' 'echo $0' /bin/sh % fakeroot-tcp '/bin/sh' '-c' 'echo $0' /bin/sh % fakeroot-hurd '/bin/sh' '-c' 'echo $0' <empty line> % fakeroot-hurd-fixed '/bin/sh' '-c' 'echo $0' /bin/sh * utils/fakeroot.sh: Escape arguments handed to /bin/sh so that they are not evaluated prematurely.
* Fix polling pfinet tun for writeSamuel Thibault2013-08-231-2/+11
| | | | * pfinet/tunnel.c (io_select_common): Also handle `SELECT_WRITE' case.
* config.make: Use more configure settings when building xkb-dataDavid Michael2013-08-162-1/+5
| | | | | | * config.make.in (datarootdir,LEX,YACC): New variables. * configure.ac (XKB_BASE): Drop extraneous "/share" from path. * configure.ac: Reset pkg-config status between tests.
* pfinet: Fix call to kfree_sSamuel Thibault2013-07-201-1/+1
| | | | | | | | | | | | | | kfree_s expects a pointer and a size argument. Currently the sizeof(cache) is used as size argument, this is certainly not what was intented. For reference, this code was present in Linux up to version 2.3.14 and was replaced in 2.3.15. Found using coccinelle and https://raw.github.com/coccinelle/coccinellery/master/sz/sz.cocci. * pfinet/linux-src/net/ipv4/ipmr.c (ipmr_cache_delete): Fix kfree_s call.
* Fix error handling macro EJustus Winter2013-07-191-1/+2
| | | | | | | Previously the macro argument err was expanded and thus potentially evaluated multiple times. This is fine for simple values or pure functions, but not for say iohelp_create_iouser. Fix this by evaluating the macro argument only once.
* libnetfs: fix consistency checkJustus Winter2013-07-151-1/+1
| | | | | | | | | | passive is not a zero terminated string but a char * combined with a length. If passivelen == 0, passive may very well be not NULL, and dereferencing that pointer might not be safe. At the very least the consistency check is wrong. Fix that by checking passivelen instead of passive. * libnetfs/file-set-trans.c (netfs_S_file_set_translator): Fix sanity check.
* libdiskfs: fix consistency checkJustus Winter2013-07-151-1/+1
| | | | | | | | | | passive is not a zero terminated string but a char * combined with a length. If passivelen == 0, passive may very well be not NULL, and dereferencing that pointer might not be safe. At the very least the consistency check is wrong. Fix that by checking passivelen instead of passive. * libdiskfs/file-set-trans.c (diskfs_S_file_set_translator): Fix sanity check.
* Fix directory rename in firmlinked directorySamuel Thibault2013-07-071-1/+1
| | | | | | | | | | | | checkpath browses directories up to look against renaming a directory into itself. It used to assume being able to stop at the root of the filesystem. But some per-opens have a shadow_root, where recursion has to stop too. This means checkpath does not check up to the root any more. This is fine, since we already prevent cross-shadow-root renames very early in dir-rename.c, we do not need to check outside of this shadow root. * libdiskfs/dir-renamed.c (checkpath): Also stop at the per-open shadow_root.
* swapon: add -v, --verbose argumentJustus Winter2013-07-061-0/+5
| | | | | | | | | This patch adds a --verbose argument to swapon and swapoff to make it more compatible with the corresponding Linux' utilities. Note that our swapon is verbose by default and has a --quiet argument to make it quiet, so a --verbose argument on it's own does nothing at all. * sutils/swapon.c (main): Handle -v argument.
* libfshelp: add missing importJustus Winter2013-07-051-0/+1
| | | | | | Add missing import of alloca.h. * libfshelp/set-options.c: Add missing import.
* Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurdSamuel Thibault2013-07-021-4/+14
|\
| * swapon: add -e/--ifexists optionPino Toscano2013-07-011-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the same command line option as in util-linux' swapon to not consider an error if the device/file of a swap entry in fstab does not exist (and not when activating a device specified as argument to `swapon'). * sutils/swapon.c (ifexists): New variable. (options): Add the 'e' option. (parse_opt) <'e'>: Handle case. (swaponoff): New argument skipnotexisting. Return 0 if open_store fails with ENOENT and SKIPNOTEXISTING is on. (main): Adapt swaponoff calls with 0 as parameter for command line arguments, and IFEXISTS for swap entries from fstab.
* | sutils: fix a compiler warningJustus Winter2013-07-021-1/+1
|/ | | | | | | | Fix a compiler warning by dropping the const qualifier. It is not appropriate to qualify pointers to dynamically allocated memory as const. * sutils/fstab.c (real_name): Drop const qualifier.
* tmpfs: fix parsing of fsys_set_options requestsJustus Winter2013-06-291-1/+1
| | | | | | | | Formerly setting the options using fsys_set_options did not work because runtime_argp.options was set to 0. This fixes "remounting" of tmpfs translators. * tmpfs/tmpfs.c (runtime_argp): Use options as option list.
* sutils: fix file_name_lookup_carefullyJustus Winter2013-06-291-32/+18
| | | | | | | | | | | | | | | | | | | file_name_lookup_carefully is like file_name_lookup but tries hard to avoid starting any passive translators while doing the lookup. The callback contains code to get a new handle to the root if it encounters a translator, but this code was not being executed if the node had no record of an passive translator, just an active one. Fix the callback by dropping the test for a passive translator. AIUI the current check for a passive translator makes no sense, as the code is supposed to fail on encountering a passive translator. This fixes lookups inside translators that have no passive translator. For example if /run is a tmpfs started only as active translator, touch /run/lock && mount tmpfs -t tmpfs /run/lock -o size=5M would fail. * sutils/clookup.c (lookup): Drop the test for an passive translator.
* Remove unused variableMiguel Figueiredo2013-06-021-1/+0
| | | | * utils/x.c (main): Remove unused variable.
* Remove unused variableMiguel Figueiredo2013-06-021-2/+0
| | | | * mach-defpager/default-pager.c : Remove unused variable.
* Remove unsused variablesMiguel Figueiredo2013-06-011-4/+0
| | | | * libthreads/cprocs.c : Remove unsused variables.
* Add missing breakMiguel Figueiredo2013-06-011-1/+2
| | | | * libcons/vcons-move-mouse.c (cons_vcons_move_mouse): Add missing break.
* Fix invalid memory accessMiguel Figueiredo2013-06-011-2/+1
| | | | * init/init.c (start_child): Don't free `arg' before it is used.
* Remove unused variableMiguel Figueiredo2013-06-011-3/+0
| | | | * exec/exec.c (check_section): Remove unused variable.
* Fix descriptor leakMiguel Figueiredo2013-06-011-2/+1
| | | | * console-client/xkb/compose.c (read_composefile): Always fclose `fc'.
* Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurdSamuel Thibault2013-06-011-0/+8
|\
| * Reset task priority when spawning a passive translatorRichard Braun2013-05-311-0/+8
| | | | | | | | | | | | | | | | | | | | | | Server threads spawned by libports attempt to adjust their priority and succeed when the server is privileged. This priority is currently inherited by child tasks, which could be passive translators owned by unprivileged users. Reset the priority of the task used for translator instantiation. * libfshelp/start-translator-long.c (fshelp_start_translator_long): Set new task priority to 25 (BASEPRI_USER).
* | Remove unused variableMiguel Figueiredo2013-06-011-2/+0
|/ | | | * console-client/trans.c (console_setup_node): Remove unused variable.
* Remove unused variablesMiguel Figueiredo2013-05-301-2/+0
| | | | * mach-defpager/kalloc.c (kalloc_init): remove unused variables
* Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurdSamuel Thibault2013-05-272-8/+4
|\
| * Fix some errors in the texinfo documentationRichard Braun2013-05-222-8/+4
| | | | | | | | | | | | | | * doc/gpl.texinfo: Replace @unnumbered with @node and @section commands. * doc/hurd.texi: Fix call to @setchapternewpage, remove the @node and @section commands that are now in gpl.texinfo, and remove an erroneous occurrence of 'attributes' before a command.
* | Do not compute debugging information by defaultSamuel Thibault2013-05-271-1/+1
|/ | | | * mach-defpager/kalloc.c (DEBUG): Do not define macro.
* Revert "utils/vmstat: Use gnumach.defs from gnumach"Samuel Thibault2013-05-133-4/+2
| | | | This reverts commit 202339d49461ce6dcffd3a5b3690537daea5ef38.
* utils/vmstat: Use gnumach.defs from gnumachDavid Michael2013-05-053-2/+4
| | | | | | | | | | The gnumach installation provides the include file mach/gnumach.defs instead of mach/gnumach.h. This runs the defs file through MIG and builds the result for vmstat. * utils/vmstat.c: Replace <mach/gnumach.h> with "gnumach_U.h". * utils/Makefile (vmstat): Add rule to depend on gnumach_U.o. * Makeconf (mach_defs_names): Add gnumach.
* SYMLOOP_MAX may be undefined under some build flagsSamuel Thibault2013-05-051-1/+2
| | | | | * libdiskfs/boot-start.c (diskfs_start_bootstrap): Use value returned by sysconf (_SC_SYMLOOP_MAX) instead of SYMLOOP_MAX.
* Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurdSamuel Thibault2013-05-011-2/+2
|\
| * pfinet: fix timeout evaluationRichard Braun2013-04-061-2/+2
| | | | | | | | | | * pfinet/timer-emul.c (timer_function): Fix comparison between expire time and jiffies.
* | Fix console hang on unknown key pressSamuel Thibault2013-05-011-2/+2
|/ | | | | * console-client/xkb/kstoucs.c (find_ucs): Remove middle value from recursive call range.
* Fix tunnel and dummy interfacesSamuel Thibault2013-03-264-4/+7
| | | | | | | | | | | * pfinet/linux-src/include/linux/netdevice.h (netdevice): Add `change_flags' field. * pfinet/ethernet.c (ethernet_change_flags): Make function static. (setup_ethernet_device): Set `change_flags' field of `dev' to ethernet_change_flags. * pfinet/linux-src/net/core/dev.c (dev_change_flags): Call `change_flags' field of `dev' if non-nul, instead of calling ethernet_change_flags. * pfinet/pfinet.h (ethernet_change_flags): Remove function prototype.
* Fix remap invocationSamuel Thibault2013-03-261-2/+4
| | | | | | * utils/remap.sh (REMAPPED): Default to empty. (while): Break as soon as there are no arguments any more. Do not break on mapping parameters
* Update nasty/nice priority limitSamuel Thibault2013-03-111-2/+2
| | | | | * libps/procstat.c (thread_state): Update nasty/nice limit to 25 instead of 12.
* Fix libpthread conversionSamuel Thibault2013-03-111-1/+1
| | | | | * pfinet/io-ops.c (io_select_common): Call pthread_mutex_unlock instead of __mutex_unlock.
* rpctrace: implement -EPino Toscano2013-03-011-1/+49
| | | | | | | | | | | | | Add a -E option to rpctrace, much like its strace's equivalent, to add/change/unset environment variables among the ones inherited by the process. Implements the savannah task #9331. * utils/rpctrace.c: Include <envz.h>. (options): Add the 'E' option. (parse_opt) <'E'>: Handle case. Create ENVZ from ENVP, and change it according to ARG. (main): Create CMD_ENVP from ENVZ if not null, or assign ENVP to it. Pass CMD_ENVP to traced_spawn.
* Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurdSamuel Thibault2013-02-286-357/+594
|\
| * hello-mt: fix pthread porting issuePino Toscano2013-02-271-1/+1
| | | | | | | | | | | | | | | | Properly use pthread_mutex_destroy as equivalent for cthreads' mutex_clear, instead of pthread_mutex_init. Issue kindly reported by Nick Lloyd, thanks! * trans/hello-mt.c (close_hook): Call pthread_mutex_destroy instead of pthread_mutex_init.
| * Replace configure.in with configure.acPino Toscano2013-02-262-3/+3
| | | | | | | | | | * INSTALL: Replace configure.in with configure.ac * Makefile ($(top_srcdir)/configure): Likewise.