warnx("Can't create group `%s': already exists", group);
return 0;
}
+#if defined(__minix)
+ /* LSC: Minix flock implementation is a wrapper around fctl, which
+ * requires writeable fds for LOCK_EX to succeed. */
+ if ((from = fopen(_PATH_GROUP, "r+")) == NULL) {
+#else
if ((from = fopen(_PATH_GROUP, "r")) == NULL) {
+#endif /* defined(__minix) */
warn("Can't create group `%s': can't open `%s'", name,
_PATH_GROUP);
return 0;
int fd;
int cc;
+#if defined(__minix)
+ /* LSC: Minix flock implementation is a wrapper around fctl, which
+ * requires writeable fds for LOCK_EX to succeed. */
+ if ((from = fopen(_PATH_GROUP, "r+")) == NULL) {
+#else
if ((from = fopen(_PATH_GROUP, "r")) == NULL) {
+#endif /* defined(__minix) */
warn("Can't modify group `%s': can't open `%s'",
group, _PATH_GROUP);
return 0;
}
}
}
+#if defined(__minix)
+ /* LSC: Minix flock implementation is a wrapper around fctl, which
+ * requires writeable fds for LOCK_EX to succeed. */
+ if ((from = fopen(_PATH_GROUP, "r+")) == NULL) {
+#else
if ((from = fopen(_PATH_GROUP, "r")) == NULL) {
+#endif /* defined(__minix) */
warn("Can't append group(s) for `%s': can't open `%s'",
user, _PATH_GROUP);
return 0;
login_name, up->u_class);
}
#endif
+#if defined(__minix)
+ /* LSC: Minix flock implementation is a wrapper around fctl, which
+ * requires writeable fds for LOCK_EX to succeed. */
+ if ((masterfd = open(_PATH_MASTERPASSWD, O_RDWR)) < 0) {
+#else
if ((masterfd = open(_PATH_MASTERPASSWD, O_RDONLY)) < 0) {
+#endif /* defined(__minix) */
err(EXIT_FAILURE, "Can't add user `%s': can't open `%s'",
login_name, _PATH_MASTERPASSWD);
}
buf);
return 0;
}
+#if defined(__minix)
+ /* LSC: Minix flock implementation is a wrapper around fctl, which
+ * requires writeable fds for LOCK_EX to succeed. */
+ if ((from = fopen(_PATH_GROUP, "r+")) == NULL) {
+#else
if ((from = fopen(_PATH_GROUP, "r")) == NULL) {
+#endif /* defined(__minix) */
warn("Can't remove user `%s' from `%s': can't open `%s'",
login_name, _PATH_GROUP, _PATH_GROUP);
return 0;
/* keep dir name in case we need it for '-m' */
homedir = pwp->pw_dir;
+#if defined(__minix)
+ /* LSC: Minix flock implementation is a wrapper around fctl, which
+ * requires writeable fds for LOCK_EX to succeed. */
+ if ((masterfd = open(_PATH_MASTERPASSWD, O_RDWR)) < 0) {
+#else
if ((masterfd = open(_PATH_MASTERPASSWD, O_RDONLY)) < 0) {
+#endif /* defined(__minix) */
err(EXIT_FAILURE, "Can't modify user `%s': can't open `%s'",
login_name, _PATH_MASTERPASSWD);
}