+daemon
+client
+
+lexer.l
+lexer.c
+tokens.h
+pcsum.h
+
english.lp
*.sasp*
-config.cache
+*.lout*
+*.li
+*.ps
+spec.html
+
configure
Makefile
-lexer.l
-lexer.c
-tokens.h
-sources
-id
+config.h.in
+
+config.cache
+config.log
+config.h
+config.status
+
vd
-services
slash-etc
LEX=flex
CWD=$(shell pwd)
+INSTALL=@INSTALL@
+INSTALL_PROGRAM=@INSTALL_PROGRAM@
+INSTALL_DATA=@INSTALL_DATA@
+prefix=@prefix@
+exec_prefix=$(prefix)
+bindir=$(exec_prefix)/bin
+sbindir=$(exec_prefix)/sbin
+etcdir=/etc
+etcsubdir=$(etcdir)/userv
+
+SOURCES= Makefile.in configure.in acconfig.h \
+ client.c common.h \
+ daemon.c daemon.h ddebug.c parser.c lib.c lib.h \
+ language.i4 lexer.l.m4 tokens.h.m4
+ALSOSHIP= system.default system.override \
+ spec.sgml overview.fig overview.ps \
+ COPYING install-sh .cvsignore
+GENSHIP= lexer.l lexer.c tokens.h pcsum.h \
+ spec.html spec.ps overview.ps
+
+SHIPTARGETS= $(SOURCES) $(ALSOSHIP) $(GENSHIP)
+
all: daemon client
+install: all
+ $(INSTALL_PROGRAM) -s -o root -g root -m 755 daemon $(sbindir)/uservd
+ $(INSTALL_PROGRAM) -s -o root -g root -m 4755 client $(bindir)/userv
+ $(INSTALL) -d -o root -g root -m 2755 $(etcsubdir)
+ if ! test -f $(etcsubdir)/system.default; then \
+ $(INSTALL_DATA) -o root -g root system.default $(etcsubdir); fi
+ if ! test -f $(etcsubdir)/system.override; then \
+ $(INSTALL_DATA) -o root -g root system.override $(etcsubdir); fi
+
daemon: daemon.o parserlexer.o ddebug.o lib.o
lexer.l: language.i4
# lexer.c #include's parser.c at the end. Blame flex.
$(CC) -c $(CPPFLAGS) $(CFLAGS) lexer.c -o $@
-pcsum.h: common.h Makefile
- cat common.h Makefile | md5sum | perl -pe 's/../0x$$&,/g; s/,$$//;' \
+pcsum.h: common.h
+ md5sum common.h | perl -pe 's/../0x$$&,/g; s/,$$//;' \
>pcsum.h.new && mv pcsum.h.new pcsum.h
tokens.h: language.i4
realclean: distclean
rm -f configure config.h.in
+shipprep: $(SHIPTARGETS)
+
+ship: $(SHIPTARGETS)
+ rm -rf d && mkdir d && cp -av $^ d
+ mv d userv-$(VERSION)
+ GZIP=-9v tar zvvcf ../userv-$(VERSION).tar.gz userv-$(VERSION)
+ rm -rf userv-$(VERSION)
+
+linecount: $(SOURCES)
+ wc -l $^
+
+%.html: %.sgml
+ rm -rf $@; debiandoc2html $<
+
+%.ps: %.sgml
+ debiandoc2ps -1 -k -O $< >$@.new && mv $@.new $@
+
+%.ps: %.fig
+ fig2dev -L ps -c -l dummy -P -z A4 $< >$@.new && mv $@.new $@
+
%.l: %.l.m4
$(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@
static void of_fdwait(const struct optioninfo *oip, const char *value, char *key) {
const struct fdmodifierinfo *fdmip;
- unsigned long fd;
+ unsigned long ul;
+ int fd;
char *delim;
fd= fdstdnumber(key);
if (fd<0) {
- fd= strtoul(value,&delim,0);
+ ul= strtoul(key,&delim,0);
if (*delim) usageerror("first part of argument to --fdwait must be "
"numeric or fd name - `%s' is not recognised",key);
+ if (ul>INT_MAX) usageerror("first part of argument to --fdwait is far too large");
+ fd= ul;
}
if (fd >= fdsetupsize || !fdsetup[fd].filename)
- usageerror("file descriptor %lu specified in --fdwait option is not open",fd);
+ usageerror("file descriptor %d specified in --fdwait option is not open",fd);
for (fdmip= fdmodifierinfos; fdmip->string && strcmp(fdmip->string,value); fdmip++);
if (!fdmip->string || !(fdmip->implies & (fdm_wait|fdm_nowait|fdm_close)))
usageerror("value for --fdwait must be `wait', `nowait' or `close', not `%s'",value);
])
AC_PROG_CC
+AC_PROG_INSTALL
AC_SYS_LONG_FILE_NAMES
AC_SUBST(OPTIMISE)
--- /dev/null
+#!/bin/sh
+
+#
+# install - install a program, script, or datafile
+# This comes from X11R5; it is not part of GNU.
+#
+# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+#
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+
+instcmd="$mvprog"
+chmodcmd=""
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+fi
+
+if [ x"$dst" = x ]
+then
+ echo "install: no destination specified"
+ exit 1
+fi
+
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+if [ -d $dst ]
+then
+ dst="$dst"/`basename $src`
+fi
+
+# Make a temp file name in the proper directory.
+
+dstdir=`dirname $dst`
+dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+$doit $instcmd $src $dsttmp
+
+# and set any options; do chmod last to preserve setuid bits
+
+if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
+if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
+if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
+if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
+
+# Now rename the file to the real destination.
+
+$doit $rmcmd $dst
+$doit $mvcmd $dsttmp $dst
+
+
+exit 0
--- /dev/null
+# Generally, if you want all your users to provide a service for your
+# benefit but want them to be able to override your default setting,
+# you should put it in this file but not use quit. Eg:
+# if ( grep service-user-shell /etc/shells
+# & glob service mail-delivery
+# & glob calling-user mail
+# )
+# reset
+# no-suppress-args
+# execute /usr/local/bin/procmail-wrapper
+# fi
+# (procmail-wrapper could extract envelope information from the
+# arguments and/or -D options and pass them to procmail.)
+#
+# If you want to force users to provide a particular service,
+# then you can put it here and use `quit'. Eg:
+# if ( grep service-user-shell /etc/shells
+# & glob service cleanup-tmp
+# )
+# reset
+# errors-to-syslog local4
+# execute /usr/local/bin/cleanup-tmp
+# no-set-environment
+# no-disconnect-hup
+# null-fd 0 read
+# null-fd 1-2 write
+# quit
+# fi
+# Alternatively, you could put the same thing in system.override, with
+# or without the quit. In this case it's usually important to use
+# reset, and also to note that now users can cause error messages
+# which they could not do before (though due to the implied catch-quit
+# around the user's rc file they wouldn't stop the service being
+# executed).
+#
+# If you want to force all your users' services to have a particular
+# property you should do it in system.override. Eg, there put
+# set-environment
+# to force them to run /etc/environment to have ulimits set up, even
+# if they try not to.
+#
+# NB that doing this _won't_ affect things in system.default and
+# earlier in system.override that use `quit'.
--- /dev/null
+# This is for subtle overriding things. Most things should go
+# in system.default, so that the user can override them if they
+# want and so that if you want to force the user to provide a
+# service you don't needlessly parse their configuration file
+# and get the error messages from it.