Commit 1f83c9c6 authored by Mike Hibler's avatar Mike Hibler

First cut at FreeBSD 9.0 support.

Upgrade to perl 5.12 means no more "suidperl" (setuid perl scripts).
So we now have yet another little wrapper (security/runsuid.c) which
runs suid and whose sole function is to exec the perl script of the
same name in the /usr/testbed/suidbin directory. So a formerly setuid
perl script install now goes like:
  create /usr/testbed/sbin/mkproj as a symlink to /usr/testbed/libexec/runsuid
  install real mkproj perl script in /usr/testbed/suidbin/mkproj
When the setuid-wrapper is invoked under the name "mkproj" it execs
/usr/testbed/suidbin/mkproj. We could almost use sudo for this purpose
instead (see security/sudoers.in) but sudo loses one of the groups in
the group list.

/usr/include/utmp.h is gone in FreeBSD 9.0. In most places we nevered
needed it, but in the one case that did (tg source), it just used a
couple of the constants exposed (UT_*) and not the struct, so I just
hardwired values for the constants.

The usual tweakage to the install stuff to reflect yet another set of
packages!
parent 896cd407
......@@ -156,6 +156,7 @@ install-mkdirs:
-mkdir -p $(INSTALL_TOPDIR)/log/mysql
-mkdir -p $(INSTALL_TOPDIR)/etc
-mkdir -p $(INSTALL_TOPDIR)/www
-mkdir -p $(INSTALL_TOPDIR)/suidbin
-mkdir -p $(INSTALL_TOPDIR)/ssl
-chmod 770 $(INSTALL_TOPDIR)/ssl
ifeq ($(STANDALONE_CLEARINGHOUSE),0)
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# All rights reserved.
# Get rid of a bunch of nasty built-in implicit rules,
......@@ -36,21 +36,43 @@ $(INSTALL_ETCDIR)/%: %
-mkdir -p $(INSTALL_ETCDIR)
$(INSTALL_DATA) $< $@
$(addprefix $(INSTALL_SBINDIR)/, $(SETUID_SBIN_SCRIPTS)): $(INSTALL_SBINDIR)/%: %
$(addprefix $(INSTALL_SBINDIR)/, $(SETUID_SBIN_PROGS)): $(INSTALL_SBINDIR)/%: %
echo "Installing (setuid) $<"
-mkdir -p $(INSTALL_SBINDIR)
$(SUDO) $(INSTALL) -o root -m 4755 $< $@
$(addprefix $(INSTALL_BINDIR)/, $(SETUID_BIN_SCRIPTS)): $(INSTALL_BINDIR)/%: %
$(addprefix $(INSTALL_BINDIR)/, $(SETUID_BIN_PROGS)): $(INSTALL_BINDIR)/%: %
echo "Installing (setuid) $<"
-mkdir -p $(INSTALL_BINDIR)
$(SUDO) $(INSTALL) -o root -m 4755 $< $@
$(addprefix $(INSTALL_LIBEXECDIR)/, $(SETUID_LIBX_SCRIPTS)): $(INSTALL_LIBEXECDIR)/%: %
$(addprefix $(INSTALL_LIBEXECDIR)/, $(SETUID_LIBX_PROGS)): $(INSTALL_LIBEXECDIR)/%: %
echo "Installing (setuid) $<"
-mkdir -p $(INSTALL_LIBEXECDIR)
$(SUDO) $(INSTALL) -o root -m 4755 $< $@
$(addprefix $(INSTALL_SBINDIR)/, $(SETUID_SBIN_SCRIPTS)): $(INSTALL_SBINDIR)/%: % $(INSTALL_SUIDDIR)/%
echo "Installing (link to wrapper) $<"
-mkdir -p $(INSTALL_SBINDIR)
-rm -f $@
ln -s $(INSTALL_LIBEXECDIR)/runsuid $@
$(addprefix $(INSTALL_BINDIR)/, $(SETUID_BIN_SCRIPTS)): $(INSTALL_BINDIR)/%: % $(INSTALL_SUIDDIR)/%
echo "Installing (link to wrapper) $<"
-mkdir -p $(INSTALL_BINDIR)
-rm -f $@
ln -s $(INSTALL_LIBEXECDIR)/runsuid $@
$(addprefix $(INSTALL_LIBEXECDIR)/, $(SETUID_LIBX_SCRIPTS)): $(INSTALL_LIBEXECDIR)/%: % $(INSTALL_SUIDDIR)/%
echo "Installing (link to wrapper) $<"
-mkdir -p $(INSTALL_LIBEXECDIR)
-rm -f $@
ln -s $(INSTALL_LIBEXECDIR)/runsuid $@
$(INSTALL_SUIDDIR)/%: %
echo "Installing (real script) $<"
-mkdir -p $(INSTALL_SUIDDIR)
$(INSTALL_PROGRAM) $< $@
CFLAGS += $(LOCALCFLAGS)
......
......@@ -62,6 +62,7 @@ INSTALL_LIBEXECDIR = @libexecdir@
INSTALL_ETCDIR = @sysconfdir@
INSTALL_INCDIR = @includedir@
INSTALL_WWWDIR = @exec_prefix@/www
INSTALL_SUIDDIR = @exec_prefix@/suidbin
INSTALL_RCDIR = @INSTALL_RCDIR@
INSTALL_APACHE_CONFIG = @INSTALL_APACHE_CONFIG@
......
diff -ru dist/tg2.0/src/tg/config.h tg2.0/src/tg/config.h
--- dist/tg2.0/src/tg/config.h Thu Jan 24 16:30:09 2002
+++ tg2.0/src/tg/config.h Wed Aug 25 14:37:32 2004
--- dist/tg2.0/src/tg/config.h 2002-01-24 16:30:09.000000000 -0700
+++ tg2.0/src/tg/config.h 2012-03-21 16:54:20.000000000 -0600
@@ -14,7 +14,7 @@
/* Maximum packet buffer size. */
......@@ -11,9 +11,28 @@ diff -ru dist/tg2.0/src/tg/config.h tg2.0/src/tg/config.h
/* Maximum value from random-number generator. */
diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
--- dist/tg2.0/src/tg/log.c Thu Jan 24 16:30:09 2002
+++ tg2.0/src/tg/log.c Wed Aug 25 14:37:32 2004
@@ -268,6 +268,11 @@
--- dist/tg2.0/src/tg/log.c 2002-01-24 16:30:09.000000000 -0700
+++ tg2.0/src/tg/log.c 2012-03-21 16:58:39.000000000 -0600
@@ -23,7 +23,6 @@
#include <sys/utsname.h>
#include <sys/param.h>
#include <errno.h>
-#include <utmp.h>
#include "config.h"
#include "distribution.h"
@@ -31,6 +30,10 @@
#include "decode.h"
#include "log.h"
+/* XXX utmp.h is defunct */
+#define UT_NAMESIZE 32
+#define UT_HOSTSIZE 256
+
/* Type definitions local to this file. */
#define FPRINTF (void) fprintf
@@ -268,6 +271,11 @@
char *cp = buf;
char ctl;
......@@ -25,7 +44,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
/* Encode record type. */
*cp++ = LOGTYPE_ACCEPT;
@@ -326,6 +331,11 @@
@@ -326,6 +334,11 @@
char *cp = buf;
char ctl;
......@@ -37,7 +56,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
/* Encode record type. */
*cp++ = LOGTYPE_ERROR;
@@ -391,6 +401,11 @@
@@ -391,6 +404,11 @@
char *cp = buf;
char ctl;
......@@ -49,7 +68,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
/* Encode record type. */
*cp++ = LOGTYPE_RX;
@@ -459,6 +474,11 @@
@@ -459,6 +477,11 @@
char *cp = buf;
char ctl;
......@@ -61,7 +80,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
/* Encode record type. */
*cp++ = LOGTYPE_SETUP;
@@ -510,6 +530,11 @@
@@ -510,6 +533,11 @@
char *cp = buf;
char ctl;
......@@ -73,7 +92,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
/* Encode record type. */
*cp++ = LOGTYPE_TEARDOWN;
@@ -568,6 +593,11 @@
@@ -568,6 +596,11 @@
char *cp = buf;
char ctl;
......@@ -85,7 +104,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
/* Encode record type. */
*cp++ = LOGTYPE_TX;
@@ -717,6 +747,10 @@
@@ -717,6 +750,10 @@
extern FILE *log_fp;
......@@ -97,8 +116,8 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
(void) fclose (log_fp);
diff -ru dist/tg2.0/src/tg/prot_dgram.c tg2.0/src/tg/prot_dgram.c
--- dist/tg2.0/src/tg/prot_dgram.c Thu Jan 24 16:30:10 2002
+++ tg2.0/src/tg/prot_dgram.c Wed Aug 25 14:37:32 2004
--- dist/tg2.0/src/tg/prot_dgram.c 2002-01-24 16:30:10.000000000 -0700
+++ tg2.0/src/tg/prot_dgram.c 2012-03-21 16:54:20.000000000 -0600
@@ -198,6 +198,22 @@
for (;;)
{
......@@ -167,8 +186,8 @@ diff -ru dist/tg2.0/src/tg/prot_dgram.c tg2.0/src/tg/prot_dgram.c
}
diff -ru dist/tg2.0/src/tg/prot_stream.c tg2.0/src/tg/prot_stream.c
--- dist/tg2.0/src/tg/prot_stream.c Thu Jan 24 16:30:10 2002
+++ tg2.0/src/tg/prot_stream.c Wed Aug 25 14:37:32 2004
--- dist/tg2.0/src/tg/prot_stream.c 2002-01-24 16:30:10.000000000 -0700
+++ tg2.0/src/tg/prot_stream.c 2012-03-21 16:54:20.000000000 -0600
@@ -147,6 +147,22 @@
for (;;)
{
......@@ -241,8 +260,8 @@ diff -ru dist/tg2.0/src/tg/prot_stream.c tg2.0/src/tg/prot_stream.c
return (result);
}
diff -ru dist/tg2.0/src/tg/prot_tcp.c tg2.0/src/tg/prot_tcp.c
--- dist/tg2.0/src/tg/prot_tcp.c Thu Jan 24 16:30:10 2002
+++ tg2.0/src/tg/prot_tcp.c Wed Aug 25 14:37:32 2004
--- dist/tg2.0/src/tg/prot_tcp.c 2002-01-24 16:30:10.000000000 -0700
+++ tg2.0/src/tg/prot_tcp.c 2012-03-21 16:54:20.000000000 -0600
@@ -93,6 +93,12 @@
#endif /* QOSDEBUG */
......@@ -312,8 +331,8 @@ diff -ru dist/tg2.0/src/tg/prot_tcp.c tg2.0/src/tg/prot_tcp.c
{
(void)close(sfd);
diff -ru dist/tg2.0/src/tg/prot_test.c tg2.0/src/tg/prot_test.c
--- dist/tg2.0/src/tg/prot_test.c Thu Jan 24 16:30:10 2002
+++ tg2.0/src/tg/prot_test.c Wed Aug 25 14:37:32 2004
--- dist/tg2.0/src/tg/prot_test.c 2002-01-24 16:30:10.000000000 -0700
+++ tg2.0/src/tg/prot_test.c 2012-03-21 16:54:20.000000000 -0600
@@ -447,6 +447,7 @@
if (!test_get_packets(prtab, fd, endtout))
......@@ -323,8 +342,8 @@ diff -ru dist/tg2.0/src/tg/prot_test.c tg2.0/src/tg/prot_test.c
}
else
diff -ru dist/tg2.0/src/tg/prot_udp.c tg2.0/src/tg/prot_udp.c
--- dist/tg2.0/src/tg/prot_udp.c Thu Jan 24 16:30:10 2002
+++ tg2.0/src/tg/prot_udp.c Wed Aug 25 14:37:32 2004
--- dist/tg2.0/src/tg/prot_udp.c 2002-01-24 16:30:10.000000000 -0700
+++ tg2.0/src/tg/prot_udp.c 2012-03-21 16:54:20.000000000 -0600
@@ -47,7 +47,7 @@
/* Apply QOS parameters to an existing fd. */
......@@ -380,8 +399,8 @@ diff -ru dist/tg2.0/src/tg/prot_udp.c tg2.0/src/tg/prot_udp.c
{
(void)close(sfd);
diff -ru dist/tg2.0/src/tg/tg.y tg2.0/src/tg/tg.y
--- dist/tg2.0/src/tg/tg.y Thu Jan 24 16:30:10 2002
+++ tg2.0/src/tg/tg.y Tue Oct 5 16:53:50 2004
--- dist/tg2.0/src/tg/tg.y 2002-01-24 16:30:10.000000000 -0700
+++ tg2.0/src/tg/tg.y 2012-03-21 16:54:20.000000000 -0600
@@ -133,7 +133,11 @@
char *version = "2.0"; /* TG program version. */
char *ofile = NULL;
......
......@@ -528,7 +528,7 @@ sub doboot()
$emulabconfig{OPS_PKG} = "emulab-ops-3.1";
$emulabconfig{BOSS_PKG} = "emulab-boss-3.1";
}
elsif ($FBSD_VERSION >= 8.2) {
elsif ($FBSD_VERSION >= 8.2 && $FBSD_VERSION < 9.0) {
$emulabconfig{FS_PKG_DIR} = "/share/freebsd/8.2/packages";
$emulabconfig{FS_PKG_DIR} .= ".elvincompat"
if ($emulabconfig{"CONFIG_ELVIN"});
......@@ -540,6 +540,18 @@ sub doboot()
$emulabconfig{PACKAGE_TARBALL} = "FreeBSD-8.2-packages.tar.gz";
$emulabconfig{PGENI_PKG} = "emulab-protogeni-2.0";
}
elsif ($FBSD_VERSION >= 9.0) {
$emulabconfig{FS_PKG_DIR} = "/share/freebsd/9.0/packages";
$emulabconfig{FS_PKG_DIR} .= ".elvincompat"
if ($emulabconfig{"CONFIG_ELVIN"});
$emulabconfig{OPS_PKG_DIR} = $emulabconfig{FS_PKG_DIR};
$emulabconfig{BOSS_PKG_DIR} = $emulabconfig{FS_PKG_DIR};
$emulabconfig{FS_PKG} = "emulab-fs-5.0";
$emulabconfig{OPS_PKG} = "emulab-ops-5.0";
$emulabconfig{BOSS_PKG} = "emulab-boss-5.0";
$emulabconfig{PACKAGE_TARBALL} = "FreeBSD-9.0-packages.tar.gz";
$emulabconfig{PGENI_PKG} = "emulab-protogeni-2.0";
}
if (exists($emulabconfig{"PACKAGE_TARBALL"})) {
$emulabconfig{FS_PKG_DIR} = "$TBDIR/packages";
$emulabconfig{OPS_PKG_DIR} = $emulabconfig{FS_PKG_DIR};
......
......@@ -40,7 +40,11 @@ $BOSS_PORT = "emulab-boss-1.8";
$OPS_PORT = "emulab-ops-1.4";
$FS_PORT = "emulab-fs-1.4";
if ($FBSD_MAJOR > 4) {
if ($FBSD_MAJOR > 7) {
if ($FBSD_MAJOR > 8) {
$BOSS_PORT = "emulab-boss-5.0";
$OPS_PORT = "emulab-ops-5.0";
$FS_PORT = "emulab-fs-5.0";
} elsif ($FBSD_MAJOR > 7) {
$BOSS_PORT = "emulab-boss-4.0";
$OPS_PORT = "emulab-ops-4.0";
$FS_PORT = "emulab-fs-4.0";
......@@ -68,10 +72,11 @@ $PHP_VERSION = 4;
$PHP_PORT = "php4-extensions-1.0";
if ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
$PHP_VERSION = 5;
if ($FBSD_MAJOR > 7) {
if ($FBSD_MAJOR > 8) {
$PHP_PORT = "php5-extensions-1.6";
} elsif ($FBSD_MAJOR > 7) {
$PHP_PORT = "php5-extensions-1.4";
}
else {
} else {
$PHP_PORT = "php5-extensions-1.3";
}
}
......@@ -94,7 +99,10 @@ $SELFLOAD_PATCH = "$main::TOP_SRCDIR/patches/SelfLoader.patch";
#
$PYM2_PKG = "py25-m2crypto-0.19.1";
$PY_VER = "python2.5";
if ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
if ($FBSD_MAJOR > 8) {
$PYM2_PKG = "py27-m2crypto-0.21.1";
$PY_VER = "python2.7";
} elsif ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
$PYM2_PKG = "py26-m2crypto-0.20";
$PY_VER = "python2.6";
}
......
......@@ -5,6 +5,7 @@ use strict;
use libinstall;
use installvars;
my $PERL = "/usr/bin/perl";
my $SUIDPERL = "/usr/bin/suidperl";
sub Install($$$)
......@@ -16,6 +17,17 @@ sub Install($$$)
if ($isupdate);
Phase "perl", "Checking for setuid perl", sub {
#
# See if suidperl is supported. Perl 5.12 and beyond don't have it.
#
if (-x $PERL) {
my $vstr = `$PERL -v | grep version`;
if ($vstr =~ /This is perl 5, version (\d+),/) {
if (int($1) >= 12) {
PhaseSkip("Not used");
}
}
}
Phase "sperl", "Checking for sperl", sub {
if (ExecQuiet("$PKG_INFO -L -x perl-5 | fgrep -q -s sperl") == 0) {
PhaseSkip("Perl is okay");
......
......@@ -24,7 +24,9 @@ MAINTAINER= testbed-ops@flux.utah.edu
# We must make sure PERL is built with this.
#
.MAKEFLAGS+= ENABLE_SUIDPERL=yes
.if (${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0")
.if ${PORTVERSION} == "5.0"
.MAKEFLAGS+= PERL_VERSION=5.12.4 PERL_VER=5.12.4 PERL_ARCH=mach
.elif (${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0")
.MAKEFLAGS+= PERL_VERSION=5.10.1 PERL_VER=5.10.1 PERL_ARCH=mach
.elif ${PORTVERSION} == "3.0"
.MAKEFLAGS+= PERL_VERSION=5.10.0 PERL_VER=5.10.0 PERL_ARCH=mach
......@@ -48,7 +50,7 @@ MAINTAINER= testbed-ops@flux.utah.edu
# agrees with what is in the emulab-ops and emulab-php* metaports.
#
.MAKEFLAGS+= -DWITH_APACHE
.if ${PORTVERSION} == "4.0"
.if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
.MAKEFLAGS+= APACHE_PORT=www/apache22
.MAKEFLAGS+= WITH_SUEXEC=yes
.else
......@@ -73,7 +75,7 @@ MAINTAINER= testbed-ops@flux.utah.edu
.if (${PORTVERSION} == "1.7" || ${PORTVERSION} == "2.0")
BUILD_DEPENDS= \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50
.elif (${PORTVERSION} == "4.0")
.elif (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
# back to a standard p5-DBD-mysql50 install
BUILD_DEPENDS= \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50 \
......@@ -97,7 +99,7 @@ LIB_DEPENDS+= lthread.[236]:${PORTSDIR}/devel/linuxthreads
LIB_DEPENDS+= xerces-c.27:${PORTSDIR}/textproc/xerces-c2
.endif
.if ${OSMAJOR} >= 7
LIB_DEPENDS+= xmlrpc.9:${PORTSDIR}/net/xmlrpc-c
LIB_DEPENDS+= xmlrpc:${PORTSDIR}/net/xmlrpc-c
.endif
#
......@@ -148,7 +150,7 @@ RUN_DEPENDS+= \
mysqlhotcopy:${PORTSDIR}/databases/mysql50-scripts
# apache related ports
.if ${PORTVERSION} == "4.0"
.if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
RUN_DEPENDS+= \
${LOCALBASE}/libexec/apache22/mod_ssl.so:${PORTSDIR}/${APACHE_PORT} \
${LOCALBASE}/libexec/apache22/mod_fastcgi.so:${PORTSDIR}/www/mod_fastcgi
......@@ -159,7 +161,8 @@ RUN_DEPENDS+= \
.endif
# m2crypto port
.if (${PORTVERSION} == "3.0" || ${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0")
.if (${PORTVERSION} == "3.0" || ${PORTVERSION} == "3.1" || \
${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
# must handle patching of m2crypto when the port is built
RUN_DEPENDS+= \
${PYTHON_PKGNAMEPREFIX}m2crypto>0:${PORTSDIR}/misc/emulab-py-m2crypto
......@@ -170,7 +173,7 @@ RUN_DEPENDS+= \
.endif
# dhcpd port
.if ${PORTVERSION} == "4.0"
.if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
RUN_DEPENDS+= \
dhcpd:${PORTSDIR}/net/isc-dhcp42-server
.elif (${PORTVERSION} == "3.1" || ${PORTVERSION} == "3.0")
......@@ -182,7 +185,7 @@ RUN_DEPENDS+= \
.endif
# misc. old vs. new port stuff
.if ${PORTVERSION} == "4.0"
.if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
RUN_DEPENDS+= \
autoconf:${PORTSDIR}/devel/autoconf \
libtool:${PORTSDIR}/devel/libtool
......
......@@ -7,6 +7,9 @@
OSMAJOR!= /usr/bin/uname -r | /usr/bin/sed -e 's/\..*//'
OSMINOR!= /usr/bin/uname -r | /usr/bin/sed -e 's/[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/'
.if ${OSMAJOR} > 8
EMULAB_PORTVERSION= 5.0
.else
.if ${OSMAJOR} > 7
EMULAB_PORTVERSION= 4.0
.else
......@@ -28,12 +31,20 @@ EMULAB_PORTVERSION= 1.7
. endif
. endif
.endif
.endif
#
# Select PHP and Apache versions
# Fix up some port diffs
#
.if ${EMULAB_PORTVERSION} == "4.0"
.if ${EMULAB_PORTVERSION} == "5.0"
PHP_VER= 5
PERL_VER= 5.12.4
PYTHON_DEFAULT_VERSION=python2.7
APACHE_PORT= www/apache22
BOOST_PORT= devel/boost-all
P5SNMP_PORT= misc/p5-SNMP
.elif ${EMULAB_PORTVERSION} == "4.0"
PHP_VER= 5
PERL_VER= 5.10.1
APACHE_PORT= www/apache22
......
......@@ -18,21 +18,13 @@ COMMENT= "Meta-port for an Emulab fs node"
MAINTAINER= testbed-ops@flux.utah.edu
#
# Select PHP and Apache versions
# Fix up some port diffs
#
.if ${PORTVERSION} == "3.1"
PHP_VER= 5
.else
PHP_VER= 4
.endif
#
# We must make sure PERL is built with this.
#
.MAKEFLAGS+= ENABLE_SUIDPERL=yes
.if (${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0")
.if ${PORTVERSION} == "5.0"
.MAKEFLAGS+= PERL_VERSION=5.12.4 PERL_VER=5.12.4 PERL_ARCH=mach
.elif (${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0")
.MAKEFLAGS+= PERL_VERSION=5.10.1 PERL_VER=5.10.1 PERL_ARCH=mach
.elif ${PORTVERSION} == "3.0"
.MAKEFLAGS+= PERL_VERSION=5.10.0 PERL_VER=5.10.0 PERL_ARCH=mach
......@@ -56,7 +48,7 @@ RUN_DEPENDS= gmake:${PORTSDIR}/devel/gmake \
sudo:${PORTSDIR}/security/sudo \
rsync:${PORTSDIR}/net/rsync \
.if ${PORTVERSION} == "4.0"
.if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
RUN_DEPENDS+= \
smbd:${PORTSDIR}/net/samba36
.else
......
......@@ -28,7 +28,9 @@ MAINTAINER= testbed-ops@flux.utah.edu
# We must make sure PERL is built with this.
#
.MAKEFLAGS+= ENABLE_SUIDPERL=yes
.if (${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0")
.if ${PORTVERSION} == "5.0"
.MAKEFLAGS+= PERL_VERSION=5.12.4 PERL_VER=5.12.4 PERL_ARCH=mach
.elif (${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0")
.MAKEFLAGS+= PERL_VERSION=5.10.1 PERL_VER=5.10.1 PERL_ARCH=mach
.elif ${PORTVERSION} == "3.0"
.MAKEFLAGS+= PERL_VERSION=5.10.0 PERL_VER=5.10.0 PERL_ARCH=mach
......@@ -52,7 +54,7 @@ MAINTAINER= testbed-ops@flux.utah.edu
# agrees with what is in the emulab-ops and emulab-php* metaports.
#
.MAKEFLAGS+= -DWITH_APACHE
.if ${PORTVERSION} == "4.0"
.if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
.MAKEFLAGS+= APACHE_PORT=www/apache22
.MAKEFLAGS+= WITH_SUEXEC=yes
.else
......@@ -77,7 +79,7 @@ MAINTAINER= testbed-ops@flux.utah.edu
.if (${PORTVERSION} == "1.4" || ${PORTVERSION} == "2.0")
BUILD_DEPENDS= \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50
.elif (${PORTVERSION} == "4.0")
.elif (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
# back to a standard p5-DBD-mysql50 install
BUILD_DEPENDS= \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50 \
......@@ -98,7 +100,7 @@ LIB_DEPENDS+= mhash.2:${PORTSDIR}/security/mhash \
mysqlclient.15:${PORTSDIR}/databases/mysql50-client
.endif
.if ${OSMAJOR} >= 7
LIB_DEPENDS+= xmlrpc.9:${PORTSDIR}/net/xmlrpc-c
LIB_DEPENDS+= xmlrpc:${PORTSDIR}/net/xmlrpc-c
.endif
.if defined(ELVIN_COMPAT)
......@@ -126,7 +128,7 @@ RUN_DEPENDS+= ${LOCALBASE}/libexec/elvind:${PORTSDIR}/misc/elvind
.endif
# apache related ports
.if ${PORTVERSION} == "4.0"
.if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
RUN_DEPENDS+= \
${LOCALBASE}/libexec/apache22/mod_ssl.so:${PORTSDIR}/${APACHE_PORT} \
${LOCALBASE}/libexec/apache22/mod_fastcgi.so:${PORTSDIR}/www/mod_fastcgi
......@@ -137,7 +139,8 @@ RUN_DEPENDS+= \
.endif
# m2crypto port
.if (${PORTVERSION} == "3.0" || ${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0")
.if (${PORTVERSION} == "3.0" || ${PORTVERSION} == "3.1" || \
${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
# must handle patching of m2crypto when the port is built
# also needs swig to install!
RUN_DEPENDS+= \
......@@ -150,7 +153,7 @@ RUN_DEPENDS+= \
.endif
# misc. old vs. new port stuff
.if ${PORTVERSION} == "4.0"
.if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
RUN_DEPENDS+= \
autoconf:${PORTSDIR}/devel/autoconf \
libtool:${PORTSDIR}/devel/libtool
......
......@@ -2,38 +2,27 @@
# Date created: 21 July 2009
# Whom: stoller@flux.utah.edu
# Need the major version number to figure out to do.
OSMAJOR!= /usr/bin/uname -r | /usr/bin/sed -e 's/\..*//'
OSMINOR!= /usr/bin/uname -r | /usr/bin/sed -e 's/[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/'
.include "../emulab-boss/Makefile.emulab"
PORTNAME= emulab-protogeni
PORTVERSION= 1.0
.if ${OSMAJOR} >= 8
# XXX deal with out-of-sync-edness of meta ports
.if ${EMULAB_PORTVERSION} == "5.0"
PORTVERSION= 3.0
.elif ${EMULAB_PORTVERSION} == "4.0"
PORTVERSION= 2.0
.else
.if ${OSMAJOR} >= 7
.if ${OSMINOR} >= 3
PORTVERSION= 1.1
.endif
.endif
.endif
PORTNAME= emulab-protogeni
CATEGORIES= misc
MASTER_SITES= #none
DISTFILES= #none
EXTRACT_ONLY= #none
COMMENT= "Meta-port for a protogeni site"
MAINTAINER= stoller@cs.utah.edu
MAINTAINER= testbed-ops@flux.utah.edu
# XXX this crap should not be needed!
.if ${PORTVERSION} != "1.0"
PHP_VER= 5
PERL_VER= 5.10.1
.MAKEFLAGS+= WITH_OPENSSL_BASE=yes
.else
PHP_VER= 4
.MAKEFLAGS+= WITH_OPENSSL_PORT=yes
.endif
#
# We set this so that the mysql server port doesn't do name resolution
......@@ -56,7 +45,7 @@ PHP_VER= 4
# Various ports need to agree on what version of apache. Make sure this
# agrees with what is in the emulab-ops and emulab-php4 metaports.
#
.if ${PORTVERSION} == "2.0"
.if ${PORTVERSION} != "1.1"
.MAKEFLAGS+= APACHE_PORT=www/apache22
.else
.MAKEFLAGS+= APACHE_PORT=www/apache13-modssl
......
......@@ -4,3 +4,5 @@ SIZE (python/M2Crypto-0.19.1.tar.gz) = 390933
MD5 (python/M2Crypto-0.20.tar.gz) = 43a4d958a6c892a37ca02ffcc650b66b
SHA256 (python/M2Crypto-0.20.tar.gz) = bec1a55cd5e4d88bb87f066c83a0ad42391e0e436b2d6b1edb7259c918e4b55f
SIZE (python/M2Crypto-0.20.tar.gz) = 412877
SHA256 (python/M2Crypto-0.21.1.tar.gz) = 25b94498505c2d800ee465db0cc1aff097b1615adc3ac042a1c85ceca264fc0a
SIZE (python/M2Crypto-0.21.1.tar.gz) = 413563
......@@ -9,7 +9,7 @@ PORTNAME= tftp-hpa
PORTVERSION= 0.48
#CATEGORIES= net
CATEGORIES= misc
MASTER_SITES= ftp://www.kernel.org/pub/software/network/tftp/
MASTER_SITES= http://www.emulab.net/distributions/
PKGNAMEPREFIX= emulab-
DISTNAME= ${PORTNAME}-${PORTVERSION}
......
#
# This port has been "expired" from the official FreeBSD ports tree.
# Note: removed "snmpnetstat" from BIN= as it causes install to fail.
# I don't think we need it so I didn't track the failure down.
#
# New ports collection makefile for: ucd-snmp
# Date created: 26 June 1996
......@@ -84,7 +86,7 @@ MLINKS= snmptrap.1 snmpinform.1 \
snmp_sess_api.3 snmp_sess_send.3 \
snmp_sess_api.3 snmp_sess_session.3 \
snmp_sess_api.3 snmp_sess_timeout.3
BIN= snmpbulkwalk snmpget snmpgetnext snmpnetstat snmpset \
BIN= snmpbulkwalk snmpget snmpgetnext snmpset \
snmpstatus snmptest snmptranslate snmptrap snmpwalk
SBIN= snmpd snmptrapd
......
--- agent/agent_read_config.c.orig 2003-05-06 09:09:24.000000000 -0600
+++ agent/agent_read_config.c 2012-03-19 09:18:30.000000000 -0600
@@ -5,6 +5,9 @@
#include <config.h>
#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
--- agent/snmp_vars.c.orig 2002-08-29 02:35:51.000000000 -0600
+++ agent/snmp_vars.c 2012-03-19 09:18:12.000000000 -0600
@@ -41,6 +41,9 @@
#include <stdlib.h>
#endif
#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
#include <stdio.h>
#include <fcntl.h>
......@@ -7,7 +7,7 @@
PORTSDIR=${PORTSDIR:-/usr/ports}
PORTSUBDIR=misc
SRCDIR=`dirname $0`
PORTS="emulab-boss emulab-fs emulab-ops emulab-tftp-hpa p5-GD-old p5-DBD-mysql50-old ulsshxmlrpcpp emulab-iperf emulab-php4 emulab-php5 emulab-py-m2crypto emulab-mailman emulab-pubsub emulab-clrhouse emulab-protogeni p5-IO-EventMux p5-IO-EventMux-Socket-MsgHdr p5-Privileges-Drop p5-RPC-Async p5-SNMP"
PORTS="emulab-boss emulab-fs emulab-ops emulab-tftp-hpa net-snmp4 p5-GD-old p5-DBD-mysql50-old ulsshxmlrpcpp emulab-iperf emulab-php4 emulab-php5 emulab-py-m2crypto emulab-mailman emulab-pubsub emulab-clrhouse emulab-protogeni p5-IO-EventMux p5-IO-EventMux-Socket-MsgHdr p5-Privileges-Drop p5-RPC-Async p5-SNMP"
EPORTS="elvind libelvin emulab-pubsub-elvincompat"
EPATCH=ports-elvin.patch
......
......@@ -3,7 +3,7 @@
# Whom: ricci@cs.utah.edu
PORTNAME= ulsshxmlrpcpp
PORTVERSION= 0.1.2
PORTVERSION= 0.1.3
CATEGORIES= misc
MASTER_SITES= http://www.emulab.net/distributions/
......
SHA256 (ulsshxmlrpcpp-0.1.2.tar.gz) = c88d693b4c5f3b9e1f71051dacce8da95ed259aaf7219626cc7145262dc672d2
MD5 (ulsshxmlrpcpp-0.1.2.tar.gz) = 60f9e02c35bba1965608c61168244243
SIZE (ulsshxmlrpcpp-0.1.2.tar.gz) = 866631
SHA256 (ulsshxmlrpcpp-0.1.3.tar.gz) = c6385a86c8ba55b0b62870cc360a4eab0e15c7d2f73d99f6b014d2e1e0324f41
MD5 (ulsshxmlrpcpp-0.1.3.tar.gz) = 79ce3f52b7a452427b600ec63ef37a62
SIZE (ulsshxmlrpcpp-0.1.2.tar.gz) = 871357
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002, 2006 University of Utah and the Flux Group.
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# All rights reserved.
#
SRCDIR = @srcdir@
......@@ -12,9 +12,12 @@ include $(OBJDIR)/Makeconf
all: ipod apod
# These binaries installed setuid, with sudo.
SETUID_SBIN_PROGS = ipod
# These scripts installed setuid, with sudo.
SETUID_BIN_SCRIPTS =
SETUID_SBIN_SCRIPTS = ipod apod
SETUID_SBIN_SCRIPTS = apod
SETUID_LIBX_SCRIPTS =
include $(TESTBED_SRCDIR)/GNUmakerules
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -11,13 +11,13 @@ SUBDIR = security
include $(OBJDIR)/Makeconf
BINS = suexec
BINS = suexec runsuid
SBINS = genlastlog lastlog_daemon
# These scripts installed setuid, with sudo.
SETUID_BIN_SCRIPTS =
SETUID_SBIN_SCRIPTS =
SETUID_LIBX_SCRIPTS = suexec
SETUID_SBIN_SCRIPTS =
SETUID_LIBX_PROGS = suexec runsuid
#
# Force dependencies on the scripts so that they will be rerun through
......@@ -36,6 +36,9 @@ suexec: suexec.c suexec.h
-DSAFE_PATH='"$(prefix)/libexec:/usr/local/bin:/usr/bin:/bin"'\
-o suexec $<
runsuid: runsuid.c ${OBJDIR}/config.h
$(CC) $(CFLAGS) -I${OBJDIR} -o runsuid $<
genlastlog: genlastlog.c
$(CC) $(CFLAGS) -I/usr/local/include -I$(TESTBED_LIBSRCDIR)/libtb \
-DTBDBNAME='"$(TBDBNAME)"' \
......
#!/usr/bin/perl
#
# EMULAB-COPYRIGHT
# Copyright (c) 2012 University of Utah and the Flux Group.
# All rights reserved.
#
#
# Check the callers environment including IDs.
# A simple test script for the runsuid suid wrapper.
#
use English;
my %OENV = %ENV;
# un-taint path ala emulab scripts
$ENV{'PATH'} = '/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
my $subUID = `/usr/bin/id -ru`; chomp($subUID);
my $subEUID = `/usr/bin/id -u`; chomp($subEUID);
my $subGID = `/usr/bin/id -rg`; chomp($subGID);
my $subEGID = `/usr/bin/id -g`; chomp($subEGID);
print "ARGs:\n";
foreach my $arg (@ARGV) {
print " '$arg'\n";
}
print "IDs:\n";
print " UID = $UID\n";
print " EUID = $EUID\n";