summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-15 23:13:21 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-15 23:13:21 +0000
commit8378fbcb8ca835e0420792c1b6460074ca1bd1a9 (patch)
tree23210716ca2116c1896119ca73bd57b3d9e440d4
parent3fd0ff6478d44172a5b3ac9d118d16a166210bee (diff)
Really silly to chmod "st_mode & 07777" when making a copy of the
group file, like entirely missing the point. ok jca
-rw-r--r--usr.sbin/user/user.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c
index 45003754665..b27f0e2c231 100644
--- a/usr.sbin/user/user.c
+++ b/usr.sbin/user/user.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: user.c,v 1.103 2015/04/24 08:08:29 dlg Exp $ */
+/* $OpenBSD: user.c,v 1.104 2015/11/15 23:13:20 deraadt Exp $ */
/* $NetBSD: user.c,v 1.69 2003/04/14 17:40:07 agc Exp $ */
/*
@@ -372,7 +372,7 @@ creategid(char *group, gid_t gid, const char *name)
(void) unlink(f);
return 0;
}
- (void) chmod(_PATH_GROUP, st.st_mode & 07777);
+ (void) chmod(_PATH_GROUP, st.st_mode & 0777);
syslog(LOG_INFO, "new group added: name=%s, gid=%u", group, gid);
return 1;
}
@@ -467,7 +467,7 @@ modify_gid(char *group, char *newent)
(void) unlink(f);
return 0;
}
- (void) chmod(_PATH_GROUP, st.st_mode & 07777);
+ (void) chmod(_PATH_GROUP, st.st_mode & 0777);
if (newent == NULL) {
syslog(LOG_INFO, "group deleted: name=%s", group);
} else {
@@ -594,7 +594,7 @@ append_group(char *user, int ngroups, const char **groups)
(void) unlink(f);
return 0;
}
- (void) chmod(_PATH_GROUP, st.st_mode & 07777);
+ (void) chmod(_PATH_GROUP, st.st_mode & 0777);
return 1;
}
@@ -1327,7 +1327,7 @@ rm_user_from_groups(char *login_name)
return 0;
}
}
- (void) fchmod(fileno(to), st.st_mode & 07777);
+ (void) fchmod(fileno(to), st.st_mode & 0777);
(void) fclose(from);
if (fclose(to) == EOF) {
warn("can't remove gid for `%s': short write to `%s'",