static char *pw_homepolicy(struct userconf * cnf, struct cargs * args, char const * user);
static char *pw_shellpolicy(struct userconf * cnf, struct cargs * args, char *newshell);
static char *pw_password(struct userconf * cnf, struct cargs * args, char const * user);
static char *pw_homepolicy(struct userconf * cnf, struct cargs * args, char const * user);
static char *pw_shellpolicy(struct userconf * cnf, struct cargs * args, char *newshell);
static char *pw_password(struct userconf * cnf, struct cargs * args, char const * user);
static char *shell_path(char const * path, char *shells[], char *sh);
static void rmat(uid_t uid);
static char *shell_path(char const * path, char *shells[], char *sh);
static void rmat(uid_t uid);
cnf->default_group = newstr(grp->gr_name);
}
if ((arg = getarg(args, 'L')) != NULL)
cnf->default_group = newstr(grp->gr_name);
}
if ((arg = getarg(args, 'L')) != NULL)
if ((arg = getarg(args, 'l')) != NULL) {
if (strcmp(pwd->pw_name, "root") == 0)
cmderr(EX_DATAERR, "can't rename `root' account\n");
if ((arg = getarg(args, 'l')) != NULL) {
if (strcmp(pwd->pw_name, "root") == 0)
cmderr(EX_DATAERR, "can't rename `root' account\n");
}
if ((arg = getarg(args, 'u')) != NULL && isdigit(*arg->val)) {
pwd->pw_uid = (uid_t) atol(arg->val);
}
if ((arg = getarg(args, 'u')) != NULL && isdigit(*arg->val)) {
pwd->pw_uid = (uid_t) atol(arg->val);
if ((arg = getarg(args, 'h')) != NULL) {
if (strcmp(arg->val, "-") == 0)
if ((arg = getarg(args, 'h')) != NULL) {
if (strcmp(arg->val, "-") == 0)
- if (strchr(notch, name[l]) != NULL || name[l] < ' ' || name[l] > 126)
- cmderr(EX_DATAERR, (name[l]<' ' || (unsigned char)name[l] > 126)
+ if (strchr(notch, name[l]) != NULL || name[l] < ' ' ||
+ name[l] == 127 || (!gecos && name[l] & 0x80)) /* 8-bit */
+ cmderr(EX_DATAERR, (name[l]<' ' || name[l] > 126)
? "invalid character `%c' in field\n"
: "invalid character 0x$02x in field\n",
name[l]);
? "invalid character `%c' in field\n"
: "invalid character 0x$02x in field\n",
name[l]);
}
if (!gecos && l > MAXLOGNAME)
cmderr(EX_DATAERR, "name too long `%s'\n", name);
}
if (!gecos && l > MAXLOGNAME)
cmderr(EX_DATAERR, "name too long `%s'\n", name);