diff options
author | Martynas Venckus <martynas@cvs.openbsd.org> | 2010-12-10 19:55:38 +0000 |
---|---|---|
committer | Martynas Venckus <martynas@cvs.openbsd.org> | 2010-12-10 19:55:38 +0000 |
commit | 70f0db634881a3e075808a47ce9313ddf9834323 (patch) | |
tree | a7a745ef04e0fb08d601af11c5de583c71df1b40 | |
parent | 64ed045ac0a3fa5cd69df6379a94167a6ede3543 (diff) |
- don't use memory from the session we've already cleaned in the
loop. fixes "login foo" and "su -L foo". ok millert@, otto@
-rw-r--r-- | usr.bin/su/su.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index 2b11d69d50f..ea86cfe923b 100644 --- a/usr.bin/su/su.c +++ b/usr.bin/su/su.c @@ -1,4 +1,4 @@ -/* $OpenBSD: su.c,v 1.62 2010/12/09 16:10:00 sobrado Exp $ */ +/* $OpenBSD: su.c,v 1.63 2010/12/10 19:55:37 martynas Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -194,7 +194,7 @@ main(int argc, char **argv) /* If the user specified a login class, use it */ if (!class && pwd && pwd->pw_class && pwd->pw_class[0] != '\0') - class = pwd->pw_class; + class = strdup(pwd->pw_class); if ((lc = login_getclass(class)) == NULL) auth_errx(as, 1, "no such login class: %s", class ? class : LOGIN_DEFCLASS); |