]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/afp_options.c
/tmp/log
[netatalk.git] / etc / afpd / afp_options.c
index f56b7ea1ec9f1153a0a934003eced527d6433f34..2e75bcc05f42a22df45b33f78285c834ee7526c0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_options.c,v 1.27 2002-08-24 05:00:07 sibaz Exp $
+ * $Id: afp_options.c,v 1.29 2003-01-12 14:39:57 didg Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -122,6 +122,8 @@ void afp_options_free(struct afp_options *opt,
         free(opt->nlspath);
     if (opt->passwdfile && (opt->passwdfile != save->passwdfile))
         free(opt->passwdfile);
+    if (opt->signature && (opt->signature != save->signature))
+       free(opt->signature);
 }
 
 /* initialize options */
@@ -144,6 +146,7 @@ void afp_options_init(struct afp_options *options)
     options->timeout = 4;
     options->server_notif = 1;
     options->authprintdir = NULL;
+    options->signature = "host";
     options->umask = 0;
 #ifdef ADMIN_GRP
     options->admingid = 0;
@@ -393,6 +396,8 @@ int afp_options_parseline(char *buf, struct afp_options *options)
         options->port = atoi(c);
     if ((c = getoption(buf, "-ddpaddr")))
         atalk_aton(c, &options->ddpaddr);
+    if ((c = getoption(buf, "-signature")) && (opt = strdup(c)))
+        options->signature = opt;
 
     /* do a little checking for the domain name. */
     if ((c = getoption(buf, "-fqdn"))) {
@@ -423,17 +428,17 @@ int afp_options_parse(int ac, char **av, struct afp_options *options)
         perror( "gethostname" );
         return 0;
     }
-    if (( p = strchr(options->hostname, '.' )) != 0 ) {
+    if (NULL != ( p = strchr(options->hostname, '.' )) ) {
         *p = '\0';
     }
 
-    if (( p = strrchr( av[ 0 ], '/' )) == NULL ) {
+    if (NULL == ( p = strrchr( av[ 0 ], '/' )) ) {
         p = av[ 0 ];
     } else {
         p++;
     }
 
-    while (( c = getopt( ac, av, OPTIONS )) != EOF ) {
+    while (EOF != ( c = getopt( ac, av, OPTIONS )) ) {
         switch ( c ) {
         case 'd' :
             options->flags |= OPTION_DEBUG;