fstab:
//rhel73/myshare/sub/path /mnt cifs
after mount in mountinfo:
# grep cifs /proc/self/mountinfo
47 39 0:40 /sub/path /mnt rw,relatime shared:60 - cifs //rhel73/myshare/sub/path ...
^^^^^^^^^
or:
# grep cifs /proc/self/mountinfo
47 39 0:40 / /mnt rw,relatime shared:60 - cifs //rhel73/myshare/sub/path ...
^
That is so since on kernel cifs code, cifs_get_root (which returns the
entry associated with mnt_root) return s_root if
CIFS_MOUNT_USE_PREFIX_PATH is set, no questions asked.
This situation can occurr often on CIFS mounts, as CIFS servers limit
frequently scope of access to the root path.
[kzak@redhat.com: - add more info to the commit message,
- clean up variable names]
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1826719
Signed-off-by: Roberto Bergantinos Corpas <rbergant@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The "Further details" sentence in the PID namespace section got merged
with the surrounding text; this patch moves it to the end, to match
the other namespace sections, and adds the missing clone(2) reference.
Fixes: 894efece9e ("Provide better cross references for namespace concepts")
Signed-off-by: Stephen Kitt <steve@sk2.org>
Now sfdisk stops everything on I/O error when moving data. It seems
better to report the error to user and continue as it's better to have
one bad sector in the partition than inconsistent all partition.
Addresses: https://github.com/karelzak/util-linux/issues/984
Signed-off-by: Karel Zak <kzak@redhat.com>
Before ecfeae90a2 ("libmount: Ensure utab.lock mode 644"), you could do
something like:
irc:/tmp umount --version
umount from util-linux 2.27.1 (libmount 2.27.0: selinux, assert, debug)
irc:/tmp mkdir foo bar
irc:/tmp unshare -Urm
irc:/tmp mount --bind foo bar
irc:/tmp umount bar
irc:/tmp echo $?
0
However, afterwards, you get:
/tmp unshare -Urm
/tmp mount --bind foo bar
/tmp umount bar
umount: /tmp/bar: filesystem was unmounted, but failed to update userspace mount table.
Because of the chmod failing:
fchmod(3, 0644) = -1 EPERM (Operation not permitted)
Let's figure out whether the chmod is necessary before doing it, and only
do it if it is necessary. This won't fix cases where the system is already
broken, but at least on healthy systems umount will behave as before.
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Old:
$ echo -e "$(tput smul)A$(tput rmul) B\nC D" | column --table
A B
C D
Fixed:
$ echo -e "$(tput smul)A$(tput rmul) B\nC D" | ./column --table
A B
C D
Addresses: https://github.com/karelzak/util-linux/issues/1011
Signed-off-by: Karel Zak <kzak@redhat.com>
We already have mbs_safe_nwidth() but it assumes that all "bad" chars
will be encoded by \x<hex>. Now we need also function that do not care
about encoding.
Signed-off-by: Karel Zak <kzak@redhat.com>
* 'clang' of https://github.com/neheb/util-linux:
[clang-tidy] fix misleading identation
[clang-tidy] use ceil
[clang-tidy] fix wrong *cmp usage
[clang-tidy] do not use else after return
[clang-tidy] do not return in void functions
[clang-tidy] fix mismatching declarations
* 'map-user' of https://github.com/mat8913/util-linux:
unshare: Support names for map-user/group options
lib/pwdutils: add xgetgrnam
unshare: allow custom uid/gid mappings in userns
The --map-user and --map-group options can now be specified by either
uid/gid or user/group name.
Signed-off-by: Matthew Harm Bekkema <id@mbekkema.name>
Update blkdiscard manual page. Length and offset values must be aligned
to the device sector size.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reported-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
* '2020wk13' of https://github.com/kerolasa/util-linux:
include: add remove_entry() to env.h
tests: add sanitize_env() check
more: fix moving backwards so that it can reach begining of the file
more: use getopt_long() to parse options
more: remove underlining related code
more: fix SIGSTOP and SIGCONT handling
more: make execute() more robust and timely
more: target all standard streams when calling fflush()
more: remove kill_line() in favor of erase_prompt()
more: avoid defining special characters locally
more: use off_t and cc_t to clarify what variables attempt to represent
more: do not reset parent process terminal in execute()
more: use single exit path to ensure resource freeing is unified
This PR fixes an off by one in `strncmp(dev->bid_name, "/dev/mapper/", 11)` check. The `"/dev/mapper/"` string literal has a length of 12 and without this fix paths like `"/dev/mapperSOMETHING"` would also be accepted.
Moving backwards has worked fine until reaching start of file. At that
point more printout had one line too much in output causing more seemingly
never to be able to reach the start. That is now fixed, with clean ups to
skip_backwards() making it less confusing.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit also includes fix to how initial skip lines and search are
instructed in the code. Earlier version was pretty close impossible to make
work with getopt_long() and had minor flaw - if both initial skip lines and
search were defined at the same time the skipping did not happen. That is
now corrected.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
When suspending only the more process. Sending signal to process group
makes signal destination unnecessarily vague. After the suspend is over
SIGCONT is expected, and it needs to ensure output terminal settings are
what more needs.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The wait() is now a little more robust by being more tolerate rogue SIGCHLDs
and unblocked signals. The repeated fork() and sleep() is removed, if first
try does not success give up without delay to provide user timely feedback.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
If streams need to be flushed do not try to be clever, just flush all of
them. That lead to finding unnecessary print out in run_shell() that is
removed in this commit.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The sys/ttydefaults.h can be used for CTRL() and rubout that is CERASE. For
alarm it's best to keep things simple and call printf() alarm modifier.
QUIT was not in use, so it is just deleted.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
As a minor robustness improvement use ftello() to find out file position
rather than add and substract from old value.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Two new options are added: `--map-user=<uid>` and `--map-group=<gid>`
for custom user and group mappings respectively. These are just
generalizations of the existing `--map-root-user` and
`--map-current-user` options.
As a side effect of this commit, specifying both `--map-root-user` and
`--map-current-user` no longer causes an error. Instead, the last
occurrence takes precedence.
Addresses: https://github.com/karelzak/util-linux/issues/885
Signed-off-by: Matthew Harm Bekkema <id@mbekkema.name>
A user who wants to change the niceness of a process is likely to also be
interested in changing the scheduler class and/or RT priority.
Signed-off-by: Jann Horn <jannh@google.com>
Currently, umount /foo results in a statfs("/foo") call, which triggers
autofs. This can create another mountpoint on /foo, which is then unmounted
later instead of the actual /foo at the time umount was called.
This is especially an issue for umount -R /bar, which just fails with
-EBUSY as the accidental mountpoint is never accounted for and so it tries
to umount /bar before /bar/someautofs.
Replace the direct statfs call with open(path, O_PATH) + fstatfs, which sees
the autofs mount directly, without triggering it.