aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authoredwin <edwin@FreeBSD.org>2007-09-23 11:17:21 +0800
committeredwin <edwin@FreeBSD.org>2007-09-23 11:17:21 +0800
commit10c9f4430447718a87d59e5ef1c3c5ed6116fafb (patch)
treebc5db2717a6333c1d351827b464d9a8d750df564 /security
parent2b5d3d2e478ce0b73c0b5f2b6efd5fc42d44848d (diff)
downloadfreebsd-ports-gnome-10c9f4430447718a87d59e5ef1c3c5ed6116fafb.tar.gz
freebsd-ports-gnome-10c9f4430447718a87d59e5ef1c3c5ed6116fafb.tar.zst
freebsd-ports-gnome-10c9f4430447718a87d59e5ef1c3c5ed6116fafb.zip
Update port: security/sfs, fix build with gcc42
The attached patch fixes security/sfs so it builds with gcc42. The only change I made that I am wary of is commenting out the LIBTOOL variable in ${WRKSRC}/sfsrwcd/Makefile. However, this seems to work fine on both 7.0-CURRENT and 6.2-STABLE. In addition, I would not mind maintaining the port. PR: ports/116389 Submitted by: Dave Grochowski <malus.x@gmail.com>
Diffstat (limited to 'security')
-rw-r--r--security/sfs/Makefile48
-rw-r--r--security/sfs/files/patch-agent_ssu.C22
-rw-r--r--security/sfs/files/patch-arpc_rpctypes.h8
-rw-r--r--security/sfs/files/patch-async_aiod.h12
-rw-r--r--security/sfs/files/patch-async_daemonize.C37
-rw-r--r--security/sfs/files/patch-async_suio_vuprintf.C51
-rw-r--r--security/sfs/files/patch-crypt_getsysnoise.C87
-rw-r--r--security/sfs/files/patch-rex_chan.C15
-rw-r--r--security/sfs/files/patch-rex_rex.C20
-rw-r--r--security/sfs/files/patch-rpcc_rpcc.C29
-rw-r--r--security/sfs/files/patch-sfsmisc_suidgetfd.C20
11 files changed, 339 insertions, 10 deletions
diff --git a/security/sfs/Makefile b/security/sfs/Makefile
index 4f2d26f7a67a..707aae6d8ad5 100644
--- a/security/sfs/Makefile
+++ b/security/sfs/Makefile
@@ -8,11 +8,11 @@
PORTNAME= sfs
PORTVERSION= 0.7.2
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= security net
MASTER_SITES= http://www.fs.net/sfswww/dist/
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= malus.x@gmail.com
COMMENT= Self-Certifying File System: A secure global network file system
PLIST_SUB= SFS_VERSION=${PORTVERSION}
@@ -36,10 +36,6 @@ LIB_DEPENDS+= gmp.7:${PORTSDIR}/math/libgmp4
IGNORE= nfsmounter component fails to execute correctly on ${ARCH} systems
.endif
-.if ${OSVERSION} >= 700042
-BROKEN= Does not compile with GCC 4.2
-.endif
-
MAN1= \
dirsearch.1 \
newaid.1 \
@@ -74,6 +70,46 @@ post-extract:
@${FIND} -E ${WRKDIR} -type f -iregex ".*\.(C|h)" -print0 | \
${XARGS} -0 ${REINPLACE_CMD} -e 's/template get/get/'
+ @${REINPLACE_CMD} -e 's/authsess::\(authsess\)/\1/' \
+ ${WRKSRC}/agent/agent.h
+
+ @${REINPLACE_CMD} -e 's/\(u_int32_t val\)/\1 = 0/' \
+ ${WRKSRC}/arpc/xdrmisc.C
+
+ @${REINPLACE_CMD} -e 's/\(errorbuf = \)""/\1const_cast<char *> ("")/' \
+ ${WRKSRC}/async/parseopt.C
+
+ @${REINPLACE_CMD} -e 's/, \(&dummy_len\)/, (socklen_t *)\1/' \
+ ${WRKSRC}/rex/connect.c
+
+ @${REINPLACE_CMD} -e 's/, \(&reslen\)/, (socklen_t *)\1/' \
+ ${WRKSRC}/rex/listen.c
+
+ @${REINPLACE_CMD} -e 's/ptyclient::\(ptyclient\)/\1/' \
+ ${WRKSRC}/rex/ptyd.C
+
+ @${REINPLACE_CMD} -e 's/\("ptyd"\)/const_cast<char *> (\1)/' \
+ ${WRKSRC}/rex/rexd.C
+
+ @${REINPLACE_CMD} -e 's/, &sn/, (socklen_t *)\&sn/' \
+ ${WRKSRC}/rex/uasync.c
+
+ @${REINPLACE_CMD} -e \
+ 's/\(\\"" << cp->id << "\\"\)/const_cast<char *> (\1)/' \
+ ${WRKSRC}/rpcc/gencfile.C
+
+ @${REINPLACE_CMD} -e 's/= fhextra =/=/' ${WRKSRC}/sfscd/ctlnode.C
+
+ @${REINPLACE_CMD} -e 's/\("-c"\)/const_cast<char *> (\1)/' \
+ ${WRKSRC}/sfsmisc/agentmisc.C
+
+ @${REINPLACE_CMD} -e 's/\("localhost"\)/const_cast<char *> (\1)/' \
+ ${WRKSRC}/sfsrwsd/client.C
+
+post-configure:
+ @${REINPLACE_CMD} -e 's/^LIBTOOL =/#LIBTOOL =/' \
+ ${WRKSRC}/sfsrwcd/Makefile
+
pre-install:
PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
diff --git a/security/sfs/files/patch-agent_ssu.C b/security/sfs/files/patch-agent_ssu.C
new file mode 100644
index 000000000000..b80055180494
--- /dev/null
+++ b/security/sfs/files/patch-agent_ssu.C
@@ -0,0 +1,22 @@
+--- agent/ssu.C.orig 2002-08-01 17:09:53.000000000 -0400
++++ agent/ssu.C 2007-09-15 19:44:20.000000000 -0400
+@@ -87,7 +87,7 @@
+ str cwdopt = getcwdopt ();
+
+ vec<char *> av;
+- av.push_back (PATH_SU);
++ av.push_back (const_cast<char *> (PATH_SU));
+
+ int ch;
+ while ((ch = getopt (argc, argv, "fmlc:")) != -1)
+@@ -111,8 +111,8 @@
+ if (argc)
+ usage ();
+
+- av.push_back ("root");
+- av.push_back ("-c");
++ av.push_back (const_cast<char *> ("root"));
++ av.push_back (const_cast<char *> ("-c"));
+ {
+ strbuf cbuf ("exec ");
+ cbuf << fix_exec_path ("newaid") << " " << uidopt;
diff --git a/security/sfs/files/patch-arpc_rpctypes.h b/security/sfs/files/patch-arpc_rpctypes.h
index 4bd0ae3feebf..161224ca2a96 100644
--- a/security/sfs/files/patch-arpc_rpctypes.h
+++ b/security/sfs/files/patch-arpc_rpctypes.h
@@ -1,5 +1,5 @@
---- arpc/rpctypes.h.orig Mon Oct 11 16:43:34 2004
-+++ arpc/rpctypes.h Mon Oct 11 16:39:35 2004
+--- arpc/rpctypes.h.orig 2002-05-28 06:29:15.000000000 -0400
++++ arpc/rpctypes.h 2007-09-15 17:13:31.000000000 -0400
@@ -129,7 +129,7 @@
if (&v != this) \
assign (v)
@@ -27,10 +27,10 @@
};
template<size_t n = RPC_INFINITY> struct rpc_bytes : rpc_vec<char, n> {
- void setstrmem (const str &s) { set (s.cstr (), s.len (), NOFREE); }
-+ void setstrmem (const str &s) { set (s.cstr (), s.len (), freemode::NOFREE); }
++ void setstrmem (const str &s) { this->set (s.cstr (), s.len (), freemode::NOFREE); }
rpc_bytes &operator= (const str &s)
- { setsize (s.len ()); memcpy (base (), s.cstr (), size ()); return *this; }
-+ { setsize (s.len ()); memcpy (this->base (), s.cstr (), this->size ()); return *this; }
++ { this->setsize (s.len ()); memcpy (this->base (), s.cstr (), this->size ()); return *this; }
template<size_t m> rpc_bytes &operator= (const rpc_vec<char, m> &v)
{ rpc_vec<char, n>::operator= (v); return *this; }
template<size_t m> rpc_bytes &operator= (const array<char, m> &v)
diff --git a/security/sfs/files/patch-async_aiod.h b/security/sfs/files/patch-async_aiod.h
new file mode 100644
index 000000000000..c212a307a66a
--- /dev/null
+++ b/security/sfs/files/patch-async_aiod.h
@@ -0,0 +1,12 @@
+--- async/aiod.h.orig 2002-10-29 01:29:02.000000000 -0500
++++ async/aiod.h 2007-09-15 16:53:08.000000000 -0400
+@@ -30,6 +30,9 @@
+ #include "ihash.h"
+ #include "aiod_prot.h"
+
++class aiod;
++class aiofh;
++
+ struct aiod_req;
+
+ class aiobuf {
diff --git a/security/sfs/files/patch-async_daemonize.C b/security/sfs/files/patch-async_daemonize.C
new file mode 100644
index 000000000000..bfe371757d1f
--- /dev/null
+++ b/security/sfs/files/patch-async_daemonize.C
@@ -0,0 +1,37 @@
+--- async/daemonize.C.orig 2002-10-10 13:20:16.000000000 -0400
++++ async/daemonize.C 2007-09-15 17:00:51.000000000 -0400
+@@ -49,18 +49,19 @@
+ const str &logfile, int flags, mode_t mode)
+ {
+ #ifdef PATH_LOGGER
+- char *av[] = { PATH_LOGGER, "-p", NULL, "-t", NULL, NULL, NULL };
++ char *av[] = { const_cast<char *> (PATH_LOGGER), const_cast<char *> ("-p"),
++ NULL, const_cast<char *> ("-t"), NULL, NULL, NULL };
+ av[2] = const_cast<char *> (priority.cstr ());
+
+ if (line)
+ av[5] = const_cast<char *> (line.cstr ());
+ else
+- av[5] = "log started";
++ av[5] = const_cast<char *> ("log started");
+
+ if (tag)
+ av[4] = const_cast<char *> (tag.cstr ());
+ else
+- av[4] = "";
++ av[4] = const_cast<char *> ("");
+
+ pid_t pid;
+ int status;
+@@ -93,9 +94,9 @@
+ start_logger ()
+ {
+ #ifdef PATH_LOGGER
+- char *av[] = { PATH_LOGGER, "-p",
++ char *av[] = { const_cast<char *> (PATH_LOGGER), const_cast<char *> ("-p"),
+ const_cast<char *> (syslog_priority.cstr ()),
+- "-t", "", NULL};
++ const_cast<char *> ("-t"), const_cast<char *> (""), NULL};
+ int fds[2];
+
+ close (0);
diff --git a/security/sfs/files/patch-async_suio_vuprintf.C b/security/sfs/files/patch-async_suio_vuprintf.C
new file mode 100644
index 000000000000..6ab295532b05
--- /dev/null
+++ b/security/sfs/files/patch-async_suio_vuprintf.C
@@ -0,0 +1,51 @@
+--- async/suio_vuprintf.C.orig 2000-10-08 19:18:10.000000000 -0400
++++ async/suio_vuprintf.C 2007-09-15 17:02:44.000000000 -0400
+@@ -139,7 +139,7 @@
+ int dprec; /* a copy of prec if [diouxX], 0 otherwise */
+ int realsz; /* field size expanded by dprec */
+ int size; /* size of converted field or string */
+- char *xdigs = ""; /* digits for [xX] conversion */
++ char *xdigs = const_cast<char *> (""); /* digits for [xX] conversion */
+
+ char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */
+ char ox[2]; /* space for 0x hex-prefix */
+@@ -392,7 +392,7 @@
+ /* NOSTRICT */
+ _uquad = (u_long) va_arg (ap, void *);
+ base = HEX;
+- xdigs = "0123456789abcdef";
++ xdigs = const_cast<char *> ("0123456789abcdef");
+ flags |= HEXPREFIX;
+ ch = 'x';
+ goto nosign;
+@@ -403,7 +403,7 @@
+ cp = va_arg (ap, char *);
+ gotcp:
+ if (cp == NULL)
+- cp = "(null)";
++ cp = const_cast<char *> ("(null)");
+ if (prec >= 0) {
+ /*
+ * can't use strlen; can only look for the
+@@ -434,10 +434,10 @@
+ base = DEC;
+ goto nosign;
+ case 'X':
+- xdigs = "0123456789ABCDEF";
++ xdigs = const_cast<char *> ("0123456789ABCDEF");
+ goto hex;
+ case 'x':
+- xdigs = "0123456789abcdef";
++ xdigs = const_cast<char *> ("0123456789abcdef");
+ hex:
+ _uquad = UARG ();
+ base = HEX;
+@@ -497,7 +497,7 @@
+ break;
+
+ default:
+- cp = "bug in vfprintf: bad base";
++ cp = const_cast<char *> ("bug in vfprintf: bad base");
+ size = strlen (cp);
+ goto skipsize;
+ }
diff --git a/security/sfs/files/patch-crypt_getsysnoise.C b/security/sfs/files/patch-crypt_getsysnoise.C
new file mode 100644
index 000000000000..9a41364dff11
--- /dev/null
+++ b/security/sfs/files/patch-crypt_getsysnoise.C
@@ -0,0 +1,87 @@
+--- crypt/getsysnoise.C.orig 2002-02-08 09:27:51.000000000 -0500
++++ crypt/getsysnoise.C 2007-09-15 17:30:39.000000000 -0400
+@@ -27,61 +27,61 @@
+ #include <sys/resource.h>
+
+ char *const noiseprogs[][5] = {
+- { PATH_PS, "laxwww" },
+- { PATH_PS, "-al" },
+- { PATH_LS, "-nfail", "/tmp/." },
++ { const_cast<char *> (PATH_PS), const_cast<char *> ("laxwww") },
++ { const_cast<char *> (PATH_PS), const_cast<char *> ("-al") },
++ { const_cast<char *> (PATH_LS), const_cast<char *> ("-nfail"), const_cast<char *> ("/tmp/.") },
+ #ifdef PATH_NETSTAT
+- { PATH_NETSTAT, "-s" },
+- { PATH_NETSTAT, "-an" },
+- { PATH_NETSTAT, "-in" },
++ { const_cast<char *> (PATH_NETSTAT), const_cast<char *> ("-s") },
++ { const_cast<char *> (PATH_NETSTAT), const_cast<char *> ("-an") },
++ { const_cast<char *> (PATH_NETSTAT), const_cast<char *> ("-in") },
+ #endif /* PATH_NETSTAT */
+ #ifdef PATH_NTPQ
+- { PATH_NTPQ, "-np" },
++ { const_cast<char *> (PATH_NTPQ), const_cast<char *> ("-np") },
+ #endif /* PATH_NTPQ */
+ #ifdef PATH_W
+- { PATH_W },
++ { const_cast<char *> (PATH_W) },
+ #endif /* PATH_W */
+ #ifdef PATH_NFSSTAT
+- { PATH_NFSSTAT },
++ { const_cast<char *> (PATH_NFSSTAT) },
+ #endif /* PATH_NFSSTAT */
+ #ifdef PATH_VNSTAT
+- { PATH_VMSTAT },
+- { PATH_VMSTAT, "-i" },
+- { PATH_VMSTAT, "-s" },
++ { const_cast<char *> (PATH_VMSTAT) },
++ { const_cast<char *> (PATH_VMSTAT), const_cast<char *> ("-i") },
++ { const_cast<char *> (PATH_VMSTAT), const_cast<char *> ("-s") },
+ #endif /* PATH_VNSTAT */
+ #ifdef PATH_IOSTAT
+ #if defined (__linux__) || defined (__osf__)
+- { PATH_IOSTAT },
++ { const_cast<char *> (PATH_IOSTAT) },
+ #else /* not linux or osf */
+- { PATH_IOSTAT, "-I" },
++ { const_cast<char *> (PATH_IOSTAT), const_cast<char *> ("-I") },
+ #endif /* not linux or osf */
+ #endif /* PATH_IOSTAT */
+ #ifdef PATH_LSOF
+- { PATH_LSOF, "-bwn",
++ { const_cast<char *> (PATH_LSOF), const_cast<char *> ("-bwn"),
+ # ifdef LSOF_DEVCACHE
+- "-Di"
++ const_cast<char *> ("-Di")
+ # endif /* LSOF_DEVCACHE */
+ },
+ #else /* no lsof */
+ # ifdef PATH_FSTAT
+- { PATH_FSTAT },
++ { const_cast<char *> (PATH_FSTAT) },
+ # endif /* PATH_FSTAT */
+ # ifdef PATH_PSTAT
+- { PATH_PSTAT, "-f" },
++ { const_cast<char *> (PATH_PSTAT), const_cast<char *> ("-f") },
+ # endif /* PATH_PSTAT */
+ #endif /* no lsof */
+ #ifdef PATH_PSTAT
+- { PATH_PSTAT, "-t" },
++ { const_cast<char *> (PATH_PSTAT), const_cast<char *> ("-t") },
+ # if defined (__OpenBSD__) || defined (__NetBSD__) || defined (__FreeBSD__)
+- { PATH_PSTAT, "-v" },
++ { const_cast<char *> (PATH_PSTAT), const_cast<char *> ("-v") },
+ # endif /* open/net/freebsd */
+ #endif /* PATH_PSTAT */
+ #ifdef PATH_NFSSTAT
+- { PATH_NFSSTAT },
++ { const_cast<char *> (PATH_NFSSTAT) },
+ #endif /* PATH_NFSSTAT */
+ #if 0
+- { PATH_RUP },
+- { PATH_RUSERS, "-l" },
++ { const_cast<char *> (PATH_RUP) },
++ { const_cast<char *> (PATH_RUSERS), const_cast<char *> ("-l") },
+ #endif
+ { NULL }
+ };
diff --git a/security/sfs/files/patch-rex_chan.C b/security/sfs/files/patch-rex_chan.C
new file mode 100644
index 000000000000..686a1f96d3d3
--- /dev/null
+++ b/security/sfs/files/patch-rex_chan.C
@@ -0,0 +1,15 @@
+--- rex/chan.C.orig 2007-09-15 19:54:59.000000000 -0400
++++ rex/chan.C 2007-09-15 19:55:32.000000000 -0400
+@@ -366,10 +366,10 @@
+ av.push_back (default_shell);
+ else {
+ warn ("SHELL not set, reverting to sh\n");
+- av.push_back ("sh");
++ av.push_back (const_cast<char *> ("sh"));
+ }
+ if (argp->av.size () == 1)
+- av.push_back ("-i");
++ av.push_back (const_cast<char *> ("-i"));
+ }
+ else
+ av.push_back (const_cast<char *> (argp->av[0].cstr ()));
diff --git a/security/sfs/files/patch-rex_rex.C b/security/sfs/files/patch-rex_rex.C
new file mode 100644
index 000000000000..fe24d58ed631
--- /dev/null
+++ b/security/sfs/files/patch-rex_rex.C
@@ -0,0 +1,20 @@
+--- rex/rex.C.orig 2002-11-19 14:58:44.000000000 -0500
++++ rex/rex.C 2007-09-15 19:48:38.000000000 -0400
+@@ -746,7 +746,7 @@
+ vec<str> cmd2vec (str cmdstr) {
+ char *cmd = const_cast<char *> (cmdstr.cstr ());
+ vec<str> cmdvec;
+- char *word, *sep = "\t ";
++ char *word, *sep = const_cast<char *> ("\t ");
+ for (word = strtok(cmd, sep); word; word = strtok(NULL, sep))
+ cmdvec.push_back (word);
+ return cmdvec;
+@@ -962,7 +962,7 @@
+ main (int argc, char **argv)
+ {
+ setprogname (argv[0]);
+- putenv ("POSIXLY_CORRECT=1"); // Prevents Linux from reordering options
++ putenv (const_cast<char *> ("POSIXLY_CORRECT=1")); // Prevents Linux from reordering options
+ sfsconst_init ();
+
+ int ch;
diff --git a/security/sfs/files/patch-rpcc_rpcc.C b/security/sfs/files/patch-rpcc_rpcc.C
new file mode 100644
index 000000000000..11e1886eeb7e
--- /dev/null
+++ b/security/sfs/files/patch-rpcc_rpcc.C
@@ -0,0 +1,29 @@
+--- rpcc/rpcc.C.orig 2002-11-17 16:42:10.000000000 -0500
++++ rpcc/rpcc.C 2007-09-15 17:04:18.000000000 -0400
+@@ -151,8 +151,8 @@
+ void (*fn) (str) = NULL;
+ int len;
+
+- av.push_back (PATH_CPP);
+- av.push_back ("-DRPCC");
++ av.push_back (const_cast<char *> (PATH_CPP));
++ av.push_back (const_cast<char *> ("-DRPCC"));
+ av.push_back (NULL);
+
+ for (an = 1; an < argc; an++) {
+@@ -196,13 +196,13 @@
+
+ switch (mode) {
+ case HEADER:
+- av[2] = "-DRPCC_H";
++ av[2] = const_cast<char *> ("-DRPCC_H");
+ fn = genheader;
+ if (!outfile)
+ outfile = strbuf ("%.*sh", len - 1, basename);
+ break;
+ case CFILE:
+- av[2] = "-DRPCC_C";
++ av[2] = const_cast<char *> ("-DRPCC_C");
+ fn = gencfile;
+ if (!outfile)
+ outfile = strbuf ("%.*sC", len - 1, basename);
diff --git a/security/sfs/files/patch-sfsmisc_suidgetfd.C b/security/sfs/files/patch-sfsmisc_suidgetfd.C
new file mode 100644
index 000000000000..c6a70e4c4f6c
--- /dev/null
+++ b/security/sfs/files/patch-sfsmisc_suidgetfd.C
@@ -0,0 +1,20 @@
+--- sfsmisc/suidgetfd.C.orig 2001-02-07 02:48:01.000000000 -0500
++++ sfsmisc/suidgetfd.C 2007-09-15 19:11:34.000000000 -0400
+@@ -42,7 +42,7 @@
+ close_on_exec (fds[0]);
+
+ str path = fix_exec_path ("suidconnect");
+- char *av[] = { "suidconnect", const_cast<char *> (prog.cstr ()), NULL };
++ char *av[] = { const_cast<char *> ("suidconnect"), const_cast<char *> (prog.cstr ()), NULL };
+ if (spawn (path, av, fds[1]) == -1) {
+ close (fds[0]);
+ close (fds[1]);
+@@ -64,7 +64,7 @@
+ close_on_exec (fds[0]);
+
+ str path = fix_exec_path ("suidconnect");
+- char *av[] = { "suidconnect", const_cast<char *> (prog.cstr ()), NULL };
++ char *av[] = { const_cast<char *> ("suidconnect"), const_cast<char *> (prog.cstr ()), NULL };
+ if (spawn (path, av, fds[1]) == -1)
+ fatal << path << ": " << strerror (errno) << "\n";
+ close (fds[1]);