freebsd-ports/comms/conserver/files/patch-etc_conserver_group.c
Florent Thoumie a06daa2425 - Add ##user form password patch.
PR:		ports/28803
Submitted by:	motoyuki
Approved by:	maintainer timeout (3 years)
2005-06-01 15:35:25 +00:00

21 lines
655 B
C

--- 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;