]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/afp_options.c
Merge from branch-2-1
[netatalk.git] / etc / afpd / afp_options.c
index 1bc1ebe1265982cdb5ca3d6bc534eccc6f66b9b1..ca1a040d338a4f260c34728a00764e331874da93 100644 (file)
@@ -153,6 +153,8 @@ void afp_options_free(struct afp_options *opt,
        free(opt->ntdomain);
     if (opt->ntseparator && (opt->ntseparator != save->ntseparator))
        free(opt->ntseparator);
+    if (opt->logconfig && (opt->logconfig != save->logconfig))
+       free(opt->logconfig);
 }
 
 /* initialize options */
@@ -165,6 +167,7 @@ void afp_options_init(struct afp_options *options)
     options->systemvol.name = _PATH_AFPDSYSVOL;
     options->configfile = _PATH_AFPDCONF;
     options->sigconffile = _PATH_AFPDSIGCONF;
+    options->uuidconf = _PATH_AFPDUUIDCONF;
     options->uampath = _PATH_AFPDUAMPATH;
     options->uamlist = "uams_dhx.so,uams_dhx2.so";
     options->guest = "nobody";
@@ -196,6 +199,8 @@ void afp_options_init(struct afp_options *options)
     options->flags |= OPTION_NOSLP;
 #endif
     options->dircachesize = DEFAULT_MAX_DIRCACHE_SIZE;
+    options->flags |= OPTION_ACL2MACCESS;
+    options->flags |= OPTION_UUID;
 }
 
 /* parse an afpd.conf line. i'm doing it this way because it's
@@ -221,7 +226,10 @@ int afp_options_parseline(char *buf, struct afp_options *options)
     if (strstr(buf, " -slp"))
         options->flags &= ~OPTION_NOSLP;
 #endif
-
+#ifdef USE_ZEROCONF
+    if (strstr(buf, " -nozeroconf"))
+        options->flags |= OPTION_NOZEROCONF;
+#endif
     if (strstr(buf, " -nouservolfirst"))
         options->flags &= ~OPTION_USERVOLFIRST;
     if (strstr(buf, " -uservolfirst"))
@@ -238,6 +246,8 @@ int afp_options_parseline(char *buf, struct afp_options *options)
         options->flags |= OPTION_CUSTOMICON;
     if (strstr(buf, " -advertise_ssh"))
         options->flags |= OPTION_ANNOUNCESSH;
+    if (strstr(buf, " -noacl2maccess"))
+        options->flags &= ~OPTION_ACL2MACCESS;
 
     /* passwd bits */
     if (strstr(buf, " -nosavepassword"))
@@ -282,8 +292,22 @@ int afp_options_parseline(char *buf, struct afp_options *options)
         options->defaultvol.name = opt;
     if ((c = getoption(buf, "-systemvol")) && (opt = strdup(c)))
         options->systemvol.name = opt;
-    if ((c = getoption(buf, "-loginmesg")) && (opt = strdup(c)))
+    if ((c = getoption(buf, "-loginmesg")) && (opt = strdup(c))) {
+        int i = 0, j = 0;
+        while (c[i]) {
+            if (c[i] != '\\') {
+                opt[j++] = c[i];
+            } else {
+                i++;
+                if (c[i] == 'n')
+                    opt[j++] = '\n';
+            }
+            i++;
+        }
+        opt[j] = 0;
         options->loginmesg = opt;
+        
+    }
     if ((c = getoption(buf, "-guestname")) && (opt = strdup(c)))
         options->guest = opt;
     if ((c = getoption(buf, "-passwdfile")) && (opt = strdup(c)))
@@ -333,6 +357,7 @@ int afp_options_parseline(char *buf, struct afp_options *options)
         char *optstr;
         if ((optstr = getoption(c, "-setuplog"))) {
             setuplog(optstr);
+            options->logconfig = optstr; /* at least store the last (possibly only) one */
             c += sizeof("-setuplog");
         }
     }
@@ -478,11 +503,14 @@ static void show_version( void )
        puts( "No" );
 #endif
 
-       printf( "      Transport layers:\t" );
+        printf( "        TCP/IP Support:\t" );
+        puts( "Yes" );
+
+       printf( "DDP(AppleTalk) Support:\t" );
 #ifdef NO_DDP
-       puts( "TCP/IP" );
+       puts( "No" );
 #else
-       puts( "TCP/IP DDP" );
+       puts( "Yes" );
 #endif
 
        printf( "         CNID backends:\t" );
@@ -529,6 +557,13 @@ static void show_version_extended(void )
        puts( "No" );
 #endif
 
+       printf( "      Zeroconf support:\t" );
+#ifdef USE_ZEROCONF
+       puts( "Yes" );
+#else
+       puts( "No" );
+#endif
+
        printf( "  TCP wrappers support:\t" );
 #ifdef TCPWRAP
        puts( "Yes" );
@@ -577,6 +612,23 @@ static void show_version_extended(void )
 #else
        puts( "No" );
 #endif
+
+       printf( "           ACL support:\t" );
+#ifdef HAVE_ACLS
+       puts( "Yes" );
+#else
+       puts( "No" );
+#endif
+
+       printf( "            EA support:\t" );
+       puts( EA_MODULES );
+
+       printf( "          LDAP support:\t" );
+#ifdef HAVE_LDAP
+       puts( "Yes" );
+#else
+       puts( "No" );
+#endif
 }
 
 /*