* Match poppassd's expectation with /usr/bin/passwd's actual output.

* Honor CFLAGS and LDFLAGS and some clean-up.

PR:		42359
Submitted by:	andrew@ugh.net.au
This commit is contained in:
Christian Weisgerber 2002-10-06 01:39:07 +00:00
parent 9d4e7ac9f5
commit 638e9e1fdc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=67445
3 changed files with 23 additions and 28 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= poppassd
PORTVERSION= 4.0
PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= ftp://ftp.qualcomm.com/eudora/servers/unix/password/
DISTNAME= pwserve-4

View File

@ -1,11 +1,13 @@
--- Makefile.orig Sun Nov 3 15:27:42 1996
+++ Makefile Sun Nov 3 15:31:27 1996
--- Makefile.orig Thu Sep 5 16:11:10 2002
+++ Makefile Thu Sep 5 16:13:58 2002
@@ -1,11 +1,11 @@
-BINDIR = /usr/etc
+BINDIR = ${PREFIX}/libexec
LIBDIR =
CFLAGS = -g
LFLAGS = -g
-CFLAGS = -g
-LFLAGS = -g
+CFLAGS?= -g
+LFLAGS?= ${LDFLAGS}
CCM = cc -Em
OBJECTS = poppassd.o

View File

@ -1,5 +1,5 @@
--- poppassd.c.orig Mon Jun 7 19:34:23 1999
+++ poppassd.c Mon Jun 7 19:40:00 1999
--- poppassd.c.orig Thu Sep 5 11:44:07 2002
+++ poppassd.c Thu Sep 5 16:07:09 2002
@@ -13,11 +13,11 @@
*
* Doesn't actually change any passwords itself. It simply listens for
@ -39,21 +39,22 @@
+ "Changing local password for *.\nOld password:",
"Changing password for * on *.\nOld password:",
- "Changing NIS password for * on *.\nOld password:",
+ "Changing NIS password for * on *.\nOld Password: ",
+ "Changing NIS password for * on *.\nOld Password:",
"Changing password for *\n*'s Old password:",
""};
@@ -165,7 +166,9 @@
@@ -165,7 +166,10 @@
static char *P4[] =
{"\n",
+ "\npasswd: rebuilding the database...\npasswd: done\n",
+ "\npasswd: updating the database...\npasswd: done\n",
"NIS entry changed on *\n",
+ "\n\nNIS password has been changed on *.\n",
""};
@@ -186,11 +189,7 @@
@@ -186,11 +190,7 @@
*user = *oldpass = *newpass = 0;
@ -66,7 +67,7 @@
WriteToClient ("200 poppassd v%s hello, who are you?", VERSION);
ReadFromClient (line);
@@ -212,12 +211,16 @@
@@ -212,12 +212,16 @@
if ((pw = getpwnam (user)) == NULL)
{
@ -84,7 +85,7 @@
WriteToClient ("500 Old password is incorrect.");
exit(1);
}
@@ -264,28 +267,28 @@
@@ -264,28 +268,28 @@
if ((wpid = waitpid (pid, &wstat, 0)) < 0)
{
@ -117,7 +118,7 @@
WriteToClient ("500 Server error (abnormal exit), get help!");
exit (1);
}
@@ -304,17 +307,19 @@
@@ -304,17 +308,19 @@
}
else /* Child */
{
@ -148,7 +149,7 @@
setuid (pw->pw_uid);
setgid (pw->pw_gid);
dochild (master, slavedev, user);
@@ -324,7 +329,7 @@
@@ -324,7 +330,7 @@
/*
* dochild
*
@ -157,7 +158,7 @@
*
* Code adapted from "Advanced Programming in the UNIX Environment"
* by W. Richard Stevens.
@@ -338,13 +343,6 @@
@@ -338,13 +344,6 @@
int slave;
struct termios stermios;
@ -171,7 +172,7 @@
/* Open slave pty and acquire as new controlling terminal. */
if ((slave = open(slavedev, O_RDWR)) < 0) {
@@ -387,10 +385,10 @@
@@ -387,10 +386,10 @@
return(0);
}
@ -185,7 +186,7 @@
return(0);
}
}
@@ -408,15 +406,20 @@
@@ -408,15 +407,20 @@
*
* Modified by Norstad to remove assumptions about number of pty's allocated
* on this UNIX box.
@ -207,24 +208,15 @@
dirp = opendir("/dev");
while ((dp = readdir(dirp)) != NULL) {
if (strncmp(dp->d_name, "pty", 3) == 0 && strlen(dp->d_name) == 5) {
@@ -485,9 +488,11 @@
@@ -485,8 +489,10 @@
}
writestring(master, pswd);
-
+ sleep(2);
if (!expect(master, P4, buf)) return FAILURE;
+ close(master);
+
+ close(master);
return SUCCESS;
}
@@ -566,6 +571,7 @@
}
n += m;
buf[n] = 0;
+/* syslog(LOG_ERR, "read from child: %s",buf); */
initialSegment = 0;
for (s = expected; **s != 0; s++) {
result = match(buf, *s);