summaryrefslogtreecommitdiffstats
path: root/libexec/login_passwd
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2001-06-29 05:56:36 +0000
committerderaadt <deraadt@openbsd.org>2001-06-29 05:56:36 +0000
commit6beee50436b990283d2d021fe2e8f1b0920179bd (patch)
tree53147b66ebae817c448fd71b694c9455fc57c1f5 /libexec/login_passwd
parentWe need telnet_net_write() even when AUTHENTICATION is not defined. (diff)
downloadwireguard-openbsd-6beee50436b990283d2d021fe2e8f1b0920179bd.tar.xz
wireguard-openbsd-6beee50436b990283d2d021fe2e8f1b0920179bd.zip
ugly
Diffstat (limited to 'libexec/login_passwd')
-rw-r--r--libexec/login_passwd/login_passwd.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/libexec/login_passwd/login_passwd.c b/libexec/login_passwd/login_passwd.c
index ef49a1989bd..b10d2a3986f 100644
--- a/libexec/login_passwd/login_passwd.c
+++ b/libexec/login_passwd/login_passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_passwd.c,v 1.3 2001/06/26 05:03:28 hin Exp $ */
+/* $OpenBSD: login_passwd.c,v 1.4 2001/06/29 05:56:36 deraadt Exp $ */
/*-
* Copyright (c) 2001 Hans Insulander <hin@openbsd.org>.
@@ -30,28 +30,27 @@
int
pwd_login(char *username, char *password, char *wheel, int lastchance,
- char *class)
+ char *class)
{
struct passwd *pwd;
char *salt;
-
- if((wheel != NULL) && strcmp(wheel, "yes") != 0) {
- fprintf(back, BI_VALUE " errormsg %s\n",
- auth_mkvalue("you are not in group wheel"));
- fprintf(back, BI_REJECT "\n");
+ if (wheel != NULL && strcmp(wheel, "yes") != 0) {
+ fprintf(back, BI_VALUE " errormsg %s\n",
+ auth_mkvalue("you are not in group wheel"));
+ fprintf(back, BI_REJECT "\n");
return AUTH_FAILED;
}
pwd = getpwnam(username);
/* Check for empty password */
- if((pwd != NULL) && (*pwd->pw_passwd == '\0')) {
+ if (pwd != NULL && *pwd->pw_passwd == '\0') {
fprintf(back, BI_AUTH "\n");
return AUTH_OK;
}
- if(pwd)
+ if (pwd)
salt = pwd->pw_passwd;
else
salt = "xx";
@@ -63,7 +62,7 @@ pwd_login(char *username, char *password, char *wheel, int lastchance,
if (!pwd || strcmp(salt, pwd->pw_passwd) != 0)
return AUTH_FAILED;
- if(login_check_expire(back, pwd, class, lastchance) == 0)
+ if (login_check_expire(back, pwd, class, lastchance) == 0)
fprintf(back, BI_AUTH "\n");
else
return AUTH_FAILED;