diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2009-01-15 13:14:31 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2009-01-15 13:14:31 +0000 |
commit | f8a1265731dfe5bcd317055b7bd072a3b8a60531 (patch) | |
tree | 5af407d75c8df5909b663b0fe1b81f2c9604dcd1 /lib | |
parent | 4adf2de03b1dd5aceee662537cb5cfd3326c44dd (diff) |
Remove support for kerb4 '.' instance separator, kerb4 is dead. OK jacekm@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/auth_subr.c | 10 | ||||
-rw-r--r-- | lib/libc/gen/authenticate.c | 28 |
2 files changed, 18 insertions, 20 deletions
diff --git a/lib/libc/gen/auth_subr.c b/lib/libc/gen/auth_subr.c index 73d5bff7581..e2612078e03 100644 --- a/lib/libc/gen/auth_subr.c +++ b/lib/libc/gen/auth_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth_subr.c,v 1.35 2008/03/24 16:10:59 deraadt Exp $ */ +/* $OpenBSD: auth_subr.c,v 1.36 2009/01/15 13:14:30 millert Exp $ */ /* * Copyright (c) 2000-2002,2004 Todd C. Miller <Todd.Miller@courtesan.com> @@ -628,11 +628,11 @@ auth_setpwd(auth_session_t *as, struct passwd *pwd) if (as->name == NULL) return (0); if ((pwd = getpwnam(as->name)) == NULL) { - instance = strpbrk(as->name, "./"); - if (instance++ == NULL) + instance = strchr(as->name, '/'); + if (instance == NULL) return (as->pwd ? 0 : 1); - if (strcmp(instance, "root") == 0) - pwd = getpwnam(instance); + if (strcmp(instance, "/root") == 0) + pwd = getpwnam(instance + 1); if (pwd == NULL) return (as->pwd ? 0 : 1); } diff --git a/lib/libc/gen/authenticate.c b/lib/libc/gen/authenticate.c index b9cd63a0928..c1b20b6e164 100644 --- a/lib/libc/gen/authenticate.c +++ b/lib/libc/gen/authenticate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: authenticate.c,v 1.17 2008/04/04 17:42:39 millert Exp $ */ +/* $OpenBSD: authenticate.c,v 1.18 2009/01/15 13:14:30 millert Exp $ */ /*- * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved. @@ -307,7 +307,7 @@ auth_usercheck(char *name, char *style, char *type, char *password) auth_session_t *as; login_cap_t *lc; struct passwd *pwd; - char *sep, save; + char *slash; if (strlcpy(namebuf, name, sizeof(namebuf)) >= sizeof(namebuf)) return (NULL); @@ -320,16 +320,15 @@ auth_usercheck(char *name, char *style, char *type, char *password) *style++ = '\0'; /* - * Cope with user[./]instance. We are only using this to get - * the class so it is okay if we strip a root instance + * Cope with user/instance. We are only using this to get + * the class so it is okay if we strip a /root instance * The actual login script will pay attention to the instance. */ if ((pwd = getpwnam(name)) == NULL) { - if ((sep = strpbrk(name, "./")) != NULL) { - save = *sep; - *sep = '\0'; + if ((slash = strchr(name, '/')) != NULL) { + *slash = '\0'; pwd = getpwnam(name); - *sep = save; + *slash = '/'; } } if ((lc = login_getclass(pwd ? pwd->pw_class : NULL)) == NULL) @@ -373,7 +372,7 @@ auth_userchallenge(char *name, char *style, char *type, char **challengep) auth_session_t *as; login_cap_t *lc; struct passwd *pwd; - char *sep, save; + char *slash; if (strlen(name) >= sizeof(namebuf)) return (NULL); @@ -387,16 +386,15 @@ auth_userchallenge(char *name, char *style, char *type, char **challengep) *style++ = '\0'; /* - * Cope with user[./]instance. We are only using this to get - * the class so it is okay if we strip a root instance + * Cope with user/instance. We are only using this to get + * the class so it is okay if we strip a /root instance * The actual login script will pay attention to the instance. */ if ((pwd = getpwnam(name)) == NULL) { - if ((sep = strpbrk(name, "./")) != NULL) { - save = *sep; - *sep = '\0'; + if ((slash = strchr(name, '/')) != NULL) { + *slash = '\0'; pwd = getpwnam(name); - *sep = save; + *slash = '/'; } } if ((lc = login_getclass(pwd ? pwd->pw_class : NULL)) == NULL) |