fix broken password authentication; patch from Nathan Johnson
This commit is contained in:
parent
eb757943fa
commit
b6b86b8505
@ -1,9 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.34 2007/09/15 23:29:58 merdely Exp $
|
||||
# $OpenBSD: Makefile,v 1.35 2007/09/18 22:15:11 jakob Exp $
|
||||
|
||||
COMMENT= SOCKS client and server
|
||||
|
||||
DISTNAME= dante-1.1.19
|
||||
PKGNAME= ${DISTNAME}
|
||||
PKGNAME= ${DISTNAME}p0
|
||||
CATEGORIES= security
|
||||
|
||||
SHARED_LIBS= dsocks 1.1 \
|
||||
|
44
security/dante/patches/patch-sockd_auth_password_c
Normal file
44
security/dante/patches/patch-sockd_auth_password_c
Normal file
@ -0,0 +1,44 @@
|
||||
$OpenBSD: patch-sockd_auth_password_c,v 1.1 2007/09/18 22:15:11 jakob Exp $
|
||||
--- sockd/auth_password.c.orig Wed Jun 8 08:34:54 2005
|
||||
+++ sockd/auth_password.c Tue Sep 18 17:27:00 2007
|
||||
@@ -57,29 +57,33 @@ passwordcheck(name, clearpassword, emsg,
|
||||
struct passwd *pw;
|
||||
char *salt, *password;
|
||||
uid_t euid;
|
||||
+ int retval = -1; /* default return value */
|
||||
|
||||
socks_seteuid(&euid, sockscf.uid.privileged);
|
||||
pw = socks_getpwnam(name);
|
||||
- socks_reseteuid(sockscf.uid.privileged, euid);
|
||||
|
||||
if (pw == NULL) {
|
||||
snprintfn(emsg, emsglen, "system username/password failed");
|
||||
- return -1;
|
||||
+ retval = -1;
|
||||
}
|
||||
|
||||
- if (clearpassword != NULL) {
|
||||
+ else if (clearpassword != NULL) {
|
||||
salt = pw->pw_passwd;
|
||||
password = pw->pw_passwd;
|
||||
|
||||
if (strcmp(crypt(clearpassword, salt), password) == 0)
|
||||
- return 0;
|
||||
+ retval = 0;
|
||||
else {
|
||||
snprintfn(emsg, emsglen, "system password userauthentication failed");
|
||||
- return -1;
|
||||
+ retval = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
- return 0;
|
||||
+ retval = 0;
|
||||
|
||||
- return -1;
|
||||
+ /* reset after checking pw because on OpenBSD pw->pw_passwd
|
||||
+ resets to stars after euid is no longer 0 */
|
||||
+ socks_reseteuid(sockscf.uid.privileged, euid);
|
||||
+
|
||||
+ return retval;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user