This patch introduces two new parameters to set the
user ID and the group ID of the program to be executed.
Setting group ID also drops supplementary groups.
The option names used are the same as for nsenter,
-S, --setuid and -G, --setgid.
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This patch instroduces two new parameters to set the new
root and the new working directory in this new root.
This allows to combine "unshare chroot" in one command,
and doing like this the /proc filesystem is correctly
mounted in the new root with "--mount-proc".
The new parameters are -R, --root and -w, --wd. The names
are the same as for nsenter, except for "-r" that is already
used by "--map-root-user" and replaced by "-R".
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Check what has changed in usage functions in between v2.32..a77bd80d5 and
update bash-completion files accordingly.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
When script is used on a host with a relatively small free disk space, it
is sometimes desirable to limit the size of the captured output. This
can now be enforced with the --output-limit option.
The --output-limit option lets the user specify a maximum size. The program
uses the size parsing from strutils and thus supports the usual
multiplicative suffixes (kiB, KB, MiB, MB, etc.). After the specified
number of bytes have been written to the output file, the script program
will terminate the child process.
Due to buffering, the size of the output file might exceed the specified
limit. This limit also does not include the start and done messages.
The race test was throwing an error dur to a variable being "" in some cases.
Quoting the variable in the equal test took care of that test.
[kzak@redhat.com: - use done() to stop script
- count also timing file
- remove unnamed member initialization in ctl struct
- add to bash-completion]
Signed-off-by: Fred Mora <fmora@datto.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Let's provide command line tool, man page with OOM description and
bash-completion. It seems better than force end-users to use "echo"
to /proc.
Addresses: https://github.com/karelzak/util-linux/issues/609
Signed-off-by: Karel Zak <kzak@redhat.com>
Make the option argument suggestion to match with what is allowed. In same
go tidy shell code a little bit.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Bash completion is proposing --cdspeed option argument from 'eject
--listspeed /dev/cdrom' output. Nowadays it is common not to have such
device, and this results to an unwanted error message to stderr merely
messing up command line. Lets stop that.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This is the same fix as in reference commit, and the same reason. Just
correct few files missed earlier.
Reference: abbcec4fc9
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
# mount /dev/sdc1 /mnt/test/foo\ bar
# umount <tab>
has to return "/mnt/test/foo\ bar".
Changes:
* don't use mount | awk output, we have findmnt
* force compgen use \n as entries separator
Addresses: https://github.com/karelzak/util-linux/issues/539
Signed-off-by: Karel Zak <kzak@redhat.com>
When the bash-completion for fsck runs `find -L /dev/ -type b` it
descends into /dev/fd after opening '.' as file descriptor 3. This
causes find to search through /dev/fd/3/ which includes everything below
the current directory, which can take a very long time.
To avoid this, prune /dev/fd in the find expression.
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
This patch extends the valid --output values with ZONES for the
lsmem bash-completion, and adds the --zone option for the chmem
bash-completion.
Signed-off-by: Andre Wild <wild@linux.vnet.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
This allows to conveniently kill the entire process tree
below the forked program, a common problem when scripting
tasks that need to reliably fully terminate without leaving
reparented subprocesses behind.
The example added to the man page shows the most common use.
Implemented using prctl(PR_SET_PDEATHSIG, ...).
uuidgen: Add hash-based UUIDs to bash-completion. These were added in
commit c6f1ec68a8.
wipefs: Command started to use libsmartcols, and it got some new options.
Commit d9921b2a12.
rename: New option was added in commit fabb90676a.
tunelp: The --trust-irq was removed it being years broken. Commit
d52eb4bd90.
setpriv: Add --ambient-caps option from commit 0c92194eee.
In same go fix 'bash set -u' issue, that is the same as mentioned commit
abbcec4fc9.
hwclock: For some reason --get has always been missing from this file.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Changing directory in subshell does not effect parent process, so this is
better and possibly quicker way to list pids.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The look(1) uses positional arguments, where first one is a word from
dictionary. It is reasonable to assume most of the time people search from
system word lists so propose completions from there. The second argument is
a dictionary file, that might invalidate the first input but that only
happens to users who have an idea what the want without bash-completion.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
User who want to avoid refering to none-existing variables got earlier the
following error.
$ set -u
$ findmnt --output <tab>bash: OUTPUT: unbound variable
Here is short explanation of this setting.
$ help set
-u Treat unset variables as an error when substituting.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This change attempts to make tab completion more reasonable by alloging
memorizable option names. That also has positive impact to manual page, in
which referrals to other options are now easier to understand.
All short options are kept exactly as they were to avoid ABI breakage. The
only exception is -f option that getopt(3) recognized, but was not found
from anywhere else. The -f has been part of blkid since the initial commit.
Commit: 51410fc6de
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
scriptreplay:
Add --maxdelay option.
Commit: 7f1d483638
setterm:
Add --resize coption.
Commit: 5d79599951
write:
List only users who are online and determine tty based on given user
name.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
fdformat:
Add --from, --to, and --repair options.
Commit: e0402441a1
fdisk:
Add --output [1], --bytes [2], --wipe [3], --wipe-partition [4], and
remove --geom- from from --cylinders, --heads, --sector options [5].
Commit [1]: fff8ad5882
Commit [2]: 354f8cc8cf
Commit [3]: cb9a4b0033
Commit [4]: ba465623d8
Commit [5]: 4b4e391a28
fsck.cramfs:
Broken since first commit.
Commit: bf60993cf2
mkswap:
Provide random uuid when completing --uuid argument.
partx:
Add --sector-size option. Fix also list of known partition types to
match with libblkid blkid_idinfo names. The fix is also applied to
manual page.
Commit: f8a4a0d4f2
Reference: git grep -A 4 blkid_idinfo libblkid/src/partitions | grep name
sfdisk:
Add --reoder, --delete, --mode-dataa, -no-tell-kernel, --wipe, and
--wipe-partitions options. In same go fix some option argument
completions.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
March 2017 is gone, it is time to remove this utility as scheduled in
earlier commit, and promised in manual page.
Reference: 3f8478a71c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>