It seems better to ignore this option than drop-permissions and later
exit with EPERMs. This change makes umount(8) more compatible with
fuser user umounts by systemd where -c is used to reduce overhead etc.
Addresses: https://github.com/karelzak/util-linux/issues/1192
Signed-off-by: Karel Zak <kzak@redhat.com>
server is not available). The option has to be used with canonical path to the
mount point.
+This option is silently ignored by
+.B umount
+for non-root users.
+
For more details about this option see the
.BR mount (8)
man page. Note that \fBumount\fR does not pass this option to the
/* only few options are allowed for non-root users */
- if (mnt_context_is_restricted(cxt) && !strchr("hdilqVv", c))
+ if (mnt_context_is_restricted(cxt) && !strchr("hdilqVv", c)) {
+
+ /* Silently ignore options without direct impact to the
+ * umount operation, but with security sensitive
+ * side-effects */
+ if (strchr("c", c))
+ continue; /* ignore */
+
+ /* drop permissions, continue as regular user */
suid_drop(cxt);
+ }
err_exclusive_options(c, longopts, excl, excl_st);