Age | Commit message (Collapse) | Author |
|
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.
|
|
* 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.
|