]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/afp_options.c
Correct logger setup in afpd and reduce log clutter by reducing loglevel of logger...
[netatalk.git] / etc / afpd / afp_options.c
index 3ad83fe26d19d1b872ef05b7bf78413ed82aa02b..43992ed771f8f9e2d8f3c7c981cdc085cfefb2c7 100644 (file)
@@ -34,9 +34,9 @@
 #include <atalk/paths.h>
 #include <atalk/util.h>
 #include <atalk/compat.h>
+#include <atalk/globals.h>
 #include <atalk/fce_api.h>
 
-#include "globals.h"
 #include "status.h"
 #include "auth.h"
 #include "dircache.h"
@@ -240,6 +240,10 @@ int afp_options_parseline(char *buf, struct afp_options *options)
         options->flags |= OPTION_ANNOUNCESSH;
     if (strstr(buf, " -noacl2maccess"))
         options->flags &= ~OPTION_ACL2MACCESS;
+    if (strstr(buf, " -keepsessions")) {
+        default_options.flags |= OPTION_KEEPSESSIONS;
+        options->flags |= OPTION_KEEPSESSIONS;
+    }
 
     /* passwd bits */
     if (strstr(buf, " -nosavepassword"))
@@ -354,8 +358,11 @@ int afp_options_parseline(char *buf, struct afp_options *options)
     while (NULL != (c = strstr(c, "-setuplog"))) {
         char *optstr;
         if ((optstr = getoption(c, "-setuplog"))) {
+            /* hokey2: options->logconfig must be converted to store an array of logstrings */
+            if (options->logconfig)
+                free(options->logconfig);
+            options->logconfig = strdup(optstr);
             setuplog(optstr);
-            options->logconfig = optstr; /* at least store the last (possibly only) one */
             c += sizeof("-setuplog");
         }
     }
@@ -693,11 +700,14 @@ int afp_options_parse(int ac, char **av, struct afp_options *options)
         *p = '\0';
     }
 
+#ifdef ultrix
     if (NULL == ( p = strrchr( av[ 0 ], '/' )) ) {
         p = av[ 0 ];
     } else {
         p++;
     }
+    openlog( p, LOG_PID ); /* ultrix only */
+#endif /* ultrix */
 
     while (EOF != ( c = getopt( ac, av, OPTIONS )) ) {
         switch ( c ) {
@@ -789,11 +799,5 @@ int afp_options_parse(int ac, char **av, struct afp_options *options)
         exit( 2 );
     }
 
-#ifdef ultrix
-    openlog( p, LOG_PID ); /* ultrix only */
-#else
-    set_processname(p);
-#endif /* ultrix */
-
     return 1;
 }