From 3eef1145fb2dc3eb7434ad247e8dd4f79a183cd0 Mon Sep 17 00:00:00 2001 From: trasz Date: Mon, 12 Aug 2013 21:01:01 +0000 Subject: Make check for unknown login class actually work. Previously, using the "-c" option with login class not defined in login.conf(5) would silently fail, resulting in using the default login class. --- usr.bin/su/su.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'usr.bin') diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index 6557c34..e721e62 100644 --- a/usr.bin/su/su.c +++ b/usr.bin/su/su.c @@ -373,6 +373,8 @@ main(int argc, char *argv[]) } lc = login_getclass(class); if (lc == NULL) + err(1, "login_getclass"); + if (lc->lc_class == NULL || strcmp(class, lc->lc_class) != 0) errx(1, "unknown class: %s", class); } -- cgit v1.1