ports/166638: [maintainer-update] www/chpasswd: fix build with cland and preserve config file
Guido Falsi
mad at madpilot.net
Wed Apr 4 12:40:02 UTC 2012
>Number: 166638
>Category: ports
>Synopsis: [maintainer-update] www/chpasswd: fix build with cland and preserve config file
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Wed Apr 04 12:40:01 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Guido Falsi
>Release: FreeBSD 9.0-STABLE amd64
>Organization:
none
>Environment:
System: FreeBSD megatron.madpilot.net 9.0-STABLE FreeBSD 9.0-STABLE #4 r233791: Mon Apr 2 21:14:27 CEST 2012 root at megatron.madpilot.net:/usr/obj/usr/src/sys/MEGATRON amd64
>Description:
Fix build with clang.
Modify port to not remove the config file on deinstall.
Bumped port revision.
Unluckily when upgrading the port the config file will be anyway
deleted this time since it is in the installed port plist from the
previous version.
I don't know how to avoid this. Could this be ignored, or should a
warning be added to UPDATING?
Added file:
files/patch-chpasswd.c
>How-To-Repeat:
>Fix:
diff -ruN chpasswd.old/Makefile chpasswd/Makefile
--- chpasswd.old/Makefile 2012-04-04 14:30:20.624062896 +0200
+++ chpasswd/Makefile 2012-04-04 14:30:32.656062622 +0200
@@ -7,6 +7,7 @@
PORTNAME= chpasswd
PORTVERSION= 2.2.4
+PORTREVISION= 1
CATEGORIES= www
#MASTER_SITES= SF/orsochpasswd/orsochpasswd/chpasswd-2.2.4/
MASTER_SITES= SF/orso${PORTNAME}/orso${PORTNAME}/${PORTNAME}-${PORTVERSION}/
diff -ruN chpasswd.old/files/patch-Makefile.in chpasswd/files/patch-Makefile.in
--- chpasswd.old/files/patch-Makefile.in 2012-04-04 14:30:20.623062523 +0200
+++ chpasswd/files/patch-Makefile.in 2012-04-04 14:30:32.655068780 +0200
@@ -1,5 +1,5 @@
---- Makefile.in.orig Wed Feb 11 14:56:26 2004
-+++ Makefile.in Wed Feb 11 14:57:15 2004
+--- Makefile.in.orig 2009-02-16 18:04:20.000000000 +0100
++++ Makefile.in 2012-04-04 11:40:46.773080089 +0200
@@ -1,13 +1,13 @@
# Makefile.in for chpasswd.cgi
@@ -16,7 +16,15 @@
PREFIX = @prefix@
DEFS = -I. @DEFS@ -DPREFIX=\"@prefix@\"
-@@ -43,7 +43,7 @@
+@@ -37,13 +37,13 @@
+ echo "cp $(PREFIX)/chpasswd.conf"; \
+ cp chpasswd.conf $(PREFIX)/chpasswd.conf; \
+ chmod 755 $(PREFIX)/chpasswd.conf; \
+- else \
+- cp chpasswd.conf $(PREFIX)/chpasswd.conf.orig; \
+ fi
++ @echo "cp $(PREFIX)/chpasswd.conf.sample"
++ @cp chpasswd.conf $(PREFIX)/chpasswd.conf.sample
@if test ! -f $(PREFIX)/chpasswd.log; then \
echo "touch $(PREFIX)/chpasswd.log"; \
touch $(PREFIX)/chpasswd.log; \
diff -ruN chpasswd.old/files/patch-chpasswd.c chpasswd/files/patch-chpasswd.c
--- chpasswd.old/files/patch-chpasswd.c 1970-01-01 01:00:00.000000000 +0100
+++ chpasswd/files/patch-chpasswd.c 2012-04-04 14:30:32.656062622 +0200
@@ -0,0 +1,108 @@
+--- chpasswd.c.orig 2012-04-03 23:09:02.516342475 +0200
++++ chpasswd.c 2012-04-03 23:09:54.396341248 +0200
+@@ -804,7 +804,7 @@
+
+ if (strcmp(getenv("REQUEST_METHOD"), "GET") == 0) {
+ UserForm(PwdMinLen,PwdMaxLen,PwdMinChar,PwdMinNum,PwdMinSpec,BgColor,TxColor,TiColor,RuColor,Logo,Width,Height,Header,BgImage,ShowInfo);
+- return;
++ return 0;
+ }
+
+ pContentLength = getenv("CONTENT_LENGTH");
+@@ -852,7 +852,7 @@
+ if(strlen(PwdLogFile) > 0)
+ log(PwdLogFile,User,New_pw1,ShowPwd,Msg,PwdFile,SmtpUser,SmtpSubject);
+ Herror(Msg);
+- return;
++ return 0;
+ }
+
+ if (strlen(New_pw1) < atoi(PwdMinLen)) {
+@@ -860,7 +860,7 @@
+ if(strlen(PwdLogFile) > 0)
+ log(PwdLogFile,User,New_pw1,ShowPwd,Msg,PwdFile,SmtpUser,SmtpSubject);
+ Herror(Msg);
+- return;
++ return 0;
+ }
+
+ if (strlen(New_pw1) > atoi(PwdMaxLen)) {
+@@ -868,7 +868,7 @@
+ if(strlen(PwdLogFile) > 0)
+ log(PwdLogFile,User,New_pw1,ShowPwd,Msg,PwdFile,SmtpUser,SmtpSubject);
+ Herror(Msg);
+- return;
++ return 0;
+ }
+
+ if (strcmp(Old_pw, New_pw1) == 0) {
+@@ -876,7 +876,7 @@
+ if(strlen(PwdLogFile) > 0)
+ log(PwdLogFile,User,New_pw1,ShowPwd,Msg,PwdFile,SmtpUser,SmtpSubject);
+ Herror(Msg);
+- return;
++ return 0;
+ }
+
+ if (strcmp(New_pw1, New_pw2) != 0) {
+@@ -884,13 +884,13 @@
+ if(strlen(PwdLogFile) > 0)
+ log(PwdLogFile,User,New_pw1,ShowPwd,Msg,PwdFile,SmtpUser,SmtpSubject);
+ Herror(Msg);
+- return;
++ return 0;
+ }
+
+ if ((fpw = fopen(PwdFile, "r")) == NULL) {
+ sprintf(Msg, "%s %s",msg07, PwdFile);
+ Herror(Msg);
+- return;
++ return 0;
+ }
+
+ fd = mkstemp(template);
+@@ -898,7 +898,7 @@
+ ((tmp = fdopen (fd, "w+" )) == NULL) ) { /* failure, bail out */
+ sprintf(Msg, "%s",msg08);
+ Herror(Msg);
+- return;
++ return 0;
+ }
+ while (fgets(buf, MAXLEN, fpw) != NULL) {
+ if (!ok) {
+@@ -918,7 +918,7 @@
+ if(strlen(PwdLogFile) > 0)
+ log(PwdLogFile,User,New_pw1,ShowPwd,Msg,PwdFile,SmtpUser,SmtpSubject);
+ Herror(Msg);
+- return;
++ return 0;
+ }
+
+ (void) srand((int) time((time_t *) NULL));
+@@ -943,13 +943,13 @@
+ if ((tmp = fopen(template, "r")) == NULL) {
+ sprintf(Msg, "%s",msg08);
+ Herror(Msg);
+- return;
++ return 0;
+ }
+
+ if ((fpw = fopen(PwdFile, "w")) == NULL) {
+ sprintf(Msg, "%s",msg07);
+ Herror(Msg);
+- return;
++ return 0;
+ }
+
+ while (fgets(buf, MAXLEN, tmp) != NULL)
+@@ -970,8 +970,8 @@
+ if(strlen(PwdLogFile) > 0)
+ log(PwdLogFile,User,New_pw1,ShowPwd,Msg,PwdFile,SmtpUser,SmtpSubject);
+ Herror(Msg);
+- return;
++ return 0;
+ }
+ }
+- return;
++ return 0;
+ }
diff -ruN chpasswd.old/pkg-plist chpasswd/pkg-plist
--- chpasswd.old/pkg-plist 2012-04-04 14:30:20.624062896 +0200
+++ chpasswd/pkg-plist 2012-04-04 14:30:32.656062622 +0200
@@ -1,4 +1,6 @@
-etc/chpasswd/chpasswd.conf
+ at unexec if cmp -s %D/etc/chpasswd/chpasswd.conf.sample %D/etc/chpasswd/chpasswd.conf; then rm -f %D/etc/chpasswd/chpasswd.conf; fi
+etc/chpasswd/chpasswd.conf.sample
+ at exec if [ ! -f %D/etc/chpasswd/chpasswd.conf ] ; then cp -p %D/%F %B/chpasswd/chpasswd.conf; fi
etc/chpasswd/chpasswd.log
www/cgi-bin/chpasswd.cgi
@dirrm etc/chpasswd
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list