summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libmount/src/context_umount.c6
-rw-r--r--libmount/src/optstr.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c
index 9d7701f6e..939f66e7f 100644
--- a/libmount/src/context_umount.c
+++ b/libmount/src/context_umount.c
@@ -307,8 +307,7 @@ static int evaluate_permissions(struct libmnt_context *cxt)
* Check user=<username> setting from mtab if there is user, owner or
* group option in /etc/fstab
*/
- if ((u_flags & MNT_MS_USER) || (u_flags & MNT_MS_OWNER) ||
- (u_flags & MNT_MS_GROUP)) {
+ if (u_flags & (MNT_MS_USER | MNT_MS_OWNER | MNT_MS_GROUP)) {
char *curr_user = NULL;
char *mtab_user = NULL;
@@ -670,7 +669,8 @@ int mnt_context_do_umount(struct libmnt_context *cxt)
return rc;
if ((cxt->flags & MNT_FL_RDONLY_UMOUNT) &&
- (cxt->mountflags & (MS_RDONLY | MS_REMOUNT))) {
+ (cxt->mountflags & (MS_RDONLY | MS_REMOUNT))
+ == (MS_RDONLY | MS_REMOUNT)) {
/*
* fix options, remount --> read-only mount
*/
diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c
index 260dc26a8..9e98798af 100644
--- a/libmount/src/optstr.c
+++ b/libmount/src/optstr.c
@@ -700,7 +700,7 @@ int mnt_optstr_apply_flags(char **optstr, unsigned long flags,
continue;
if (ent->id == MS_RDONLY ||
(ent->mask & MNT_INVERT) ||
- !(fl & ent->id)) {
+ (fl & ent->id) != ent->id) {
char *end = val ? val + valsz :
name + namesz;
@@ -722,7 +722,7 @@ int mnt_optstr_apply_flags(char **optstr, unsigned long flags,
char *p;
for (ent = map; ent && ent->name; ent++) {
- if ((ent->mask & MNT_INVERT) || !(fl & ent->id))
+ if ((ent->mask & MNT_INVERT) || (fl & ent->id) != ent->id)
continue;
/* don't add options which require values (e.g. offset=%d) */