- Add ##user form password patch.

PR:		ports/28803
Submitted by:	motoyuki
Approved by:	maintainer timeout (3 years)
This commit is contained in:
Florent Thoumie 2005-06-01 15:35:25 +00:00
parent 8772585d06
commit a06daa2425
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=136611
2 changed files with 22 additions and 0 deletions

View file

@ -8,6 +8,7 @@
PORTNAME= conserver PORTNAME= conserver
PORTVERSION= 8.5 PORTVERSION= 8.5
PORTREVISION= 1
CATEGORIES= comms CATEGORIES= comms
MASTER_SITES= ftp://ftp.physics.purdue.edu/pub/pundits/ \ MASTER_SITES= ftp://ftp.physics.purdue.edu/pub/pundits/ \
http://www.komquats.com/distfiles/ \ http://www.komquats.com/distfiles/ \

View file

@ -0,0 +1,21 @@
--- etc/conserver/group.c.orig Thu Aug 3 03:39:42 2000
+++ etc/conserver/group.c Sat Jul 7 16:10:53 2001
@@ -228,6 +228,18 @@
struct passwd *pwd;
char *pcEPass, *pcWord;
{
+ if (pcEPass && '#' == pcEPass[0] && '#' == pcEPass[1] && '\0' != pcEPass[2] && (MAXLOGNAME + 1) > strlen(pcEPass)) {
+ /* If the encrypted password field from the config file
+ * looks like ##USER, look up the password for that
+ * user for the match.
+ */
+ pwd = getpwnam(pcEPass+2);
+ if ((struct passwd *) NULL == pwd) {
+ return 0;
+ }
+ pcEPass = (char *)0;
+ }
+
if (pcEPass && '\0' != pcEPass[0])
if (MD5CheckPass(pcEPass, pcWord))
return 1;