Age | Commit message (Collapse) | Author |
|
To avoid spurious ./, /, symlinks, etc.
* sutils/fstab.c (fs_set_mntent): Try to call realpath on mnt_fsname and mnt_dir
field of `mntent'.
(fstab_find_mount): Try to call realpath on `name' parameter.
(fstab_find): Do not try to call realpath.
(fstab_read): Reset errno to zero before calling getmntent.
* utils/umount.c (main): Do not warn about missing fstab entries for
active translators.
|
|
% fakeroot rpctrace install
[...]
63<--66(pid5363)->io_read (-1 8192) = 0 [... rpctrace crashes]
/bin/fakeauth: Segmentation fault for child 5362
/bin/settrans: Error 139 for child 5361
* utils/rpctrace.c (print_data): Fix this by guarding the code
escaping non-printable characters introduced in 84932431 against
`data' being NULL.
|
|
The deallocation also needs to be fixed.
Also, fetch_procinfo already took care of the conversion.
* exec/elfcore.c (dump_core): Fix procinfoCnt taken from
proc_getprocinfo.
* utils/login.c (check_owned): Likewise.
* libps/procstat.c (merge_procinfo): Remove conversion between bytes and
int, already handled by fetch_procinfo.
|
|
The procinfoCnt argument is the number of elements of the procinfo_t array,
not its size in bytes.
* exec/elfcore.c (dump_core): Fix procinfoCnt given to proc_getprocinfo.
* libps/procstat.c (merge_procinfo): Likewise.
* utils/login.c (check_owned): Likewise.
|
|
* libports/ports.h (struct port_info): Use the new type.
* libports/lookup-port.c: No need to lock _ports_lock anymore.
* libports/bucket-iterate.c: Likewise.
* libports/complete-deallocate.c: Check if someone reacquired a
reference through a hash table lookup.
* libports/create-internal.c: Use the new reference counting primitives.
* libports/get-right.c: Likewise.
* libports/import-port.c: Likewise.
* libports/port-deref-weak.c: Likewise.
* libports/port-deref.c: Likewise.
* libports/port-ref-weak.c: Likewise.
* libports/port-ref.c: Likewise.
* libports/reallocate-from-external.c: Likewise.
* libports/transfer-right.c: Likewise.
* utils/rpctrace.c: Likewise.
|
|
* utils/mount.c (parse_opt): Add -B/--bind/--firmlink/-o bind mount
options. (do_mount): Do not pass bind mount option to settrans, set
firmlink fstype. (main): Likewise.
|
|
According to f2640263468aced5c91ac5fc1f15bb5691f7eb20, passive
translators are no longer removed.
* utils/umount.c (do_umount) Remove -p option from verbose message.
(passive_flags): Remove.
|
|
* utils/settrans.c (main): In case of chroot_command, get status from waitpid()
call, and call error() appropriately.
|
|
Start the translator specified by the NODE's passive translator record
and set it as NODE's active translator. This is the equivalent of
doing:
% settrans --active /node $(showtrans /node)
* utils/settrans.c (argp_option): Add --start.
(parse_opt): Handle --start.
(main): Retrieve the passive translator record if --start is given.
|
|
|
|
* utils/rpctrace.c (rewrite_right): Explain why the unknown send right
error happens on fork().
|
|
GNU libc has provided the 'crypt' function in libcrypt for a long time,
making this check unnecessary.
* configure.ac: Remove libcrypt check and 'LIBCRYPT' substitution.
* config.make.in (LIBCRYPT): Remove.
* trans/Makefile (password-LDLIBS): Change $(LIBCRYPT) to -lcrypt.
* utils/Makefile (login-LDLIBS, addauth-LDLIBS, setauth-LDLIBS):
Likewise.
|
|
Previously, the mig mutator function auth_port_to_handle was defined
in auth.c (fakeauth.c), preventing it from being inlined into the
mig-generated server functions. Put it in mig-decls.h instead.
Rename authmutations.h to mig-mutate.h, auth_mig.h to mig-decls.h.
This is the naming convention used for pflocal.
* auth/auth.h: New file.
* auth/auth_mig.h: Rename to mig-decls.h, add copyright notice, define
mutator functions.
* auth/authmutations.h: Rename to mig-mutate.h, restore copyright
notice, adjust accordingly.
* auth/auth.c: Include auth.h, remove auth_port_to_handle.
* utils/fakeauth.c: Likewise.
* auth/Makefile: Adjust accordingly.
* utils/Makefile: Likewise.
|
|
Passive translator records are a Hurd concept. Therefore, the umount
compatibility program should not remove them.
* utils/umount.c (passive_flags): Unset FS_TRANS_SET.
(doc): Adjust accordingly.
|
|
Fix case when $PWD contains spaces.
Pass directly arguments to command, to directly avoid escaping issues.
Based on suggestion by Ivan Shmakov <oneingray@gmail.com>
* utils/fakeroot.sh (TARGET): Do not define.
(sh): Rather pass PWD and commandline as parameters.
* utils/remap.sh: Likewise.
|
|
GNU MIG recently gained support for emitting x_server_routine
declarations in the generated server header file. Using this
declaration, the x_server_routine functions can be inlined into the
demuxer function.
* utils/fakeauth.c: Include the mig-generated server headers.
|
|
Currently, it is impossible to properly attribute response messages to
requests. Even though rpctrace is single-threaded, its tracee may
not. Or there might be more than one tracee. In any such case it is
not guaranteed that the reply message we just processed is for the
request we just printed. Fix this by printing ellipsis with the port
name, so that reply messages can be properly attributed:
task129(pid3312)->mach_port_allocate (3) ...134
task129(pid3312)->mach_port_deallocate (pn{ 1}) ...160
134... = 0 pn{ 30}
160... = 0
* utils/rpctrace.c (last_reply_port): New variable.
(print_ellipsis): New function.
(print_request_header): Optionally print ellipsis and update
last_reply_port.
(print_reply_header): Likewise.
|
|
* utils/rpctrace.c (escape_sequences): New char array mapping
characters to their escape sequence.
(print_data): Escape non-printable characters when printing strings.
|
|
This allows one to rpctrace processes doing select(2).
* utils/rpctrace.c (trace_and_forward): Handle MACH_MSG_TYPE_PORT_SEND
rights.
|
|
Currently, rpctrace dies if a tracee uses select(2) because it asserts
that reply_type is a MACH_MSG_TYPE_PORT_SEND_ONCE right. Generalize
the code surrounding the failing assertion.
* utils/rpctrace.c (trace_and_forward): Generalize code by switching
over reply_type.
|
|
* utils/rpctrace.c (rewrite_right): Generalize the code so we can use
rewrite_right to rewrite MACH_MSG_TYPE_PORT_SEND rights for non-rpc ports.
|
|
mount uses libblkid (if available) to detect the file system type when
using mount -t auto. libblkid calls fat file systems "vfat", our fat
translator is called "fatfs". Fix this discrepancy in mount.
* utils/mount.c (do_mount): Fix autodetection of fat file systems.
|
|
Previously, settrans --chroot would just exec the target. Create a
new process for that purpose. Wait for its completion, then ask the
translator (nicely by default) to go away. If it refuses with EBUSY,
it might be because some process has daemonized inside the chrooted
environment.
This fixes the following bug when settrans is used with fakeroot:
% fakeroot-hurd /bin/true 2>&1 | tee
<hangs>
Here, fakeroot-hurd execs settrans with --chroot, settrans execs
/hurd/fakeauth which will eventually exec the target /bin/true. When
true terminates, it will close its stdout and stderr. But
/hurd/fakeroot's stderr is also connected to tee's stdin, preventing
tee from exiting.
* utils/settrans.c (main): Fix the teardown of chrooted environments.
|
|
Handle multiple request types as recommended by the Mach Server
Writer's Guide section 4, subsection "Handling Multiple Request
Types". This avoids initializing the reply message in every X_server
function. The reply message has already been properly initialized in
libports, so there is no need to call mig_reply_setup.
* utils/fakeauth.c (auth_demuxer): Improve the demuxer function.
|
|
Found using the Clang Static Analyzer.
* utils/frobauth.c (posix_parse_opt): Fix dead initialization.
(no_ugids_parse_opt): Likewise.
|
|
Implement the --search switch of portinfo. The feature was suggested
in the source code and partly implemented. portinfo --search locates
the target ports (or all ports) in any other process and prints the
port mapping and information about the port in the remote process.
* utils/Makefile: Link portinfo against libps.
* utils/portinfo.c (options): Enable --search option.
(search_for_port): New function.
(search_for_ports): Likewise.
(main): Call search_for_port{,s} as appropiate.
|
|
This switch makes settrans write the pid file of the active translator
it starts to a file. This makes the pid easily retrievable for test
suites.
* utils/settrans.c (options): Add --pid-file.
(main): Add variable pid_file.
(parse_opt): Handle --pid-file switch.
(open_node): Write pid file.
|
|
* utils/storeinfo.c (parse_opt): Do not deallocate `file` port, `store_free`
does it already.
|
|
* utils/rpctrace.c (parse_msgid_list): Use %ms instead of %as in sscanf
format.
|
|
* utils/Makefile (SRCS): Add match-options.c
|
|
* utils/Makefile (mount-LDLIBS): Define to libblkid_LIBS instead of
libblkid-LIBS
(mount-CPPFLAGS): Likewise.
|
|
Use libblkid to detect the filesystem type if "auto" is given as
type. Remove the translator localization from main, this is also done
in do_mount and any errors are propagated properly. This way "auto" is
handled correctly if given on the command line or used as filesystem
type in the fstab.
* configure.ac: Add check for libblkid.
* config.make.in: Make libblkid specific values available.
* utils/Makefile: Use libblkid specific values.
* utils/mount.c (DEFAULT_FSTYPE): Use "auto" as default type.
(do_mount): Detect type using libblkid.
(main): Drop translator localization.
|
|
* utils/umount.c: Do not include useless <blkid/blkid.h>.
|
|
|
|
This adds a umount utility that implements most of the functions that
the Linux umount utility provides, especially that subset that is used
by the Debian package initscripts.
* utils/umount.c: New file.
|
|
nullauth drops all authentication credentials and runs the given
program. This is also useful to drop privileges on behalf of
translators that do not need any credentials in some circumstances,
e.g.
% settrans -ap /hurd/nullauth -- /hurd/storeio -Tzero
makes storeio run without any credentials.
* utils/nullauth.c: New file.
* utils/Makefile: Build nullauth.
|
|
This adds a umount utility that implements most of the functions that
the Linux umount utility provides, especially that subset that is used
by the Debian package initscripts.
* utils/umount.c: New file.
|
|
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.
|
|
--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.
|
|
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.
|
|
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.
|
|
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'.
|
|
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.
|
|
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/x.c (main): Remove unused variable.
|
|
This reverts commit 202339d49461ce6dcffd3a5b3690537daea5ef38.
|
|
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.
|
|
* utils/remap.sh (REMAPPED): Default to empty.
(while): Break as soon as there are no arguments any more. Do not break on
mapping parameters
|
|
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.
|
|
* trans/remap.c: New file.
* trans/Makefile (targets): Add remap.
(SRCS): Add remap.c.
(remap): Add rule.
* utils/remap.sh: New script.
* utils/Makefile (targets): Add remap.
(special-targets): Add remap.
(SRCS): Add remap.sh.
* NEWS: Advertise new translator
|