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.
This commit is contained in:
Edward Tomasz Napierala 2013-08-12 21:01:01 +00:00
parent fe97b88c15
commit d790b96563
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=254259

View File

@ -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);
}