version 1.14.44.1, 2012/04/23 16:48:54 |
version 1.14.44.2, 2012/04/23 23:40:41 |
Line 72 static char whitespace_eq[] = "= \t\r\n" |
|
Line 72 static char whitespace_eq[] = "= \t\r\n" |
|
#define whitespace (whitespace_eq + 1) |
#define whitespace (whitespace_eq + 1) |
|
|
static char *get_field /* chew :-delimited field off string */ |
static char *get_field /* chew :-delimited field off string */ |
(char *); |
__P((char *)); |
static char *chop_string /* strip leading and trailing blanks */ |
static char *chop_string /* strip leading and trailing blanks */ |
(char *); |
__P((char *)); |
struct syslog_names; |
struct syslog_names; |
static int severity_map |
static int severity_map |
(const struct syslog_names *, char *); |
__P((struct syslog_names *, char *)); |
|
|
/* List of functions that implement the options. Add yours here. */ |
/* List of functions that implement the options. Add yours here. */ |
|
|
static void user_option /* execute "user name.group" option */ |
static void user_option /* execute "user name.group" option */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
static void group_option /* execute "group name" option */ |
static void group_option /* execute "group name" option */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
static void umask_option /* execute "umask mask" option */ |
static void umask_option /* execute "umask mask" option */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
static void linger_option /* execute "linger time" option */ |
static void linger_option /* execute "linger time" option */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
static void keepalive_option /* execute "keepalive" option */ |
static void keepalive_option /* execute "keepalive" option */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
static void spawn_option /* execute "spawn command" option */ |
static void spawn_option /* execute "spawn command" option */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
static void twist_option /* execute "twist command" option */ |
static void twist_option /* execute "twist command" option */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
static void rfc931_option /* execute "rfc931" option */ |
static void rfc931_option /* execute "rfc931" option */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
static void setenv_option /* execute "setenv name value" */ |
static void setenv_option /* execute "setenv name value" */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
static void nice_option /* execute "nice" option */ |
static void nice_option /* execute "nice" option */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
static void severity_option /* execute "severity value" */ |
static void severity_option /* execute "severity value" */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
static void allow_option /* execute "allow" option */ |
static void allow_option /* execute "allow" option */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
static void deny_option /* execute "deny" option */ |
static void deny_option /* execute "deny" option */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
static void banners_option /* execute "banners path" option */ |
static void banners_option /* execute "banners path" option */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
|
|
/* Structure of the options table. */ |
/* Structure of the options table. */ |
|
|
struct option { |
struct option { |
const char *name; /* keyword name, case is ignored */ |
char *name; /* keyword name, case is ignored */ |
void (*func) /* function that does the real work */ |
void (*func) /* function that does the real work */ |
(char *, struct request_info *); |
__P((char *, struct request_info *)); |
int flags; /* see below... */ |
int flags; /* see below... */ |
}; |
}; |
|
|
Line 152 static struct option option_table[] = { |
|
Line 152 static struct option option_table[] = { |
|
|
|
/* process_options - process access control options */ |
/* process_options - process access control options */ |
|
|
void |
void process_options(options, request) |
process_options(char *options, struct request_info *request) |
char *options; |
|
struct request_info *request; |
{ |
{ |
char *key; |
char *key; |
char *value; |
char *value; |
Line 217 process_options(char *options, struct re |
|
Line 218 process_options(char *options, struct re |
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
|
|
static void |
static void allow_option(value, request) |
allow_option(char *value, struct request_info *request) |
char *value; |
|
struct request_info *request; |
{ |
{ |
longjmp(tcpd_buf, AC_PERMIT); |
longjmp(tcpd_buf, AC_PERMIT); |
} |
} |
Line 227 allow_option(char *value, struct request |
|
Line 229 allow_option(char *value, struct request |
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
|
|
static void |
static void deny_option(value, request) |
deny_option(char *value, struct request_info *request) |
char *value; |
|
struct request_info *request; |
{ |
{ |
longjmp(tcpd_buf, AC_DENY); |
longjmp(tcpd_buf, AC_DENY); |
} |
} |
|
|
/* banners_option - expand %<char>, terminate each line with CRLF */ |
/* banners_option - expand %<char>, terminate each line with CRLF */ |
|
|
static void |
static void banners_option(value, request) |
banners_option(char *value, struct request_info *request) |
char *value; |
|
struct request_info *request; |
{ |
{ |
char path[MAXPATHLEN]; |
char path[MAXPATHLEN]; |
char ibuf[BUFSIZ]; |
char ibuf[BUFSIZ]; |
Line 266 banners_option(char *value, struct reque |
|
Line 270 banners_option(char *value, struct reque |
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
|
|
static void |
static void group_option(value, request) |
group_option(char *value, struct request_info *request) |
char *value; |
|
struct request_info *request; |
{ |
{ |
struct group grs, *grp; |
struct group grs, *grp; |
char grbuf[1024]; |
char grbuf[1024]; |
Line 284 group_option(char *value, struct request |
|
Line 289 group_option(char *value, struct request |
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
|
|
static void |
static void user_option(value, request) |
user_option(char *value, struct request_info *request) |
char *value; |
|
struct request_info *request; |
{ |
{ |
struct passwd *pwd, pws; |
struct passwd *pwd, pws; |
char *group; |
char *group; |
Line 305 user_option(char *value, struct request_ |
|
Line 311 user_option(char *value, struct request_ |
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
|
|
static void |
static void umask_option(value, request) |
umask_option(char *value, struct request_info *request) |
char *value; |
|
struct request_info *request; |
{ |
{ |
unsigned mask; |
unsigned mask; |
char junk; |
char junk; |
Line 320 umask_option(char *value, struct request |
|
Line 327 umask_option(char *value, struct request |
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
|
|
static void |
static void spawn_option(value, request) |
spawn_option(char *value, struct request_info *request) |
char *value; |
|
struct request_info *request; |
{ |
{ |
if (dry_run == 0) |
if (dry_run == 0) |
shell_cmd(value); |
shell_cmd(value); |
Line 331 spawn_option(char *value, struct request |
|
Line 339 spawn_option(char *value, struct request |
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
|
|
static void |
static void linger_option(value, request) |
linger_option(char *value, struct request_info *request) |
char *value; |
|
struct request_info *request; |
{ |
{ |
struct linger linger; |
struct linger linger; |
char junk; |
char junk; |
Line 352 linger_option(char *value, struct reques |
|
Line 361 linger_option(char *value, struct reques |
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
|
|
static void |
static void keepalive_option(value, request) |
keepalive_option(char *value, struct request_info *request) |
char *value; |
|
struct request_info *request; |
{ |
{ |
static int on = 1; |
static int on = 1; |
|
|
Line 366 keepalive_option(char *value, struct req |
|
Line 376 keepalive_option(char *value, struct req |
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
|
|
static void |
static void nice_option(value, request) |
nice_option(char *value, struct request_info *request) |
char *value; |
|
struct request_info *request; |
{ |
{ |
int niceval = 10; |
int niceval = 10; |
char junk; |
char junk; |
Line 380 nice_option(char *value, struct request_ |
|
Line 391 nice_option(char *value, struct request_ |
|
|
|
/* twist_option - replace process by shell command */ |
/* twist_option - replace process by shell command */ |
|
|
static void |
static void twist_option(value, request) |
twist_option(char *value, struct request_info *request) |
char *value; |
|
struct request_info *request; |
{ |
{ |
if (dry_run != 0) { |
if (dry_run != 0) { |
dry_run = 0; |
dry_run = 0; |
Line 413 twist_option(char *value, struct request |
|
Line 425 twist_option(char *value, struct request |
|
|
|
/* rfc931_option - look up remote user name */ |
/* rfc931_option - look up remote user name */ |
|
|
static void |
static void rfc931_option(value, request) |
rfc931_option(char *value, struct request_info *request) |
char *value; |
|
struct request_info *request; |
{ |
{ |
int timeout; |
int timeout; |
char junk; |
char junk; |
Line 431 rfc931_option(char *value, struct reques |
|
Line 444 rfc931_option(char *value, struct reques |
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
|
|
static void |
static void setenv_option(value, request) |
setenv_option(char *value, struct request_info *request) |
char *value; |
|
struct request_info *request; |
{ |
{ |
char *var_value; |
char *var_value; |
|
|
Line 448 setenv_option(char *value, struct reques |
|
Line 462 setenv_option(char *value, struct reques |
|
*/ |
*/ |
|
|
struct syslog_names { |
struct syslog_names { |
const char *name; |
char *name; |
int value; |
int value; |
}; |
}; |
|
|
static const struct syslog_names log_fac[] = { |
static struct syslog_names log_fac[] = { |
#ifdef LOG_KERN |
#ifdef LOG_KERN |
{ "kern", LOG_KERN }, |
{ "kern", LOG_KERN }, |
#endif |
#endif |
Line 513 static const struct syslog_names log_fac |
|
Line 527 static const struct syslog_names log_fac |
|
{ NULL, 0 } |
{ NULL, 0 } |
}; |
}; |
|
|
static const struct syslog_names log_sev[] = { |
static struct syslog_names log_sev[] = { |
#ifdef LOG_EMERG |
#ifdef LOG_EMERG |
{ "emerg", LOG_EMERG }, |
{ "emerg", LOG_EMERG }, |
#endif |
#endif |
Line 543 static const struct syslog_names log_sev |
|
Line 557 static const struct syslog_names log_sev |
|
|
|
/* severity_map - lookup facility or severity value */ |
/* severity_map - lookup facility or severity value */ |
|
|
static int |
static int severity_map(table, name) |
severity_map(const struct syslog_names *table, char *name) |
struct syslog_names *table; |
|
char *name; |
{ |
{ |
const struct syslog_names *t; |
struct syslog_names *t; |
|
|
for (t = table; t->name; t++) |
for (t = table; t->name; t++) |
if (STR_EQ(t->name, name)) |
if (STR_EQ(t->name, name)) |
Line 560 severity_map(const struct syslog_names * |
|
Line 575 severity_map(const struct syslog_names * |
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
|
|
static void |
static void severity_option(value, request) |
severity_option(char *value, struct request_info *request) |
char *value; |
|
struct request_info *request; |
{ |
{ |
char *level = split_at(value, '.'); |
char *level = split_at(value, '.'); |
|
|
Line 572 severity_option(char *value, struct requ |
|
Line 588 severity_option(char *value, struct requ |
|
|
|
/* get_field - return pointer to next field in string */ |
/* get_field - return pointer to next field in string */ |
|
|
static char * |
static char *get_field(string) |
get_field(char *string) |
char *string; |
{ |
{ |
static char nul = '\0'; |
static char *last = ""; |
static char *last = &nul; |
|
char *src; |
char *src; |
char *dst; |
char *dst; |
char *ret; |
char *ret; |
Line 616 get_field(char *string) |
|
Line 631 get_field(char *string) |
|
|
|
/* chop_string - strip leading and trailing blanks from string */ |
/* chop_string - strip leading and trailing blanks from string */ |
|
|
static char * |
static char *chop_string(string) |
chop_string(register char *string) |
register char *string; |
{ |
{ |
char *start = NULL; |
char *start = NULL; |
char *end = NULL; |
char *end = NULL; |