diff options
author | Rob Austein <sra@hactrn.net> | 2014-04-10 18:51:04 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2014-04-10 18:51:04 +0000 |
commit | d55fa906e96023892bc15a3f1eb5d0555cfdf64e (patch) | |
tree | 533d767c5efa787ec58f435a7ae34d658ab3b950 | |
parent | 8402eee182ed7c804a3675aec7ee953e746afa3b (diff) |
Incomplete autoconf conversion in RP tools. Oops. Thanks, Michael.
svn path=/branches/tk685/; revision=5781
-rw-r--r-- | Makefile.in | 8 | ||||
-rwxr-xr-x | configure | 10 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | rp/rcynic/Makefile.in | 4 | ||||
-rwxr-xr-x | rp/rcynic/rcynic-cron | 24 | ||||
-rwxr-xr-x | rp/rcynic/rcynic-html | 3 | ||||
l--------- | rp/rcynic/rpki | 1 | ||||
l--------- | rp/rpki-rtr/rpki | 1 | ||||
-rwxr-xr-x | rp/rpki-rtr/rtr-origin | 35 | ||||
l--------- | rp/utils/rpki | 1 |
10 files changed, 57 insertions, 36 deletions
diff --git a/Makefile.in b/Makefile.in index f9468915..28f3d4c8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -31,7 +31,11 @@ CA_TARGET = @CA_TARGET@ WSGI_DAEMON_PROCESS = @WSGI_DAEMON_PROCESS@ WSGI_PROCESS_GROUP = @WSGI_PROCESS_GROUP@ +RCYNIC_DIR = @RCYNIC_DIR@ +RCYNIC_USER = @RCYNIC_USER@ +RCYNIC_GROUP = @RCYNIC_GROUP@ RCYNIC_HTML_DIR = @RCYNIC_HTML_DIR@ +RRDTOOL = @RRDTOOL@ APACHE_VERSION = @APACHE_VERSION@ WSGI_PYTHON_EGG_CACHE_DIR = @WSGI_PYTHON_EGG_CACHE_DIR@ WSGI_PYTHON_EGG_CACHE_USER = @WSGI_PYTHON_EGG_CACHE_USER@ @@ -137,7 +141,11 @@ rpki/autoconf.py: Makefile echo ; \ echo 'WSGI_DAEMON_PROCESS = "${WSGI_DAEMON_PROCESS}"'; \ echo 'WSGI_PROCESS_GROUP = "${WSGI_PROCESS_GROUP}"'; \ + echo 'RCYNIC_DIR = "${RCYNIC_DIR}"'; \ + echo 'RCYNIC_USER = "${RCYNIC_USER}"'; \ + echo 'RCYNIC_GROUP = "${RCYNIC_GROUP}"'; \ echo 'RCYNIC_HTML_DIR = "${RCYNIC_HTML_DIR}"'; \ + echo 'RRDTOOL = "${RRDTOOL}"'; \ echo 'APACHE_VERSION = "${APACHE_VERSION}"'; \ echo 'WSGI_PYTHON_EGG_CACHE_DIR = "${WSGI_PYTHON_EGG_CACHE_DIR}"'; \ echo 'WSGI_PYTHON_EGG_CACHE_USER = "${WSGI_PYTHON_EGG_CACHE_USER}"'; \ @@ -636,6 +636,8 @@ RTR_ORIGIN_INSTALL_TARGETS RCYNIC_INSTALL_TARGETS RCYNIC_HTML_DIR RCYNIC_STATIC_RSYNC +RCYNIC_GROUP +RCYNIC_USER RCYNIC_CRON_USER RCYNIC_CONF_TA_DIR RCYNIC_CONF_DATA @@ -4601,6 +4603,14 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_rcynic_jail" >&5 $as_echo "$use_rcynic_jail" >&6; } +# Perhaps there should be a way to set these, but for now just +# wire them in here so at least they're consistent in all Makefiles. + +RCYNIC_USER=rcynic + +RCYNIC_GROUP=rcynic + + if test $use_rcynic_jail = yes && test "X$LD_STATIC_FLAG" != "X" then RCYNIC_STATIC_RSYNC='static-rsync/rsync' diff --git a/configure.ac b/configure.ac index b5c9a6a3..a07f78fc 100644 --- a/configure.ac +++ b/configure.ac @@ -403,6 +403,12 @@ AC_SUBST(RCYNIC_CRON_USER) AC_MSG_RESULT([$use_rcynic_jail]) +# Perhaps there should be a way to set these, but for now just +# wire them in here so at least they're consistent in all Makefiles. + +AC_SUBST(RCYNIC_USER, [rcynic]) +AC_SUBST(RCYNIC_GROUP, [rcynic]) + if test $use_rcynic_jail = yes && test "X$LD_STATIC_FLAG" != "X" then RCYNIC_STATIC_RSYNC='static-rsync/rsync' diff --git a/rp/rcynic/Makefile.in b/rp/rcynic/Makefile.in index 972f1de6..d0edfca3 100644 --- a/rp/rcynic/Makefile.in +++ b/rp/rcynic/Makefile.in @@ -50,13 +50,13 @@ RCYNIC_DATA_DIR = ${RCYNIC_DIR}/data RCYNIC_DIR = @RCYNIC_DIR@ RCYNIC_DIRS = ${RCYNIC_TA_DIR} ${RCYNIC_JAIL_DIRS} ${RCYNIC_DATA_DIR} ${RPKIRTR_DIR} ${RPKIRTR_DIR}/sockets RCYNIC_GECOS = RPKI Validation System -RCYNIC_GROUP = rcynic +RCYNIC_GROUP = @RCYNIC_GROUP@ RCYNIC_HTML_DIR = @RCYNIC_HTML_DIR@ RCYNIC_INSTALL_TARGETS = @RCYNIC_INSTALL_TARGETS@ RCYNIC_JAIL_DIRS = @RCYNIC_JAIL_DIRS@ RCYNIC_STATIC_RSYNC = @RCYNIC_STATIC_RSYNC@ RCYNIC_TA_DIR = @RCYNIC_TA_DIR@ -RCYNIC_USER = rcynic +RCYNIC_USER = @RCYNIC_USER@ RPKIRTR_DIR = ${RCYNIC_DIR}/rpki-rtr RPKIRTR_GECOS = RPKI router server RPKIRTR_GROUP = rpkirtr diff --git a/rp/rcynic/rcynic-cron b/rp/rcynic/rcynic-cron index 73368e0d..dc26e9a0 100755 --- a/rp/rcynic/rcynic-cron +++ b/rp/rcynic/rcynic-cron @@ -32,6 +32,7 @@ import pwd import fcntl import errno import argparse +import rpki.autoconf def run(*cmd, **kwargs): chroot_this = kwargs.pop("chroot_this", False) @@ -39,13 +40,13 @@ def run(*cmd, **kwargs): pid = os.fork() if pid == 0: if chroot_this: - os.chdir(rpki.autoconf.rcynic_dir) + os.chdir(rpki.autoconf.RCYNIC_DIR) elif cwd is not None: os.chdir(cwd) if we_are_root: os.initgroups(pw.pw_name, pw.pw_gid) if chroot_this: - os.chroot(rpki.autoconf.rcynic_dir) + os.chroot(rpki.autoconf.RCYNIC_DIR) if we_are_root: os.setgid(pw.pw_gid) os.setuid(pw.pw_uid) @@ -73,12 +74,13 @@ if args.chroot and not we_are_root: sys.exit("Only root can --chroot") try: - pw = pwd.getpwnam(rpki.autoconf.rcynic_user) + pw = pwd.getpwnam(rpki.autoconf.RCYNIC_USER) except KeyError: - sys.exit("Could not find passwd entry for user %s" % rpki.autoconf.rcynic_user) + sys.exit("Could not find passwd entry for user %s" % rpki.autoconf.RCYNIC_USER) try: - lock = os.open(os.path.join(rpki.autoconf.rcynic_dir, "data/lock"), os.O_RDONLY | os.O_CREAT | os.O_NONBLOCK, 0666) + lock = os.open(os.path.join(rpki.autoconf.RCYNIC_DIR, "data/lock"), + os.O_RDONLY | os.O_CREAT | os.O_NONBLOCK, 0666) fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB) if we_are_root: os.fchown(lock, pw.pw_uid, pw.pw_gid) @@ -86,7 +88,7 @@ except (IOError, OSError), e: if e.errno == errno.EAGAIN: sys.exit(0) # Another instance of this script is already running, exit silently else: - sys.exit("Error %r opening lock %r" % (e.strerror, os.path.join(rpki.autoconf.rcynic_dir, "data/lock"))) + sys.exit("Error %r opening lock %r" % (e.strerror, os.path.join(rpki.autoconf.RCYNIC_DIR, "data/lock"))) if args.chroot: run("/bin/rcynic", "-c", "/etc/rcynic.conf", chroot_this = True) @@ -95,14 +97,14 @@ else: run(os.path.join(rpki.autoconf.bindir, "rtr-origin"), "--cronjob", - os.path.join(rpki.autoconf.rcynic_dir, "data/authenticated"), - cwd = os.path.join(rpki.autoconf.rcynic_dir, "rpki-rtr")) + os.path.join(rpki.autoconf.RCYNIC_DIR, "data/authenticated"), + cwd = os.path.join(rpki.autoconf.RCYNIC_DIR, "rpki-rtr")) prog = os.path.join(rpki.autoconf.libexecdir, "rpkigui-rcynic") if os.path.exists(prog): run(prog) -if rpki.autoconf.rcynic_html_dir and os.path.exists(os.path.dirname(rpki.autoconf.rcynic_html_dir)): +if rpki.autoconf.RCYNIC_HTML_DIR and os.path.exists(os.path.dirname(rpki.autoconf.RCYNIC_HTML_DIR)): run(os.path.join(rpki.autoconf.bindir, "rcynic-html"), - os.path.join(rpki.autoconf.rcynic_dir, "data/rcynic.xml"), - rpki.autoconf.rcynic_html_dir) + os.path.join(rpki.autoconf.RCYNIC_DIR, "data/rcynic.xml"), + rpki.autoconf.RCYNIC_HTML_DIR) diff --git a/rp/rcynic/rcynic-html b/rp/rcynic/rcynic-html index a7de2291..cf5f5368 100755 --- a/rp/rcynic/rcynic-html +++ b/rp/rcynic/rcynic-html @@ -29,6 +29,7 @@ import argparse import time import subprocess import copy +import rpki.autoconf try: from lxml.etree import (ElementTree, Element, SubElement, Comment) @@ -43,7 +44,7 @@ def parse_options(): global args try: - default_rrdtool_binary = rpki.autoconf.rrdtool_binary + default_rrdtool_binary = rpki.autoconf.RRDTOOL except NameError: default_rrdtool_binary = "rrdtool" diff --git a/rp/rcynic/rpki b/rp/rcynic/rpki new file mode 120000 index 00000000..d39d05b6 --- /dev/null +++ b/rp/rcynic/rpki @@ -0,0 +1 @@ +../../rpki
\ No newline at end of file diff --git a/rp/rpki-rtr/rpki b/rp/rpki-rtr/rpki new file mode 120000 index 00000000..d39d05b6 --- /dev/null +++ b/rp/rpki-rtr/rpki @@ -0,0 +1 @@ +../../rpki
\ No newline at end of file diff --git a/rp/rpki-rtr/rtr-origin b/rp/rpki-rtr/rtr-origin index e1e82ccf..73f4474d 100755 --- a/rp/rpki-rtr/rtr-origin +++ b/rp/rpki-rtr/rtr-origin @@ -41,7 +41,7 @@ import getopt import bisect import random import base64 - +import rpki.autoconf # Debugging only, should be False in production disable_incrementals = False @@ -2161,27 +2161,18 @@ def bgpdump_server_main(argv): sys.exit(0) # Figure out where the scan_roas utility program is today -try: - # Set from autoconf - scan_roas = rpki.autoconf.scan_roas -except NameError: - # Source directory - scan_roas = os.path.normpath(os.path.join(sys.path[0], "..", "utils", - "scan_roas", "scan_roas")) -# If that didn't work, use $PATH and hope for the best -if not os.path.exists(scan_roas): - scan_roas = "scan_roas" - -# Same thing for scan_routercerts -try: - # Set from autoconf - scan_routercerts = rpki.autoconf.scan_routercerts -except NameError: - # Source directory - scan_routercerts = os.path.normpath(os.path.join(sys.path[0], "..", "utils", - "scan_routercerts", "scan_routercerts")) -if not os.path.exists(scan_routercerts): - scan_routercerts = "scan_routercerts" +for scan_roas in (os.path.join(rpki.autoconf.bindir, "scan_roas"), + os.path.normpath(os.path.join(sys.path[0], "..", "utils", "scan_roas")), + "scan_roas"): + if os.path.exists(scan_roas): + break + +# Same for scan_routercerts +for scan_routercerts in (os.path.join(rpki.autoconf.bindir, "scan_routercerts"), + os.path.normpath(os.path.join(sys.path[0], "..", "utils", "scan_routercerts")), + "scan_routercerts"): + if os.path.exists(scan_routercerts): + break force_zero_nonce = False diff --git a/rp/utils/rpki b/rp/utils/rpki new file mode 120000 index 00000000..d39d05b6 --- /dev/null +++ b/rp/utils/rpki @@ -0,0 +1 @@ +../../rpki
\ No newline at end of file |