mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-23 18:25:19 +00:00
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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77491
|
@ -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…
Reference in a new issue