summaryrefslogtreecommitdiffabout
path: root/jabberd/main.c
authorSergey Poznyakoff <gray@gnu.org.ua>2007-06-03 12:38:34 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2007-06-03 12:38:34 (GMT)
commit9fdf3a2c68b139d6ff33400fc5d900476cdb7ea7 (patch) (side-by-side diff)
treee35b755a9fba61bb5ef04854bd4d96574a57dc78 /jabberd/main.c
parented8e810630bd1cc8595576aed11e5cffb0880de9 (diff)
downloadgsc-9fdf3a2c68b139d6ff33400fc5d900476cdb7ea7.tar.gz
gsc-9fdf3a2c68b139d6ff33400fc5d900476cdb7ea7.tar.bz2
Document jabberd
git-svn-id: file:///svnroot/gsc/trunk@252 d2de0444-eb31-0410-8365-af798a554d48
Diffstat (limited to 'jabberd/main.c') (more/less context) (ignore whitespace changes)
-rw-r--r--jabberd/main.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/jabberd/main.c b/jabberd/main.c
index e92c492..e2a00ac 100644
--- a/jabberd/main.c
+++ b/jabberd/main.c
@@ -29,7 +29,8 @@ int log_facility = LOG_LOCAL7;
int x_argc;
char **x_argv;
char *pidfile;
-unsigned long shutdown_timeout = 3;
+unsigned long shutdown_timeout = 5;
+mode_t jabberd_umask = 037;
void
syslog_printer (int prio, const char *fmt, va_list ap)
@@ -148,8 +149,8 @@ usage ()
struct kw_int
{
- char *name;
- int tok;
+ char *name;
+ int tok;
};
int
@@ -175,7 +176,8 @@ str_to_facility (char *str, int *pfacility)
static struct kw_int kw_facility[] = {
{ "USER", LOG_USER },
{ "DAEMON", LOG_DAEMON },
- { "AUTH", LOG_AUTH },
+ { "AUTH", LOG_AUTH },
+ { "AUTHPRIV",LOG_AUTHPRIV },
{ "LOCAL0", LOG_LOCAL0 },
{ "LOCAL1", LOG_LOCAL1 },
{ "LOCAL2", LOG_LOCAL2 },
@@ -354,6 +356,18 @@ cfg_pidfile (struct cfg_file *file, char *kw, char *val, void *unused)
}
void
+cfg_umask (struct cfg_file *file, char *kw, char *val, void *unused)
+{
+ char *p;
+ unsigned long n = strtoul (val, &p, 8);
+ if (*p)
+ logmsg(LOG_ERR, "%s:%u: invalid umask; stopped near `%s'", config_file,
+ file->line, p);
+ else
+ jabberd_umask = (mode_t) n;
+}
+
+void
cfg_prog (struct cfg_file *file, char *kw, char *val, void *unused)
{
char *prog = val;
@@ -468,6 +482,7 @@ struct kw_handler kw_handler[] = {
{ "user", cfg_user },
{ "group", cfg_group },
{ "pidfile", cfg_pidfile },
+ { "umask", cfg_umask },
{ "prog", cfg_prog },
{ "exec", cfg_exec },
{ "shutdown-timeout", cfg_shutdown_timeout },
@@ -799,7 +814,7 @@ main(int argc, char **argv)
logmsg (LOG_NOTICE, "jabberd not started as an absolute pathname; SIGHUP will not work");
priv_setup ();
- umask (037);
+ umask (jabberd_umask);
logmsg (LOG_NOTICE, "jabberd started");
if (!foreground && daemon (0, 0) == -1)
{

Return to:

Send suggestions and report system problems to the System administrator.