more changes
This commit is contained in:
parent
7e61af5124
commit
a79cd7832f
10 changed files with 47 additions and 31 deletions
|
|
@ -75,5 +75,4 @@ extern int proc_wait(process*);
|
||||||
extern int proc_free(process*);
|
extern int proc_free(process*);
|
||||||
extern int proc_kill(process*);
|
extern int proc_kill(process*);
|
||||||
|
|
||||||
/* tell compiler we're using a value so it won't complain */
|
|
||||||
#define USE(x) if(x)
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
char *MAILROOT = "#9/mail";
|
char *_MAILROOT = "#9/mail";
|
||||||
char *UPASLOG = "#9/sys/log";
|
char *_UPASLOG = "#9/sys/log";
|
||||||
char *UPASLIB = "#9/mail/lib";
|
char *_UPASLIB = "#9/mail/lib";
|
||||||
char *UPASBIN= "#9/bin/upas";
|
char *_UPASBIN= "#9/bin/upas";
|
||||||
char *UPASTMP = "#9/mail/tmp";
|
char *_UPASTMP = "#9/mail/tmp";
|
||||||
char *SHELL = "#9/bin/rc";
|
char *_SHELL = "#9/bin/rc";
|
||||||
char *POST = "#9/sys/lib/post/dispatch";
|
char *_POST = "#9/sys/lib/post/dispatch";
|
||||||
|
|
||||||
int MBOXMODE = 0662;
|
int MBOXMODE = 0662;
|
||||||
|
|
||||||
|
|
@ -18,10 +18,10 @@ upasconfig(void)
|
||||||
if(did)
|
if(did)
|
||||||
return;
|
return;
|
||||||
did = 1;
|
did = 1;
|
||||||
MAILROOT = unsharp(MAILROOT);
|
_MAILROOT = unsharp(_MAILROOT);
|
||||||
UPASLOG = unsharp(UPASLOG);
|
_UPASLOG = unsharp(_UPASLOG);
|
||||||
UPASLIB = unsharp(UPASLIB);
|
_UPASLIB = unsharp(_UPASLIB);
|
||||||
UPASBIN = unsharp(UPASBIN);
|
_UPASBIN = unsharp(_UPASBIN);
|
||||||
SHELL = unsharp(SHELL);
|
_SHELL = unsharp(_SHELL);
|
||||||
POST = unsharp(POST);
|
_POST = unsharp(_POST);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,16 +21,25 @@ struct Mlock {
|
||||||
/*
|
/*
|
||||||
* from config.c - call upasconfig() before using
|
* from config.c - call upasconfig() before using
|
||||||
*/
|
*/
|
||||||
extern char *MAILROOT; /* root of mail system */
|
extern char *_MAILROOT; /* root of mail system */
|
||||||
extern char *UPASLOG; /* log directory */
|
extern char *_UPASLOG; /* log directory */
|
||||||
extern char *UPASLIB; /* upas library directory */
|
extern char *_UPASLIB; /* upas library directory */
|
||||||
extern char *UPASBIN; /* upas binary directory */
|
extern char *_UPASBIN; /* upas binary directory */
|
||||||
extern char *UPASTMP; /* temporary directory */
|
extern char *_UPASTMP; /* temporary directory */
|
||||||
extern char *SHELL; /* path name of shell */
|
extern char *_SHELL; /* path name of shell */
|
||||||
extern char *POST; /* path name of post server addresses */
|
extern char *_POST; /* path name of post server addresses */
|
||||||
extern int MBOXMODE; /* default mailbox protection mode */
|
extern int MBOXMODE; /* default mailbox protection mode */
|
||||||
extern void upasconfig(void);
|
extern void upasconfig(void);
|
||||||
|
|
||||||
|
/* forgive me */
|
||||||
|
#define MAILROOT (upasconfig(), _MAILROOT)
|
||||||
|
#define UPASLOG (upasconfig(), _UPASLOG)
|
||||||
|
#define UPASLIB (upasconfig(), _UPASLIB)
|
||||||
|
#define UPASBIN (upasconfig(), _UPASBIN)
|
||||||
|
#define UPASTMP (upasconfig(), _UPASTMP)
|
||||||
|
#define SHELL (upasconfig(), _SHELL)
|
||||||
|
#define POST (upasconfig(), _POST)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* files in libsys.c
|
* files in libsys.c
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
#include "../smtp/smtp.h"
|
#include "../smtp/smtp.h"
|
||||||
#include "../smtp/y.tab.h"
|
#include "../smtp/rfc822.tab.h"
|
||||||
|
|
||||||
typedef struct Addr Addr;
|
typedef struct Addr Addr;
|
||||||
struct Addr
|
struct Addr
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ UHFILES= ../common/common.h\
|
||||||
dat.h\
|
dat.h\
|
||||||
|
|
||||||
HFILES=$UHFILES\
|
HFILES=$UHFILES\
|
||||||
../smtp/y.tab.h\
|
../smtp/rfc822.tab.h\
|
||||||
|
|
||||||
LIB=../common/libcommon.a
|
LIB=../common/libcommon.a
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ CFLAGS=$CFLAGS -I../common
|
||||||
$O.ml: ../smtp/rfc822.tab.$O
|
$O.ml: ../smtp/rfc822.tab.$O
|
||||||
$O.mlowner: ../smtp/rfc822.tab.$O
|
$O.mlowner: ../smtp/rfc822.tab.$O
|
||||||
|
|
||||||
../smtp/y.tab.h ../smtp/rfc822.tab.$O:
|
../smtp/rfc822.tab.h ../smtp/rfc822.tab.$O:
|
||||||
(
|
(
|
||||||
cd ../smtp
|
cd ../smtp
|
||||||
mk rfc822.tab.$O
|
mk rfc822.tab.$O
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,7 @@ getaddr(Node *p)
|
||||||
for(; p; p = p->next)
|
for(; p; p = p->next)
|
||||||
if(p->s && p->addr)
|
if(p->s && p->addr)
|
||||||
return s_copy(s_to_c(p->s));
|
return s_copy(s_to_c(p->s));
|
||||||
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the text of a header line minus the field name */
|
/* get the text of a header line minus the field name */
|
||||||
|
|
|
||||||
|
|
@ -41,12 +41,13 @@ smtpd.tab.c: smtpd.y smtpd.h
|
||||||
sed 's/yy/zz/g' < xxx > $target
|
sed 's/yy/zz/g' < xxx > $target
|
||||||
rm xxx
|
rm xxx
|
||||||
|
|
||||||
rfc822.tab.c: rfc822.y smtp.h
|
rfc822.tab.c rfc822.tab.h: rfc822.y smtp.h
|
||||||
9 yacc -d -o $target rfc822.y
|
9 yacc -d -o $target rfc822.y
|
||||||
|
mv y.tab.h rfc822.tab.h
|
||||||
|
|
||||||
clean:V:
|
clean:V:
|
||||||
rm -f *.[$OS] [$OS].$TARG smtpd.tab.c rfc822.tab.c y.tab.? y.debug $TARG
|
rm -f *.[$OS] [$OS].$TARG smtpd.tab.c rfc822.tab.c y.tab.? y.debug $TARG
|
||||||
|
|
||||||
../common/libcommon.a
|
../common/libcommon.a:
|
||||||
cd ../common; mk
|
cd ../common; mk
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ extern int debug;
|
||||||
|
|
||||||
static int mxlookup(DS*, char*);
|
static int mxlookup(DS*, char*);
|
||||||
static int mxlookup1(DS*, char*);
|
static int mxlookup1(DS*, char*);
|
||||||
static int compar(void*, void*);
|
static int compar(const void*, const void*);
|
||||||
static int callmx(DS*, char*, char*);
|
static int callmx(DS*, char*, char*);
|
||||||
static void expand_meta(DS *ds);
|
static void expand_meta(DS *ds);
|
||||||
extern int cistrcmp(char*, char*);
|
extern int cistrcmp(char*, char*);
|
||||||
|
|
@ -50,8 +50,10 @@ mxdial(char *addr, char *ddomain, char *gdomain)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
timeout(void*, char *msg)
|
timeout(void *v, char *msg)
|
||||||
{
|
{
|
||||||
|
USED(v);
|
||||||
|
|
||||||
if(strstr(msg, "alarm"))
|
if(strstr(msg, "alarm"))
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -232,7 +234,7 @@ mxlookup1(DS *ds, char *domain)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
compar(void *a, void *b)
|
compar(const void *a, const void *b)
|
||||||
{
|
{
|
||||||
return ((Mx*)a)->pref - ((Mx*)b)->pref;
|
return ((Mx*)a)->pref - ((Mx*)b)->pref;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
#include <mp.h>
|
#include <mp.h>
|
||||||
#include <libsec.h>
|
#include <libsec.h>
|
||||||
#include <auth.h>
|
#include <auth.h>
|
||||||
#include "../smtp/y.tab.h"
|
#include "../smtp/rfc822.tab.h"
|
||||||
|
|
||||||
#define DBGMX 1
|
#define DBGMX 1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,7 @@ parseinit(void)
|
||||||
yyfp = &bin;
|
yyfp = &bin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
yylex(void)
|
yylex(void)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
@ -229,6 +230,7 @@ cat(YYSTYPE *y1, YYSTYPE *y2, YYSTYPE *y3, YYSTYPE *y4, YYSTYPE *y5, YYSTYPE *y6
|
||||||
{
|
{
|
||||||
YYSTYPE rv;
|
YYSTYPE rv;
|
||||||
|
|
||||||
|
memset(&rv, 0, sizeof rv);
|
||||||
if(y1->s)
|
if(y1->s)
|
||||||
rv.s = y1->s;
|
rv.s = y1->s;
|
||||||
else {
|
else {
|
||||||
|
|
@ -296,6 +298,7 @@ cat(YYSTYPE *y1, YYSTYPE *y2, YYSTYPE *y3, YYSTYPE *y4, YYSTYPE *y5, YYSTYPE *y6
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
return rv;
|
return rv;
|
||||||
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -312,6 +315,7 @@ anonymous(void)
|
||||||
{
|
{
|
||||||
YYSTYPE rv;
|
YYSTYPE rv;
|
||||||
|
|
||||||
|
memset(&rv, 0, sizeof rv);
|
||||||
rv.s = s_copy("/dev/null");
|
rv.s = s_copy("/dev/null");
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue