Age | Commit message (Collapse) | Author |
|
* trans/crash.c (parse_opt): Avoid 'error' in favor of the appropriate
argp error reporting mechanism.
* trans/remap.c (parse_opt): Likewise.
* utils/msgids.c (parse_opt): Likewise.
|
|
* utils/fakeroot.sh (FAKED_MODE): Set to unknown-is-root.
|
|
This will now display the 'argv: data_t' argument of file_exec
as e.g. "who\0am\0i\0" rather than just "who". In contrast,
the 'file_name: string_t' argument of dir_lookup will still be
truncated at the first null character.
The previous implementation might crash if an out-of-line
char array exactly fills a page and does not contain any
null characters.
* utils/rpctrace.c (print_data): On MACH_MSG_TYPE_STRING and
MACH_MSG_TYPE_CHAR, check for end of buffer before checking for a null
character. On MACH_MSG_TYPE_CHAR only, continue printing past null
characters.
|
|
* utils/settrans.c (OPT_STACK): New macro.
(options): New option.
(main): Handle new option.
(open_node): Use different flags for the lookup of the underlying
node.
|
|
* utils/settrans.c (options): Add '--underlying'.
(main): Handle new option.
(open_node): Open the node if given.
|
|
* utils/settrans.c (get_credentials): New function.
(main): Get an authenticated root node for the process we are
chrooting.
Signed-off-by: Justus Winter <justus@gnupg.org>
|
|
* utils/fakeauth.c (main): Replace the right element of the argument
vector. This fixes running scripts from PATH using fakeroot.
|
|
Apparently some users of 'mount' do not cope with any output being
generated from the spawned translator.
* utils/mount.c (do_mount): Start translators with stderr closed.
|
|
* utils/Makefile (targets): Add 'vmallocate'.
* utils/vmallocate.c: New file.
|
|
Add an option '--chroot-chdir' to settrans and make it chdir to this
directory before executing the target program. Also, look up the
executable in PATH.
With these changes we no longer need to use the shell inside the
chroot in the convenience scripts, and hence do not require it to be
installed inside the chroot.
* utils/fakeroot.sh: Simplify using the new option.
* utils/remap.sh: Likewise.
* utils/settrans.c (OPT_CHROOT_CHDIR): New constant.
(options): New option 'chroot-chdir'.
(main): Handle new option. Search for target executable in PATH.
* utils/fakeauth.c (main): Likewise.
|
|
This fixes several linking problems I had in my recent cross-compilation
of the Hurd. I added missing static libraries and also organized some of
the targets for more concise rules.
* console-client/Makefile: Add libiohelp.a and libihash.a.
* daemons/Makefile: Add libihash.a and libshouldbeinlibc.a.
* devnode/Makefile: Add iohelp and ihash to HURDLIBS.
* random/Makefile: Likewise.
* trans/Makefile: Reorder targets alphabetically and add libiohelp.a and
libihash.a.
* utils/Makefile: Add libihash.a.
|
|
utils: Fix compiler warnings.
* utils/rpcscan.c (setup_extract_target): Remove name variable.
* utils/rpcscan.c (setup_extract_target): Fix bad initializer.
* utils/rpctrace.c (new_send_wrapper, wrap_all_threads, wrap_new_thread,
wrap_new_task, traced_spawn): Fix format strings.
* utils/rpctrace.c (trace_and_forward): Cast to unsigned int.
* utils/rpctrace.c (trace_and_forward): Use memcmp instead of pointer
dereferencing to compare structures.
* utils/rpctrace.c (wrap_all_threads): Cast to vm_address_t.
* utils/rpctrace.c (main): Fix bad initializer.
* utils/shd.c (run): Initialize save0.
* utils/vminfo.c: Fix format strings.
* utils/vmstat.c: Remove PSEP macro and expand the code.
* utils/w.c (add_utmp_procs): Remove unused pos variable.
|
|
This fixes umounting bind mounts or other mounts for which the device can
not be made away.
* utils/umount.c (do_umount): When the --force option is not passed, ignore
errors from file_set_translator call on the device file.
|
|
* utils/rpcscan.c: New file.
* utils/Makefile: Add `rpcscan'.
|
|
* utils/rpctrace.c: Move all the code handling the message id files...
* utils/msgids.c: ... to a new file.
* utils/msgids.h: And add the relevand declarations.
* utils/Makefile (SRCS): Add the new file.
|
|
Previously, the `vmstat' utility would stop displaying the memory
object hit ratio after some time due to an integer overflow.
* utils/vmstat.c (get_memobj_hit_ratio): Fix integer overflow.
|
|
* utils/Makefile: Link against `libshouldbeinlibc'.
|
|
|
|
* utils/rpctrace.c (new_receiver_info): Fix handling of old
notification port.
|
|
For reference, this patch was created using the following semantic
patch, and then manually applying the change in all functions
containing nested functions, as those are not supported by Coccinelle.
@@
expression A, B;
@@
- bzero (A, B)
+ memset (A, 0, B)
* auth/auth.c: Replace `bzero' with `memset'.
* boot/boot.c: Likewise.
* defpager/defpager.c: Likewise.
* exec/exec.c: Likewise. Also, drop `safe_bzero' and just use
`hurd_safe_memset' directly.
* ext2fs/ext2fs.c: Likewise.
* ext2fs/getblk.c: Likewise.
* ext2fs/pager.c: Likewise.
* fatfs/pager.c: Likewise.
* ftpfs/dir.c: Likewise.
* ftpfs/netfs.c: Likewise.
* isofs/inode.c: Likewise.
* isofs/pager.c: Likewise.
* libdiskfs/file-getfh.c: Likewise.
* libdiskfs/file-statfs.c: Likewise.
* libfshelp/fetch-root.c: Likewise.
* libfshelp/start-translator.c: Likewise.
* libftpconn/create.c: Likewise.
* libftpconn/open.c: Likewise.
* libftpconn/unix.c: Likewise.
* libpipe/pipe.c: Likewise.
* libps/procstat.c: Likewise.
* libps/spec.c: Likewise.
* libshouldbeinlibc/cacheq.c: Likewise.
* libshouldbeinlibc/idvec.c: Likewise.
* libshouldbeinlibc/ugids.c: Likewise.
* libstore/argp.c: Likewise.
* libstore/enc.c: Likewise.
* libstore/kids.c: Likewise.
* libthreads/alpha/thread.c: Likewise.
* libtreefs/fsys.c: Likewise.
* libtrivfs/file-statfs.c: Likewise.
* mach-defpager/default_pager.c: Likewise.
* pfinet/glue-include/asm/uaccess.h: Likewise.
* pfinet/io-ops.c: Likewise.
* pfinet/options.c: Likewise.
* pfinet/socket.c: Likewise.
* pfinet/timer-emul.c: Likewise.
* pflocal/io.c: Likewise.
* startup/startup.c: Likewise.
* storeio/storeio.c: Likewise.
* sutils/fstab.c: Likewise.
* usermux/usermux.c: Likewise.
* utils/fakeauth.c: Likewise.
* utils/frobauth.c: Likewise.
* utils/login.c: Likewise.
* utils/x.c: Likewise.
|
|
As the protected payloads were retrofitted into the Mach message
format, the local port type is lost.
* utils/rpctrace.c (is_notification): New function
(trace_and_forward): Recover the original local port type.
|
|
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.
|