sutils: fix file_name_lookup_carefully

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.
tmpfs: fix parsing of fsys_set_options requests

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.
swapon: add -e/--ifexists option

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 warning

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.
Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd
libfshelp: add missing import

Add missing import of alloca.h.

* libfshelp/set-options.c: Add missing import.
swapon: add -v, --verbose argument

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.
Fix directory rename in firmlinked directory

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.
libdiskfs: fix consistency check

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.
libnetfs: fix consistency check

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.
Fix error handling macro E

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.
pfinet: Fix call to kfree_s

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.
config.make: Use more configure settings when building xkb-data

* 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.
Fix polling pfinet tun for write

* pfinet/tunnel.c (io_select_common): Also handle `SELECT_WRITE' case.
utils: escape arguments in fakeroot.sh

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.
utils: escape arguments in remap.sh

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.
mount: add -n and --no-mtab arguments

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'.
mount: fix mount -oremount with one parameter

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 -f and --fake arguments

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: implement -O, --test-opts

--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.