aboutsummaryrefslogtreecommitdiff
path: root/security/pwman
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2005-10-08 21:32:20 +0000
committerPav Lucistnik <pav@FreeBSD.org>2005-10-08 21:32:20 +0000
commitff2b67ac7dd0fd031c3b595225c7e3a1238c56e0 (patch)
tree619cd47b79ebff559f8860d4cf1e30a2dee20a3e /security/pwman
parentf07b80a7e4450c9280c451893d9d5f7cbdc42178 (diff)
downloadports-ff2b67ac7dd0fd031c3b595225c7e3a1238c56e0.tar.gz
ports-ff2b67ac7dd0fd031c3b595225c7e3a1238c56e0.zip
- Fix handling of & sign, it need to be escaped for XML storage
PR: ports/85240 Submitted by: Maurice Castro <maurice@sphinx.clari.net.au> Approved by: maintainer timeout (anders, 17 days) - While here, fix runtime crash on 64bit platforms by explicitly declaring getenv() (via including <stdlib.h> header)
Notes
Notes: svn path=/head/; revision=144607
Diffstat (limited to 'security/pwman')
-rw-r--r--security/pwman/Makefile6
-rw-r--r--security/pwman/files/patch-src-pwlist.c40
-rw-r--r--security/pwman/files/patch-src-pwman.h10
3 files changed, 55 insertions, 1 deletions
diff --git a/security/pwman/Makefile b/security/pwman/Makefile
index 024394a7c603..ba12701de766 100644
--- a/security/pwman/Makefile
+++ b/security/pwman/Makefile
@@ -7,7 +7,7 @@
PORTNAME= pwman
PORTVERSION= 0.3.2
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -19,11 +19,15 @@ LIB_DEPENDS= xml2.5:${PORTSDIR}/textproc/libxml2
RUN_DEPENDS= gpg:${PORTSDIR}/security/gnupg
GNU_CONFIGURE= yes
+USE_REINPLACE= yes
MAN1= pwman.1
DOCS= AUTHORS COPYING ChangeLog README TODO
+post-patch:
+ @${REINPLACE_CMD} -e 's|/usr/bin/gpg|${LOCALBASE}/bin/gpg|g' ${WRKSRC}/src/misc.c
+
.if !defined(NOPORTDOCS)
post-install:
@${INSTALL} -d -m 0755 ${DOCSDIR}
diff --git a/security/pwman/files/patch-src-pwlist.c b/security/pwman/files/patch-src-pwlist.c
new file mode 100644
index 000000000000..9ef8a0d6ebea
--- /dev/null
+++ b/security/pwman/files/patch-src-pwlist.c
@@ -0,0 +1,40 @@
+--- src/pwlist.c.old 2005-03-09 16:07:07.000000000 +0000
++++ src/pwlist.c 2005-03-09 16:06:37.000000000 +0000
+@@ -272,13 +272,32 @@
+ write_password_node(xmlNodePtr root, Pw* pw)
+ {
+ xmlNodePtr node;
++ xmlChar *escaped;
++
++ // Take the inbound strings. Treat as an xmlChar, and escape
++ // Need to free the result of escape every time
+
+ node = xmlNewChild(root, NULL, (xmlChar*)"PwItem", NULL);
+- xmlNewChild(node, NULL, (xmlChar*)"name", (xmlChar*)pw->name);
+- xmlNewChild(node, NULL, (xmlChar*)"host", (xmlChar*)pw->host);
+- xmlNewChild(node, NULL, (xmlChar*)"user", (xmlChar*)pw->user);
+- xmlNewChild(node, NULL, (xmlChar*)"passwd", (xmlChar*)pw->passwd);
+- xmlNewChild(node, NULL, (xmlChar*)"launch", (xmlChar*)pw->launch);
++
++ escaped = xmlEncodeSpecialChars(root, (xmlChar*)pw->name);
++ xmlNewChild(node, NULL, (xmlChar*)"name", escaped);
++ xmlFree(escaped);
++
++ escaped = xmlEncodeSpecialChars(root, (xmlChar*)pw->host);
++ xmlNewChild(node, NULL, (xmlChar*)"host", escaped);
++ xmlFree(escaped);
++
++ escaped = xmlEncodeSpecialChars(root, (xmlChar*)pw->user);
++ xmlNewChild(node, NULL, (xmlChar*)"user", escaped);
++ xmlFree(escaped);
++
++ escaped = xmlEncodeSpecialChars(root, (xmlChar*)pw->passwd);
++ xmlNewChild(node, NULL, (xmlChar*)"passwd", escaped);
++ xmlFree(escaped);
++
++ escaped = xmlEncodeSpecialChars(root, (xmlChar*)pw->launch);
++ xmlNewChild(node, NULL, (xmlChar*)"launch", escaped);
++ xmlFree(escaped);
+ }
+
+ int
diff --git a/security/pwman/files/patch-src-pwman.h b/security/pwman/files/patch-src-pwman.h
new file mode 100644
index 000000000000..8b0cf23c970f
--- /dev/null
+++ b/security/pwman/files/patch-src-pwman.h
@@ -0,0 +1,10 @@
+--- src/pwman.h.orig Mon Oct 14 18:10:36 2002
++++ src/pwman.h Sat Oct 8 23:21:23 2005
+@@ -26,6 +26,7 @@
+ #include <string.h>
+ #include <config.h>
+ #include <time.h>
++#include <stdlib.h>
+ #include <stdarg.h>
+
+ #define CONF_FILE ".pwmanrc"