+/* This is NUMBER OF ELEMENTS in a chain! */
static conscell *
sh_length(avl, il)
conscell *avl, *il;
@@ -458,7 +461,8 @@
char buf[10];
int len = 0;
- if ((il = cdar(avl)) && LIST(il)) {
+ il = cdar(avl);
+ if (il && LIST(il)) {
for (il = car(il); il != NULL; il = cdr(il))
++len;
}
@@ -469,6 +473,58 @@
return avl;
}
+/* This splits incoming string at WHITESPACEs to a list of strings */
+
+static conscell *
+sh_ifssplit(avl, il)
+ conscell *avl, *il;
+{
+ int len, l;
+ conscell *tmp, *reply, *t;
+ const char *p, *p0;
+ GCVARS1;
+
+ if (ifs == NULL)
+ ifs_flush();
+
+ il = cdar(avl);
+ /* 'il' is supposedly a single string */
+
+ if (!il || !STRING(il)) return il;
+ p0 = il->cstring;
+ len = il->slen;
+ if (!p0) return il;
+
+
+ reply = t = NULL;
+ GCPRO1(reply);
+
+ for (;len > 0; ++p0, --len) {
+
+ if (WHITESPACE(*p0)) continue;
+ p = p0;
+ while (len > 0 && !WHITESPACE(*p)) ++p, --len;
+
+ l = p - p0; /* Will always be at least 1 ! */
+
+ tmp = newstring(dupnstr(p0, l), l);
+ tmp->flags |= QUOTEDSTRING|ELEMENT;
+
+ p0 = p;
+
+ if (!t)
+ reply = t = tmp;
+ else {
+ cdr(t) = tmp;
+ t = tmp;
+ }
+
+ }
+
+ UNGCPRO1;
+ return reply;
+}
+
/* returns -- return ALWAYS a string [mea] */
conscell *
sh_returns(avl, il, statusp)
@@ -749,7 +805,7 @@
}
/* if (buf[0] == '\0') return 1; */
if (eoinp) return 1;
-eoinput:
+/* eoinput: */
while (argc-- > 0) v_set(*argv++, "");
return 0;
}
Index: libsh/variables.c
===================================================================
RCS file: /home/mea/src/CVSROOT/zmailer/libsh/variables.c,v
retrieving revision 1.6
diff -u -r1.6 variables.c
--- libsh/variables.c 1999/05/30 04:05:58 1.6
+++ libsh/variables.c 2001/01/18 15:31:51
@@ -150,6 +150,9 @@
*/
+#define ALWAYS_QUOTE_EXPANDS
+
+
conscell *
v_expand(s, caller, retcode)
const char *s; /* variable name */
@@ -160,6 +163,7 @@
register int n;
register char *cp;
char np[CHARSETSIZE+1]; /* each possible option, plus last NUL */
+ int noquote = 0;
# Will the MAILVAR/lists/listname show out sender identity as
# either: owner-listname, or: listname-owner ?
@@ -39,8 +40,9 @@
# We may want .forward and mailing list files to be private, i.e., we ignore
# the current privileges when checking the privileges of such files.
# Don't add 'include' to this list, since anyone can :include: any file.
+# This is a LIST of keywords
@@ -55,7 +57,7 @@
# Load the databases so they and the variables defined (e.g. network-specific
# node names for this host) can be used in the site specific configuration.
-for method in $protocols
+for method in $(elements $protocols)
do
test -f $MAILSHARE/cf/i-${method}.cf && . i-${method}.cf
done
@@ -109,7 +111,7 @@
. rrouter.cf
. crossbar.cf
# Will the MAILVAR/lists/listname show out sender identity as
# either: owner-listname, or: listname-owner ?
@@ -39,8 +40,9 @@
# We may want .forward and mailing list files to be private, i.e., we ignore
# the current privileges when checking the privileges of such files.
# Don't add 'include' to this list, since anyone can :include: any file.
+# This is a LIST of keywords
@@ -55,9 +57,9 @@
# Load the databases so they and the variables defined (e.g. network-specific
# node names for this host) can be used in the site specific configuration.
-for method in $protocols
+for method in ($elements $protocols)
do
- test -f $MAILSHARE/cf/i-${method}.cf && . i-${method}.cf
+ test -f "$MAILSHARE/cf/i-${method}.cf" && . i-${method}.cf
done
# Will the MAILVAR/lists/listname show out sender identity as
# either: owner-listname, or: listname-owner ?
@@ -40,7 +40,7 @@
# the current privileges when checking the privileges of such files.
# Don't add 'include' to this list, since anyone can :include: any file.
@@ -55,7 +55,7 @@
# Load the databases so they and the variables defined (e.g. network-specific
# node names for this host) can be used in the site specific configuration.
-for method in $protocols
+for method in $(elements $protocols)
do
test -f $MAILSHARE/cf/i-${method}.cf && . i-${method}.cf
done
@@ -109,7 +109,7 @@
. rrouter.cf
. crossbar.cf
#| The list of protocols given here are exactly the list that will be
#| supported in the configuration being loaded, and in the specified
@@ -48,7 +48,7 @@
# the current privileges when checking the privileges of such files.
# Don't add 'include' to this list, since anyone can :include: any file.
#| This variable is used in the alias expansion (in the routeuser
#| function) to determine how to use the privilege level associated with
@@ -78,7 +78,7 @@
#| can be used to declare and check dependencies between modules
#| (configuration files).
-require siteinfo router crossbar process server
+require siteinfo rrouter crossbar process server
#| The modules we require here are the configuration files whose contents
#| are essential to the proper functioning of the router.
@@ -102,7 +102,7 @@
# Load the databases so they and the variables defined (e.g. network-specific
# node names for this host) can be used in the site specific configuration.
-for method in $protocols
+for method in $(elements $protocols)
do
test -f $MAILSHARE/cf/i-${method}.cf && . i-${method}.cf
done
@@ -176,7 +176,7 @@
#| and rewrite addresses. They use other manipulation functions that are
#| specific to the varius message transfer protocols.
-for method in $protocols
+for method in $(elements $protocols)
do
. p-${method}.cf
done
Index: proto/cf/UTGPU.cf
===================================================================
RCS file: /home/mea/src/CVSROOT/zmailer/proto/cf/UTGPU.cf,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 UTGPU.cf
--- proto/cf/UTGPU.cf 1998/02/10 21:01:49 1.1.1.1
+++ proto/cf/UTGPU.cf 2001/01/18 15:26:44
@@ -36,7 +36,7 @@
# Set up the dependency checking
. consist.cf
-require siteinfo router crossbar process server
+require siteinfo rrouter crossbar process server
# The following are standard setup files and must be loaded in this order
#| The list of protocols given here are exactly the list that will be
#| supported in the configuration being loaded, and in the specified
@@ -47,7 +47,7 @@
# checking the privileges of such files. Don't add 'include' to this list,
# since anyone can :include: any file.
#| This variable is used in the alias expansion (in the routeuser
#| function) to determine how to use the privilege level associated with
@@ -95,7 +95,7 @@
# Load the databases so they and the variables defined (e.g. network-specific
# node names for this host) can be used in the site specific configuration.
-for method in $protocols
+for method in $(elements $protocols)
do
test -f $MAILSHARE/cf/i-${method}.cf && . i-${method}.cf
done
@@ -169,7 +169,7 @@
#| and rewrite addresses. They use other manipulation functions that are
#| specific to the varius message transfer protocols.
-for method in $protocols
+for method in $(elements $protocols)
do
. p-${method}.cf
done
Index: proto/cf/aliases-new.cf
===================================================================
RCS file: /home/mea/src/CVSROOT/zmailer/proto/cf/aliases-new.cf,v
retrieving revision 1.14
diff -u -r1.14 aliases-new.cf
--- proto/cf/aliases-new.cf 2000/10/10 21:00:58 1.14
+++ proto/cf/aliases-new.cf 2001/01/18 14:47:20
@@ -21,7 +21,7 @@
# some other value:
if [ -z "$localprotocols" ]; then
- localprotocols="include aliases mboxmap lists uid_trap punthost local"
+ localprotocols=(include aliases mboxmap lists uid_trap punthost local)
fi
#
@@ -336,7 +336,7 @@
;;
tfiss
- for func in $localprotocols; do
+ for func in ($elements $localprotocols); do
if [ -z "$didexpand" ]; then
a=$(localexpand "$func" "$user" "$host" "$attr" "$key") &&
return $a
@@ -780,7 +780,7 @@
getpriv (maxperm, priv, file, type) {
#echo "getpriv($maxperm, $priv, $file, $type)" > /dev/tty
- for ptype in $private
+ for ptype in $(elements $private)
do
if [ $type = $ptype ]; then
filepriv -M $maxperm "$file"
Index: proto/cf/aliases.cf
===================================================================
RCS file: /home/mea/src/CVSROOT/zmailer/proto/cf/aliases.cf,v
retrieving revision 1.38
diff -u -r1.38 aliases.cf
--- proto/cf/aliases.cf 2000/12/30 12:34:40 1.38
+++ proto/cf/aliases.cf 2001/01/18 16:17:23
@@ -215,9 +215,11 @@
local plustail2 forward priv hashomedir type
# For the expansions control tag we can use only
# the 'channel', and the 'username' strings, we CAN'T
@@ -225,13 +227,12 @@
# will have subsequently DIFFERENT values for it.
# Use of 'host' field means we can't use
getpriv (maxperm, priv, file, type) {
#echo "getpriv($maxperm, $priv, $file, $type)" > /dev/tty
- for ptype in $private
+ for ptype in $(elements $private)
do
if [ $type = $ptype ]; then
filepriv -M $maxperm "$file"
Index: proto/cf/consist.cf
===================================================================
RCS file: /home/mea/src/CVSROOT/zmailer/proto/cf/consist.cf,v
retrieving revision 1.3
diff -u -r1.3 consist.cf
--- proto/cf/consist.cf 1998/05/26 14:31:10 1.3
+++ proto/cf/consist.cf 2001/01/18 15:59:06
@@ -11,22 +11,32 @@
require=()
provide=()
-declare (plist, modules) {
- local a
- for m in $modules
+declare (plist, m) {
+ lreplace $plist $m $m
+}
+
+require () {
+ for x in $@
do
- lreplace $plist $m $m
- #a=$(setf $(get $plist $m) $m)
+ declare require $x
done
}
-require (modules) { declare require $modules }
-provide (module) { declare provide $module }
+provide () {
+ for x in $@
+ do
+ declare provide $x
+ done
+}
consist () {
local rval
+#grind $require
+#grind $provide
+
rval=0
+ # Scan for EVERY SECOND token of the array..
while [ $#require -gt 0 ];
do
want=$(car $require)
Index: proto/cf/fuzzy-aliases.cf
===================================================================
RCS file: /home/mea/src/CVSROOT/zmailer/proto/cf/fuzzy-aliases.cf,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 fuzzy-aliases.cf
--- proto/cf/fuzzy-aliases.cf 1998/02/10 21:01:49 1.1.1.1
+++ proto/cf/fuzzy-aliases.cf 2001/01/18 14:57:46
@@ -198,7 +198,7 @@
# that they couldn't access otherwise. If private='.forward maillist' then
# people stop complainig about the former behaviour...
getpriv (priv, file, type) {
- for ptype in $private
+ for ptype in $(elements $private)
do
if [ $type = $ptype ]; then
filepriv "$file"
Index: proto/cf/process.cf
===================================================================
RCS file: /home/mea/src/CVSROOT/zmailer/proto/cf/process.cf,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 process.cf
--- proto/cf/process.cf 1998/02/10 21:01:49 1.1.1.1
+++ proto/cf/process.cf 2001/01/18 15:28:24
@@ -18,7 +18,7 @@
#| our feet, we flush the cached information every once in a while (in this
#| case, before every message).
- LOGMSG=''
+ LOGMSG=() # This is a LIST of files where to log..
#| The LOGMSG variable is used by the intercept facility (in crossbar.cf)
#| to make sure only a single copy of a message is saved when required.
@@ -59,7 +59,7 @@
#| list in its entirety, except for the file name, and the message id, both
#| of which were logged earlier (in C code).
- for f in $LOGMSG
+ for f in $(elements $LOGMSG)
do
{ echo "==${file}==$(rfc822date)==" ;
/bin/cat ../queue/"$file" } >> $f && log saved "$file" in $f
@@ -69,3 +69,5 @@
}
+provide process
+# require XX XX XX
Index: proto/cf/rrouter.cf
===================================================================
RCS file: /home/mea/src/CVSROOT/zmailer/proto/cf/rrouter.cf,v
retrieving revision 1.18
diff -u -r1.18 rrouter.cf
--- proto/cf/rrouter.cf 2001/01/15 14:29:13 1.18
+++ proto/cf/rrouter.cf 2001/01/18 14:28:58
@@ -178,9 +178,9 @@
didhostexpand=$(hostexpansions "\2")
- for method in $protocols
+ for method in $(elements $protocols)
do
- tmp=$(${method}_neighbour "\2" "$address" $A) &&
+ tmp=$("${method}_neighbour" "\2" "$address" $A) &&
return $tmp
done
+
+provide server
+require rrouter
Index: proto/cf/standard.cf
===================================================================
RCS file: /home/mea/src/CVSROOT/zmailer/proto/cf/standard.cf,v
retrieving revision 1.19
diff -u -r1.19 standard.cf
--- proto/cf/standard.cf 2000/10/10 21:00:58 1.19
+++ proto/cf/standard.cf 2001/01/18 14:23:09
@@ -288,7 +288,7 @@
#| Domains with these toplevels will not be canonicalized via DNS lookup
#| This list is from ISOC table of 16-April-95 + "su" + bitnet + uucp
-toplevels="ad ae af ag ai al am an ao aq ar as at au aw az ba
+toplevels=(ad ae af ag ai al am an ao aq ar as at au aw az ba
bb bd be bf bg bh bi bj bm bn bo br bs bt bv bw by bz
ca cc cf cg ch ci ck cl cm cn co com cr cu cv cx cy cz
de dj dk dm do dz ec edu ee eg eh es et fi fj fk fm fo
@@ -301,10 +301,10 @@
pw py qa re ro ru rw sa sb sc sd se sg sh si sj sk sl
sm sn so sr st su sv sy sz tc td tf tg th tj tk tm tn
to tp tr tt tv tw tz ua ug uk um us uy uz va vc ve vg
- vi vn vu wf ws ye yu za zm zr zw uucp bitnet"
+ vi vn vu wf ws ye yu za zm zr zw uucp bitnet)
relation -lbt incore istoplevel
-for x in $toplevels
+for x in $(elements $toplevels)
do
db add istoplevel $x 1
done