Sync with NetBSD rcp, add v6 parsing support and no setuid code at all.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23028 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-04-17 17:30:06 +00:00
parent bd22a7f8d9
commit 85c940fa73
4 changed files with 39 additions and 29 deletions

View File

@@ -61,6 +61,21 @@ colon(cp)
return (0);
}
char *
unbracket(char *cp)
{
char *ep;
if (*cp == '[') {
ep = cp + (strlen(cp) - 1);
if (*ep == ']') {
*ep = '\0';
++cp;
}
}
return (cp);
}
void
verifydir(cp)
char *cp;
@@ -98,8 +113,7 @@ bad: warnx("%s: invalid user name", cp0);
}
int
susystem(s, userid)
int userid;
susystem(s)
char *s;
{
void (*istat)(int), (*qstat)(int);
@@ -112,8 +126,6 @@ susystem(s, userid)
return (127);
case 0:
if (setuid(userid) < 0)
_exit(127);
execl(_PATH_BSHELL, "sh", "-c", s, NULL);
_exit(127);
}