]> arthur.barton.de Git - netatalk.git/commitdiff
options need strdup, remove a syslog call
authorbfernhomberg <bfernhomberg>
Sat, 24 Jan 2004 18:05:26 +0000 (18:05 +0000)
committerbfernhomberg <bfernhomberg>
Sat, 24 Jan 2004 18:05:26 +0000 (18:05 +0000)
etc/afpd/afp_options.c
etc/afpd/catsearch.c

index 781dc381e71a5be471cd9a4faddabd17397906e9..f75085d110002fa79d1490d4ecf6092899235319 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_options.c,v 1.30.2.2.2.4 2004-01-08 19:16:57 lenneis Exp $
+ * $Id: afp_options.c,v 1.30.2.2.2.5 2004-01-24 18:05:26 bfernhomberg Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -470,23 +470,31 @@ int afp_options_parseline(char *buf, struct afp_options *options)
             if ((opt = strdup(c)))
                 options->fqdn = opt;
         }
+       else {
+            LOG(log_error, logtype_afpd, "error parsing -fqdn, gethostbyname failed for: %s", c);
+       }
     }
 
     if ((c = getoption(buf, "-unixcodepage"))) {
-       options->unixcodepage = c;
-       if ( 0 == ( options->unixcharset = add_charset(options->unixcodepage)) ) {
-               options->unixcodepage= "LOCALE";
-               options->unixcharset = CH_UNIX;
+       if ((charset_t)-1  == ( options->unixcharset = add_charset(c)) ) {
+            options->unixcharset = CH_UNIX;
+            LOG(log_warning, logtype_afpd, "setting Unix codepage to '%s' failed", c);
        }
+       else {
+            if (opt = strdup(c))
+                options->unixcodepage = strdup(c);
+       }
     }
        
     if ((c = getoption(buf, "-maccodepage"))) {
-       options->maccodepage = c;
-       if ( 0 == ( options->maccharset = add_charset(options->maccodepage)) ) {
-               options->maccodepage= "Mac_Roman";
-               options->maccharset = CH_MAC;
+       if ((charset_t)-1 == ( options->maccharset = add_charset(c)) ) {
+            options->maccharset = CH_MAC;
+            LOG(log_warning, logtype_afpd, "setting Mac codepage to '%s' failed", c);
        }
-       LOG(log_debug, logtype_afpd, "Setting Mac Codepage to '%s'", options->maccodepage);
+       else {
+            if (opt = strdup(c))
+                options->maccodepage = strdup(c);
+       }
     }
 
     return 1;
index 83fe0e435b8e89965e71d1196bb8368ae27a7d59..207061e0cd2a653ddbdc928da1282d2e991edbb7 100644 (file)
@@ -28,7 +28,6 @@
 #include <stdlib.h>
 #include <dirent.h>
 #include <errno.h>
-#include <syslog.h>
 #include <unistd.h>
 #include <ctype.h>
 #include <string.h>
@@ -228,7 +227,7 @@ static int resolve_dir(struct vol *vol, int cidx)
 
                path.u_name = dstack[cidx].path;   
                if (of_stat(&path)==-1) {
-                       syslog(LOG_DEBUG, "resolve_dir: stat %s: %s", dstack[cidx].path, strerror(errno));
+                       LOG(log_debug, logtype_afpd, "resolve_dir: stat %s: %s", dstack[cidx].path, strerror(errno));
                        return 0;
                }
                path.m_name = dstack[cidx].m_name;