Fixed two bugs, first not allowing '.' as a valid login name character
in okname() in util.c and second, returning != 0 when you do have an error from okname in two places in rcp.c. Thanks to Garrett for the POSIX defintion of valid login and group names. PR: bin/25757 MFC after: 3 weeks
This commit is contained in:
parent
47fe010cf3
commit
af8dcd940f
@ -310,8 +310,10 @@ toremote(targ, argc, argv)
|
||||
suser = argv[i];
|
||||
if (*suser == '\0')
|
||||
suser = pwd->pw_name;
|
||||
else if (!okname(suser))
|
||||
else if (!okname(suser)) {
|
||||
++errs;
|
||||
continue;
|
||||
}
|
||||
(void)snprintf(bp, len,
|
||||
"%s %s -l %s -n %s %s '%s%s%s:%s'",
|
||||
_PATH_RSH, host, suser, cmd, src,
|
||||
@ -391,8 +393,10 @@ tolocal(argc, argv)
|
||||
suser = argv[i];
|
||||
if (*suser == '\0')
|
||||
suser = pwd->pw_name;
|
||||
else if (!okname(suser))
|
||||
else if (!okname(suser)) {
|
||||
++errs;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
len = strlen(src) + CMDNEEDS + 20;
|
||||
if ((bp = malloc(len)) == NULL)
|
||||
|
@ -98,7 +98,7 @@ okname(cp0)
|
||||
c = *cp;
|
||||
if (c & 0200)
|
||||
goto bad;
|
||||
if (!isalpha(c) && !isdigit(c) && c != '_' && c != '-')
|
||||
if (!isalpha(c) && !isdigit(c) && c != '_' && c != '-' && c != '.' )
|
||||
goto bad;
|
||||
} while (*++cp);
|
||||
return (1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user