]> arthur.barton.de Git - netatalk.git/commitdiff
Merge branch 'develop' into ad_set
authorFrank Lahm <franklahm@googlemail.com>
Wed, 11 Apr 2012 08:26:52 +0000 (10:26 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Wed, 11 Apr 2012 08:26:52 +0000 (10:26 +0200)
24 files changed:
NEWS
VERSION
bin/ad/ad.c
config/afp.conf.tmpl
configure.ac
etc/afpd/Makefile.am
etc/afpd/afp_avahi.c
etc/afpd/main.c
etc/afpd/messages.c
etc/afpd/volume.c
etc/cnid_dbd/cmd_dbd.c
etc/cnid_dbd/cnid_metad.c
etc/cnid_dbd/main.c
etc/netatalk/netatalk.c
include/atalk/netatalk_conf.h
libatalk/acl/Makefile.am
libatalk/unicode/charcnv.c
libatalk/util/netatalk_conf.c
macros/gssapi-check.m4
macros/netatalk.m4
macros/summary.m4
man/man5/afp.conf.5.tmpl
test/afpd/Makefile.am
test/afpd/test.c

diff --git a/NEWS b/NEWS
index c6f50991886bc6096be179465fcc6e83aa202edd..854d591cbc33ba74c8618804949a2c7aa660ab92 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+Changes in 3.0 alpha3
+=====================
+
+* NEW: afpd: Per volume "login message", NetAFP bug ID #18
+* UPD: unix charset is UTF8 by default
+       vol charset is same value as unix charset by default
+
 Changes in 3.0 alpha2
 =====================
 
diff --git a/VERSION b/VERSION
index 2f1303b0f3a0e3b9a0a5d24da2385c671cb021eb..48898d6a616ca58a9e8798ab09639b25511eaf08 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.0alpha1
\ No newline at end of file
+3.0dev
\ No newline at end of file
index 3433e1b624c692340ae3f2e81c5cba7093a64a26..083bb62ae3905f0562706ea06dc986e92b5e6902 100644 (file)
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
         return 1;
     }
 
-    if (afp_config_parse(&obj) != 0)
+    if (afp_config_parse(&obj, "") != 0)
         return 1;
 
     setuplog("default:note", "/dev/tty");
index a70b1b3e13f07594a7dcc2d0059765cf06cfe696..b2ee186ab2244423d7b82c38a314ee6c1cff4d75 100644 (file)
@@ -5,11 +5,8 @@
 [Global]
 ; Global server settings
 
-    unix charset = UTF8
-    vol charset = UTF8
-    mac charset = MAC_ROMAN
-
+; [Homes]
+; basedir regex = /xxxx
 
 ; [My AFP Volume]
-;
 ; path = /path/to/volume
index e9b1c072412912dad6fa04c8a7263e7bf0594b1e..484a0dedf8f72eec16f52a88100b55b3cc9c4fb4 100644 (file)
@@ -201,7 +201,7 @@ AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
 AM_CONDITIONAL(HAVE_LIBGCRYPT, test x$neta_cv_have_libgcrypt = xyes)
 AM_CONDITIONAL(HAVE_OPENSSL, test x$neta_cv_have_openssl = xyes)
 AM_CONDITIONAL(HAVE_ACLS, test x"$with_acl_support" = x"yes")
-AM_CONDITIONAL(HAVE_LDAP, test x"$with_ldap" = x"yes")
+AM_CONDITIONAL(HAVE_LDAP, test x"$netatalk_cv_ldap" = x"yes")
 AM_CONDITIONAL(USE_DHX, test x$neta_cv_compile_dhx = xyes)
 AM_CONDITIONAL(USE_DHX2, test x$neta_cv_compile_dhx2 = xyes)
 AM_CONDITIONAL(USE_RANDNUM, test x$neta_cv_have_openssl = xyes)
index fdd2e58aaa4dc27562a1019b1b001e8b9450aa43..85b51dc86bdca8971ecb85ce94c66c1273c28e21 100644 (file)
@@ -45,12 +45,12 @@ afpd_SOURCES = \
 
 afpd_LDADD =  \
        $(top_builddir)/libatalk/libatalk.la \
-       @LIBGCRYPT_LIBS@ @QUOTA_LIBS@ @WRAP_LIBS@ @LIBADD_DL@ @ACL_LIBS@ @ZEROCONF_LIBS@ @PTHREAD_LIBS@ @GSSAPI_LIBS@
+       @LIBGCRYPT_LIBS@ @QUOTA_LIBS@ @WRAP_LIBS@ @LIBADD_DL@ @ACL_LIBS@ @ZEROCONF_LIBS@ @PTHREAD_LIBS@ @GSSAPI_LIBS@ @KRB5_LIBS@
 
 afpd_LDFLAGS = -export-dynamic
 
 afpd_CFLAGS = \
-       @ZEROCONF_CFLAGS@ @GSSAPI_CFLAGS@ \
+       @ZEROCONF_CFLAGS@ @GSSAPI_CFLAGS@ @KRB5_CFLAGS@\
        -DAPPLCNAME \
        -DSERVERTEXT=\"$(SERVERTEXT)/\" \
        -D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\" \
index bbd95cad880b69add4af1913c0d7ab7e0a87567f..eb38935a1d93ee99083f1362bb3cbf3820d5fc55 100644 (file)
@@ -94,7 +94,7 @@ static void register_stuff(void) {
         for (dsi = ctx->obj->dsi; dsi; dsi = dsi->next) {
             port = getip_port((struct sockaddr *)&dsi->server);
 
-            LOG(log_error, logtype_afpd, "hostname: %s", ctx->obj->options.hostname);
+            LOG(log_info, logtype_afpd, "hostname: %s", ctx->obj->options.hostname);
 
             if (convert_string(ctx->obj->options.unixcharset,
                                CH_UTF8,
index 9f45b5b23f68bd7e6d61934e83ae89b8263b9e6e..550a809f82a61ca7c8f85b3d001a16fc1d3e62cd 100644 (file)
@@ -225,12 +225,9 @@ int main(int ac, char **av)
     /* Log SIGBUS/SIGSEGV SBT */
     fault_setup(NULL);
 
-    if (afp_config_parse(&obj) != 0)
+    if (afp_config_parse(&obj, "afpd") != 0)
         afp_exit(EXITERR_CONF);
 
-    set_processname("afpd");
-    setuplog(obj.options.logconfig, obj.options.logfile);
-
     /* Save the user's current umask */
     obj.options.save_mask = umask(obj.options.umask);
 
index e2dd1535c443a60a13a35d353603721a30b77e55..241f0d08166a166ed2a4b22f8d8b5e088c0b7876 100644 (file)
@@ -133,10 +133,11 @@ int afp_getsrvrmesg(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, siz
          * it has asked the login msg...
          * Workaround: concatenate the two if any, ugly.
          */
-        if (*message && *obj->options.loginmesg) {
-            strlcat(message, " - ", MAXMESGSIZE);
+        if (obj->options.loginmesg) {
+            if (*message)
+                strlcat(message, " - ", MAXMESGSIZE);
+            strlcat(message, obj->options.loginmesg, MAXMESGSIZE);
         }
-        strlcat(message, obj->options.loginmesg, MAXMESGSIZE);
         break;
     case AFPMESG_SERVER: /* server */
         break;
index 61d744ca70cdc980d21b98734a06b25682e3e1d9..56398145557272778651efd7b4c1a6d6e9bc12a7 100644 (file)
@@ -871,6 +871,14 @@ int afp_openvol(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t
                 goto openvol_err;
             }
         }
+
+        char *msg;
+        if ((msg = iniparser_getstrdup(obj->iniconfig, volume->v_configname, "login message",  NULL)) != NULL) {
+            if (obj->options.loginmesg)
+                free(obj->options.loginmesg);
+            obj->options.loginmesg = msg;
+        }
+
         return( AFP_OK );
     }
 
index 7a1614f7ac4c4f549101e4d9ae85a01489c56a89..70f0014ebddc1d94eb1bd49fe83977ca098cf984 100644 (file)
@@ -258,7 +258,7 @@ int main(int argc, char **argv)
         setuplog("default:debug", "/dev/tty");
 
     /* Load config */
-    if (afp_config_parse(&obj) != 0) {
+    if (afp_config_parse(&obj, "") != 0) {
         dbd_log( LOGSTD, "Couldn't load afp.conf");
         exit(EXIT_FAILURE);
     }
index b140fd0945cd23661c686e56ab4d18eceb86d008..7cfd3da8a5a466baa2540bf6b02db54641793b1b 100644 (file)
@@ -499,12 +499,9 @@ int main(int argc, char *argv[])
     if (!debug && daemonize(0, 0) != 0)
         exit(EXITERR_SYS);
 
-    if (afp_config_parse(&obj) != 0)
+    if (afp_config_parse(&obj, "cnid_metad") != 0)
         daemon_exit(1);
 
-    set_processname("cnid_metad");
-    setuplog(obj.options.logconfig, obj.options.logfile);
-
     if (load_volumes(&obj, NULL) != 0)
         daemon_exit(1);
 
index a5fbb2a23985438ccc878a0044816cc46013c421..8ed0e5ff2bcd37796511c3094689ce3b7dfb6da8 100644 (file)
@@ -312,10 +312,7 @@ int main(int argc, char *argv[])
         exit(EXIT_FAILURE);
     }
 
-    EC_ZERO( afp_config_parse(&obj) );
-
-    set_processname("cnid_dbd");
-    setuplog(obj.options.logconfig, obj.options.logfile);
+    EC_ZERO( afp_config_parse(&obj, "cnid_dbd") );
 
     EC_ZERO( load_volumes(&obj, NULL) );
     EC_NULL( vol = getvolbypath(&obj, volpath) );
index 3d052f46d3897100895ec85c301a47d339125790..f2a94102470e85e8527701d618df39626359ea7e 100644 (file)
@@ -272,11 +272,9 @@ int main(int argc, char **argv)
     sigfillset(&blocksigs);
     sigprocmask(SIG_SETMASK, &blocksigs, NULL);
     
-    if (afp_config_parse(&obj) != 0)
+    if (afp_config_parse(&obj, "netatalk") != 0)
         netatalk_exit(EXITERR_CONF);
 
-    set_processname("netatalk");
-    setuplog(obj.options.logconfig, obj.options.logfile);
     event_set_log_callback(libevent_logmsg_cb);
     event_set_fatal_callback(netatalk_exit);
 
index 5715df748fed5f9c05198a0a8b4d3b59db61aeaa..a9ece1a1c6fafeea75011e6f3a526c26da5b66b5 100644 (file)
@@ -20,7 +20,7 @@
 #include <atalk/globals.h>
 #include <atalk/volume.h>
 
-extern int        afp_config_parse(AFPObj *obj);
+extern int        afp_config_parse(AFPObj *obj, char *processname);
 
 extern int        load_charset(struct vol *vol);
 extern int        load_volumes(AFPObj *obj, void (*delvol_fn)(struct vol *));
@@ -31,4 +31,6 @@ extern struct vol *getvolbypath(AFPObj *obj, const char *path);
 extern struct vol *getvolbyname(const char *name);
 extern void       volume_free(struct vol *vol);
 extern void       volume_unlink(struct vol *volume);
+
+extern char* charset_names[];
 #endif
index e7f9753aca68a1400cd41dd409dc5744e8478463..52a409eba311a8e9029f9e042c77f06af84d9cd4 100644 (file)
@@ -5,9 +5,11 @@ noinst_HEADERS = aclldap.h cache.h
 noinst_LTLIBRARIES = libacl.la
 libacl_la_SOURCES = cache.c unix.c uuid.c
 libacl_la_LDFLAGS =
+libacl_la_LIBADD  =
 
 if HAVE_LDAP
 libacl_la_SOURCES += ldap.c ldap_config.c
-libacl_la_LDFLAGS += -lldap
+libacl_la_LIBADD  += @LDAP_LIBS@
+libacl_la_LDFLAGS += @LDAP_LDLFLAGS@
 endif
 
index 455a72622ef9fb0f2aa7543aec6bfe6feb651c57..d3b5fee6e8bd1156b3ca57ef45ab74e05516d78d 100644 (file)
 #ifdef HAVE_USABLE_ICONV
 #include <iconv.h>
 #endif
-#if HAVE_LOCALE_H
-#include <locale.h>
-#endif
-#if HAVE_LANGINFO_H
-#include <langinfo.h>
-#endif
 #include <arpa/inet.h>
 
 #include <atalk/logger.h>
@@ -73,7 +67,7 @@
 #define CHECK_FLAGS(a,b) (((a)!=NULL) ? (*(a) & (b)) : 0 )
 
 static atalk_iconv_t conv_handles[MAX_CHARSETS][MAX_CHARSETS];
-static char* charset_names[MAX_CHARSETS];
+char* charset_names[MAX_CHARSETS];
 static struct charset_functions* charsets[MAX_CHARSETS];
 static char hexdig[] = "0123456789abcdef";
 #define hextoint( c )   ( isdigit( c ) ? c - '0' : c + 10 - 'a' )
@@ -85,67 +79,11 @@ static char hexdig[] = "0123456789abcdef";
 static const char *charset_name(charset_t ch)
 {
     const char *ret = NULL;
-    static int first = 1;
-    static char macname[128];
-    static char unixname[128];
-
-    if (first) {
-        memset(macname, 0, sizeof(macname));
-        memset(unixname, 0, sizeof(unixname));
-        first = 0;
-    }
 
     if (ch == CH_UCS2) ret = "UCS-2";
     else if (ch == CH_UTF8) ret = "UTF8";
     else if (ch == CH_UTF8_MAC) ret = "UTF8-MAC";
-    else if (ch == CH_UNIX) {
-        if (unixname[0] == '\0') {
-            ret = "LOCALE";
-            strlcpy(unixname, ret, sizeof(unixname));
-        }
-        else
-            ret = unixname;
-    }
-    else if (ch == CH_MAC) {
-        if (macname[0] == '\0') {
-            ret = "MAC_ROMAN";
-            strlcpy(macname, ret, sizeof(macname));
-        }
-        else
-            ret = macname;
-    }
-
-    if (!ret)
-        ret = charset_names[ch];
-
-#if defined(CODESET)
-    if (ret && strcasecmp(ret, "LOCALE") == 0) {
-        const char *ln = NULL;
-
-        setlocale(LC_ALL, "");
-        ln = nl_langinfo(CODESET);
-        if (ln) {
-            /* Check whether the charset name is supported
-               by iconv */
-            LOG(log_debug, logtype_default, "Locale charset is '%s'", ln);
-            atalk_iconv_t handle = atalk_iconv_open(ln, "UCS-2");
-            if (handle == (atalk_iconv_t) -1) {
-                LOG(log_warning, logtype_default, "Locale charset '%s' unsupported, using ASCII instead", ln);
-                ln = "ASCII";
-            } else {
-                atalk_iconv_close(handle);
-            }
-            if (ch==CH_UNIX)
-                strlcpy(unixname, ln, sizeof(unixname));
-        }
-        ret = ln;
-    }
-#else /* system doesn't have LOCALE support */
-    LOG(log_warning, logtype_default, "system doesn't have LOCALE support");
-    if (ch == CH_UNIX) ret = NULL;
-#endif
-
-    if (!ret || !*ret) ret = "ASCII";
+    else ret = charset_names[ch];
     return ret;
 }
 
index a75ded21b552486f505da5e87bcc5fb5f624053a..26c80f112e4812b86b51ec953d21492c533bab7b 100644 (file)
 #include <inttypes.h>
 #include <time.h>
 #include <regex.h>
+#if HAVE_LOCALE_H
+#include <locale.h>
+#endif
+#if HAVE_LANGINFO_H
+#include <langinfo.h>
+#endif
 
 #include <atalk/afp.h>
 #include <atalk/util.h>
@@ -626,16 +632,24 @@ static struct vol *creatvol(AFPObj *obj,
         EC_NULL( volume->v_veto = strdup(val) );
 
     /* vol charset is in [G] and [V] */
-    if (val = getoption(obj->iniconfig, section, "vol charset", preset, NULL))
+    if (val = getoption(obj->iniconfig, section, "vol charset", preset, NULL)) {
+        if (strcasecmp(val, "UTF-8") == 0) {
+            val = strdup("UTF8");
+        }
         EC_NULL( volume->v_volcodepage = strdup(val) );
+    }
     else
         EC_NULL( volume->v_volcodepage = strdup(obj->options.volcodepage) );
 
     /* mac charset is in [G] and [V] */
-    if (val = getoption(obj->iniconfig, section, "mac charset", preset, NULL))
+    if (val = getoption(obj->iniconfig, section, "mac charset", preset, NULL)) {
+        if (strncasecmp(val, "MAC", 3) != 0) {
+            LOG(log_warning, logtype_afpd, "Is '%s' really mac charset? ", val);
+        }
         EC_NULL( volume->v_maccodepage = strdup(val) );
+    }
     else
-        EC_NULL( volume->v_maccodepage = strdup(obj->options.maccodepage) );
+    EC_NULL( volume->v_maccodepage = strdup(obj->options.maccodepage) );
 
     bstring dbpath;
     EC_NULL_LOG( val = iniparser_getstring(obj->iniconfig, INISEC_GLOBAL, "vol dbpath", _PATH_STATEDIR "CNID/") );
@@ -1380,7 +1394,7 @@ struct vol *getvolbyname(const char *name)
 /*!
  * Initialize an AFPObj and options from ini config file
  */
-int afp_config_parse(AFPObj *AFPObj)
+int afp_config_parse(AFPObj *AFPObj, char *processname)
 {
     EC_INIT;
     dictionary *config;
@@ -1404,6 +1418,11 @@ int afp_config_parse(AFPObj *AFPObj)
     options->logconfig = iniparser_getstrdup(config, INISEC_GLOBAL, "log level", "default:note");
     options->logfile   = iniparser_getstrdup(config, INISEC_GLOBAL, "log file",  NULL);
 
+    if (processname[0] != '\0') {
+        set_processname(processname);
+        setuplog(options->logconfig, options->logfile);
+    }
+
     /* "server options" boolean options */
     if (!iniparser_getboolean(config, INISEC_GLOBAL, "zeroconf", 1))
         options->flags |= OPTION_NOZEROCONF;
@@ -1427,7 +1446,7 @@ int afp_config_parse(AFPObj *AFPObj)
         options->passwdbits |= PASSWD_SET;
 
     /* figure out options w values */
-    options->loginmesg      = iniparser_getstrdup(config, INISEC_GLOBAL, "login message",      "");
+    options->loginmesg      = iniparser_getstrdup(config, INISEC_GLOBAL, "login message",  NULL);
     options->guest          = iniparser_getstrdup(config, INISEC_GLOBAL, "guest account",  "nobody");
     options->passwdfile     = iniparser_getstrdup(config, INISEC_GLOBAL, "passwd file",_PATH_AFPDPWFILE);
     options->uampath        = iniparser_getstrdup(config, INISEC_GLOBAL, "uam path",       _PATH_AFPDUAMPATH);
@@ -1513,38 +1532,52 @@ int afp_config_parse(AFPObj *AFPObj)
 
     /* unix charset is in [G] only */
     if (!(p = iniparser_getstring(config, INISEC_GLOBAL, "unix charset", NULL))) {
-        options->unixcharset = CH_UNIX;
-        options->unixcodepage = strdup("LOCALE");
+        options->unixcodepage = strdup("UTF8");
+        charset_names[CH_UNIX] = strdup("UTF8");
     } else {
-        if ((options->unixcharset = add_charset(p)) == (charset_t)-1) {
-            options->unixcharset = CH_UNIX;
-            options->unixcodepage = strdup("LOCALE");
-            LOG(log_warning, logtype_afpd, "Setting unix charset to '%s' failed", p);
-        } else {
-            options->unixcodepage = strdup(p);
+        if (strcasecmp(p, "LOCALE") == 0) {
+#if defined(CODESET)
+            setlocale(LC_ALL, "");
+            p = nl_langinfo(CODESET);
+            LOG(log_debug, logtype_afpd, "Locale charset is '%s'", p);
+#else /* system doesn't have LOCALE support */
+            LOG(log_warning, logtype_afpd, "system doesn't have LOCALE support");
+            p = strdup("UTF8");
+#endif
         }
+        if (strcasecmp(p, "UTF-8") == 0) {
+            p = strdup("UTF8");
+        }
+        options->unixcodepage = strdup(p);
+        charset_names[CH_UNIX] = strdup(p);
     }
+    options->unixcharset = CH_UNIX;
+    LOG(log_debug, logtype_afpd, "Global unix charset is %s", options->unixcodepage);
 
-    /* vol charset is in [G[ and [V] */
+    /* vol charset is in [G] and [V] */
     if (!(p = iniparser_getstring(config, INISEC_GLOBAL, "vol charset", NULL))) {
-        options->volcodepage = strdup("UTF8");
+        options->volcodepage = strdup(options->unixcodepage);
     } else {
+        if (strcasecmp(p, "UTF-8") == 0) {
+            p = strdup("UTF8");
+        }
         options->volcodepage = strdup(p);
     }
-       
+    LOG(log_debug, logtype_afpd, "Global vol charset is %s", options->volcodepage);
+    
     /* mac charset is in [G] and [V] */
     if (!(p = iniparser_getstring(config, INISEC_GLOBAL, "mac charset", NULL))) {
-        options->maccharset = CH_MAC;
         options->maccodepage = strdup("MAC_ROMAN");
+        charset_names[CH_MAC] = strdup("MAC_ROMAN");
     } else {
-        if ((options->maccharset = add_charset(p)) == (charset_t)-1) {
-            options->maccharset = CH_MAC;
-            options->maccodepage = strdup("MAC_ROMAN");
-            LOG(log_warning, logtype_afpd, "Setting mac charset to '%s' failed", p);
-        } else {
-            options->maccodepage = strdup(p);
+        if (strncasecmp(p, "MAC", 3) != 0) {
+            LOG(log_warning, logtype_afpd, "Is '%s' really mac charset? ", p);
         }
+        options->maccodepage = strdup(p);
+        charset_names[CH_MAC] = strdup(p);
     }
+    options->maccharset = CH_MAC;
+    LOG(log_debug, logtype_afpd, "Global mac charset is %s", options->maccodepage);
 
     /* Check for sane values */
     if (options->tickleval <= 0)
index 9f738be994b844e7da3279bf1be45bea1ab2ab45..ab1140e2cf2791be0d62369d6ede5c9fe12ea958 100644 (file)
-dnl $Id: gssapi-check.m4,v 1.3 2005-04-28 20:50:05 bfernhomberg Exp $
 dnl Autoconf macro to check for kerberos
 
 AC_DEFUN([NETATALK_GSSAPI_CHECK], 
 [
-       FOUND_GSSAPI=no
-       GSSAPI_LIBS=""
-       GSSAPI_CFLAGS=""
-
-        AC_ARG_WITH(gssapi,
-                [  --with-gssapi[[=PATH]]    path to GSSAPI for Kerberos V UAM [[auto]]],
-                [compilegssapi=$withval],
-                [compilegssapi=auto]
-        )
-
-       if test x"$compilegssapi" != x"no"; then
+    FOUND_GSSAPI=no
+    GSSAPI_LIBS=""
+    GSSAPI_CFLAGS=""
+    GSSAPI_LDFLAGS=""
+    save_CFLAGS=$CFLAGS
+    save_LDFLAGS=$LDFLAGS
+    save_LIBS=$LIBS
+    export CFLAGS=""
+    export LDFLAGS=""
+    export LIBS=""
+
+    AC_ARG_WITH(gssapi,
+        [  --with-gssapi[[=PATH]]    path to GSSAPI for Kerberos V UAM [[auto]]],
+        [compilegssapi=$withval],
+        [compilegssapi=auto]
+    )
+
+    if test x"$compilegssapi" != x"no" ; then
+        if test "x$compilegssapi" != "xyes" -a "x$compilegssapi" != "xauto" ; then
+            export CFLAGS="-I$withval/include"
+            export LDFLAGS="-L$withval/${atalk_libname}"
+            AC_MSG_NOTICE([checking for GSSAPI support in $compilegssapi])
+        fi
 
-                if test "x$compilegssapi" != "xyes" -a "x$compilegssapi" != "xauto"; then
-                       GSSAPI_CFLAGS="-I$withval/include"
-                       GSSAPI_CPPFLAGS="-I$withval/include"
-                       GSSAPI_LDFLAGS="-L$withval/${atalk_libname}"
-                       FOUND_GSSAPI=yes
-                       AC_MSG_CHECKING([checking for GSSAPI support in])
-                       AC_MSG_RESULT([$compilegssapi])
+        if test x"$compilegssapi" = x"yes" -o x"$compilegssapi" = x"auto" ; then
+            # check for krb5-config from recent MIT and Heimdal kerberos 5
+            AC_PATH_PROG(KRB5_CONFIG, krb5-config)
+            AC_MSG_CHECKING([for working krb5-config that takes --libs gssapi])
+
+            if test -x "$KRB5_CONFIG" ; then 
+                TEMP="`$KRB5_CONFIG --libs gssapi`"
+                if test $? -eq 0 ; then 
+                    GSSAPI_CFLAGS="`$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`"
+                    GSSAPI_LIBS="$TEMP"
+                    FOUND_GSSAPI=yes
+                    AC_MSG_RESULT(yes)
+                else
+                    AC_MSG_RESULT(no. Fallback to previous krb5 detection strategy)
                 fi
-
-
-         # Do no harm to the values of CFLAGS and LIBS while testing for
-         # Kerberos support.
-
-               save_CFLAGS=$CFLAGS
-               save_CPPFLAGS=$CPPFLAGS
-               save_LDFLAGS=$LDFLAGS
-               save_LIBS=$LIBS
-
-       if test x$FOUND_GSSAPI = x"no"; then
-         #################################################
-         # check for krb5-config from recent MIT and Heimdal kerberos 5
-         AC_PATH_PROG(KRB5_CONFIG, krb5-config)
-         AC_MSG_CHECKING(for working krb5-config)
-         if test -x "$KRB5_CONFIG"; then
-           TEMP="`$KRB5_CONFIG --libs gssapi`"
-        if test $? -eq 0 ; then
-               save_CFLAGS=$CFLAGS
-               CFLAGS="";export CFLAGS
-               save_LDFLAGS=$LDFLAGS
-               LDFLAGS="";export LDFLAGS
-               GSSAPI_CFLAGS="`$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`"
-               GSSAPI_CPPFLAGS="`$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`"
-            GSSAPI_LIBS="$TEMP"
-               CFLAGS=$save_CFLAGS;export CFLAGS
-               LDFLAGS=$save_LDFLAGS;export LDFLAGS
-               FOUND_GSSAPI=yes
-               AC_MSG_RESULT(yes)
+            else
+                AC_MSG_RESULT(no. Fallback to previous krb5 detection strategy)
+            fi
+        fi
+    fi
+
+    if test x"$compilegssapi" != x"no" -a x"$FOUND_GSSAPI" = x"no" ; then
+        # check for gssapi headers
+        gss_headers_found=no
+        AC_CHECK_HEADERS(gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h gssapi/gssapi_krb5.h,
+            [gss_headers_found=yes])
+        if test x"$gss_headers_found" = x"no" ; then
+            AC_MSG_ERROR([GSSAPI installation not found, headers missing])
+        fi
+        # check for libs
+        AC_SEARCH_LIBS(gss_display_status, [gss gssapi gssapi_krb5])
+        if test x"$ac_cv_search_gss_display_status" = x"no" ; then
+            AC_MSG_ERROR([GSSAPI installation not found, library missing])
+        fi
+        GSSAPI_CFLAGS=$CFLAGS
+        GSSAPI_LIBS=$LIBS
+        FOUND_GSSAPI=yes
+    fi
+
+    if test x"$FOUND_GSSAPI" = x"yes" ; then
+        # check for functions
+        export CFLAGS=$GSSAPI_CFLAGS
+        export LIBS=$GSSAPI_LIBS
+        AC_CHECK_FUNC(gss_acquire_cred, [], [AC_MSG_ERROR([GSSAPI: required function gss_acquire_cred missing])])
+
+        # Heimdal/MIT compatibility fix
+        if test "$ac_cv_header_gssapi_h" = "yes" ; then
+            AC_EGREP_HEADER(
+                GSS_C_NT_HOSTBASED_SERVICE,
+                gssapi.h,
+                AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE, 1, [Wheter GSS_C_NT_HOSTBASED_SERVICE is in gssapi.h])
+            )
         else
-               AC_MSG_RESULT(no. Fallback to previous krb5 detection strategy)
+            AC_EGREP_HEADER(
+                GSS_C_NT_HOSTBASED_SERVICE,
+                gssapi/gssapi.h,
+                AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE, 1, [Wheter GSS_C_NT_HOSTBASED_SERVICE is in gssapi.h])
+            )
         fi
-         else
-           AC_MSG_RESULT(no. Fallback to previous krb5 detection strategy)
-         fi
-       fi
-
-       if test x$FOUND_GSSAPI = x"no"; then
-       #################################################
-       # see if this box has the SuSE location for the heimdal krb implementation
-         AC_MSG_CHECKING(for /usr/include/heimdal)
-         if test -d /usr/include/heimdal; then
-           if test -f /usr/lib/heimdal/lib/libkrb5.a; then
-               GSSAPI_CFLAGS="-I/usr/include/heimdal"
-               GSSAPI_CPPFLAGS="-I/usr/include/heimdal"
-               GSSAPI_LDFLAGS="-L/usr/lib/heimdal/lib"
-               AC_MSG_RESULT(yes)
-               FOUND_GSSAPI=yes
-           else
-               GSSAPI_CFLAGS="-I/usr/include/heimdal"
-               GSSAPI_CPPFLAGS="-I/usr/include/heimdal"
-               AC_MSG_RESULT(yes)
-               FOUND_GSSAPI=yes
-           fi
-         else
-           AC_MSG_RESULT(no)
-         fi
-       fi
-
-       if test x$FOUND_GSSAPI = x"no"; then
-       #################################################
-       # see if this box has the RedHat location for kerberos
-         AC_MSG_CHECKING(for /usr/kerberos)
-         if test -d /usr/kerberos -a -f /usr/kerberos/lib/libkrb5.a; then
-               GSSAPI_LDFLAGS="-L/usr/kerberos/lib"
-               GSSAPI_CFLAGS="-I/usr/kerberos/include"
-               GSSAPI_CPPFLAGS="-I/usr/kerberos/include"
-               AC_MSG_RESULT(yes)
-         else
-               AC_MSG_RESULT(no)
-         fi
-       fi
-
-       CFLAGS="$CFLAGS $GSSAPI_CFLAGS"
-       CPPFLAGS="$CPPFLAGS $GSSAPI_CPPFLAGS"
-       LDFLAGS="$LDFLAGS $GSSAPI_LDFLAGS"
-       LIBS="$LIBS $GSSAPI_LIBS"
 
-
-       # check for gssapi headers
-
-       gss_headers_found=no
-       AC_CHECK_HEADERS(gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h gssapi/gssapi_krb5.h,[gss_headers_found=yes],[],[])
-       if test x"$gss_headers_found" = x"no"; then
-               AC_MSG_ERROR([GSSAPI installation not found, headers missing])
-       fi
-
-       # check for libs
-
-       AC_CHECK_LIB(gssapi, gss_display_status) 
-       AC_CHECK_LIB(gssapi_krb5, gss_display_status) 
-       AC_CHECK_LIB(gss, gss_display_status) 
-
-       # check for functions
-
-       AC_CHECK_FUNC(gss_acquire_cred,[],[AC_MSG_ERROR([GSSAPI: required function gss_acquire_cred missing])])
-
-       # Heimdal/MIT compatibility fix
-       if test "$ac_cv_header_gssapi_h" = "yes"; then
-           AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,1,[Wheter GSS_C_NT_HOSTBASED_SERVICE is in gssapi.h]))
-       else
-           AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,1,[Wheter GSS_C_NT_HOSTBASED_SERVICE is in gssapi.h]))
-       fi
-
-
-       AC_MSG_CHECKING(whether GSSAPI support is used)
-       if test x"$ac_cv_func_gss_acquire_cred" = x"yes"; then
-               AC_DEFINE(HAVE_GSSAPI,1,[Whether to enable GSSAPI support])
-               AC_MSG_RESULT([yes])
-               GSSAPI_LIBS="$LDFLAGS $LIBS"
-       else
-               AC_MSG_RESULT([no])
-               if test x"$compilegssapi" = x"yes"; then
-                       AC_MSG_ERROR([GSSAPI installation not found])
-               fi
-               GSSAPI_LIBS=""
-       fi
-
-        LIBS="$save_LIBS"
-        CFLAGS="$save_CFLAGS"
-        LDFLAGS="$save_LDFLAGS"
-        CPPFLAGS="$save_CPPFLAGS"
-       fi
-
-        if test x"$ac_cv_func_gss_acquire_cred" = x"yes"; then
+        AC_DEFINE(HAVE_GSSAPI, 1, [Whether to enable GSSAPI support])
+        if test x"$ac_cv_func_gss_acquire_cred" = x"yes" ; then
                 ifelse([$1], , :, [$1])
         else
                 ifelse([$2], , :, [$2])
         fi
+    fi
 
+    AC_SUBST(GSSAPI_LIBS)
+    AC_SUBST(GSSAPI_CFLAGS)
+    AC_SUBST(GSSAPI_LDFLAGS)
 
-       AC_SUBST(GSSAPI_LIBS)
-       AC_SUBST(GSSAPI_CFLAGS)
-       AC_SUBST(GSSAPI_LDFLAGS)
-
+    export LIBS="$save_LIBS"
+    export CFLAGS="$save_CFLAGS"
+    export LDFLAGS="$save_LDFLAGS"
 ])
index fb9429f2d22350f482070ffc82510f4c2b9b4a50..32ccd9e67c74fe1d6c8e0e1ea7dad6818d9d0867 100644 (file)
@@ -512,6 +512,9 @@ fi
 AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
 ])
 
+dnl Check if we can directly use Kerberos 5 API, used for reading keytabs
+dnl and automatically construction DirectoryService names from that, instead
+dnl of requiring special configuration in afp.conf
 AC_DEFUN([AC_NETATALK_KERBEROS], [
 AC_MSG_CHECKING([for Kerberos 5 (necessary for GetSrvrInfo:DirectoryNames support)])
 AC_ARG_WITH([kerberos],
@@ -531,8 +534,10 @@ if test x"$with_kerberos" != x"no"; then
    AC_MSG_CHECKING([for krb5-config])
    if test -x "$KRB5_CONFIG"; then
       AC_MSG_RESULT([$KRB5_CONFIG])
-      CFLAGS="$CFLAGS `$KRB5_CONFIG --cflags krb5`"
-      LIBS="`$KRB5_CONFIG --libs krb5` $LIBS"
+      KRB5_CFLAGS="`$KRB5_CONFIG --cflags krb5`"
+      KRB5_LIBS="`$KRB5_CONFIG --libs krb5`"
+      AC_SUBST(KRB5_CFLAGS)
+      AC_SUBST(KRB5_LIBS)
       with_kerberos="yes"
    else
       AC_MSG_RESULT([not found])
@@ -565,34 +570,47 @@ AC_MSG_CHECKING(for LDAP (necessary for client-side ACL visibility))
 AC_ARG_WITH(ldap,
     [AS_HELP_STRING([--with-ldap],
         [LDAP support (default=auto)])],
-    [ case "$withval" in
-      yes|no)
-          with_ldap="$withval"
-                 ;;
-      *)
-          with_ldap=auto
-          ;;
-      esac ])
-AC_MSG_RESULT($with_ldap)
+        netatalk_cv_ldap=$withval,
+        netatalk_cv_ldap=auto
+        )
+AC_MSG_RESULT($netatalk_cv_ldap)
+
+save_CFLAGS=$CFLAGS
+save_LDLFLAGS=$LDLFLAGS
+CFLAGS=""
+LDLFLAGS=""
 
-if test x"$with_ldap" != x"no" ; then
-       AC_CHECK_HEADER([ldap.h], with_ldap=yes,
-        [ if test x"$with_ldap" = x"yes" ; then
+if test x"$netatalk_cv_ldap" != x"no" ; then
+   if test x"$netatalk_cv_ldap" != x"yes" -a x"$netatalk_cv_ldap" != x"auto"; then
+       CFLAGS=-I$netatalk_cv_ldap/include
+       LDLFLAGS=-L$netatalk_cv_ldap/lib
+   fi
+       AC_CHECK_HEADER([ldap.h], netatalk_cv_ldap=yes,
+        [ if test x"$netatalk_cv_ldap" = x"yes" ; then
             AC_MSG_ERROR([Missing LDAP headers])
         fi
-               with_ldap=no
+               netatalk_cv_ldap=no
         ])
-       AC_CHECK_LIB(ldap, ldap_init, with_ldap=yes,
-        [ if test x"$with_ldap" = x"yes" ; then
+       AC_CHECK_LIB(ldap, ldap_init, netatalk_cv_ldap=yes,
+        [ if test x"$netatalk_cv_ldap" = x"yes" ; then
             AC_MSG_ERROR([Missing LDAP library])
         fi
-               with_ldap=no
+               netatalk_cv_ldap=no
         ])
 fi
 
-if test x"$with_ldap" = x"yes"; then
+if test x"$netatalk_cv_ldap" = x"yes"; then
+    LDAP_CFLAGS=$CFLAGS
+    LDAP_LDLFLAGS=$LDLFLAGS
+    LDAP_LIBS=-lldap
        AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available])
+    AC_SUBST(LDAP_CFLAGS)
+    AC_SUBST(LDAP_LDLFLAGS)
+    AC_SUBST(LDAP_LIBS)
 fi
+
+CFLAGS=$save_CFLAGS
+LDLFLAGS=$save_LDLFLAGS
 ])
 
 dnl Check for ACL support
index e6927be761a53d405a03667fe1c47044488e57c4..a618cf31ccacca089ec2e3a67b9b78038c0af9e9 100644 (file)
@@ -52,7 +52,7 @@ dnl   fi
        AC_MSG_RESULT([         Samba sharemode interop: $neta_cv_have_smbshmd])
        AC_MSG_RESULT([         ACL support:             $with_acl_support])
        AC_MSG_RESULT([         Kerberos support:        $with_kerberos])
-       AC_MSG_RESULT([         LDAP support:            $with_ldap])
+       AC_MSG_RESULT([         LDAP support:            $netatalk_cv_ldap])
        if test x"$use_pam_so" = x"yes" -a x"$netatalk_cv_install_pam" = x"no"; then
                AC_MSG_RESULT([])
                AC_MSG_WARN([ PAM support was configured for your system, but the netatalk PAM configuration file])
@@ -111,4 +111,9 @@ AC_DEFUN([AC_NETATALK_LIBS_SUMMARY], [
                AC_MSG_RESULT([        LIBS   = $ZEROCONF_LIBS])
                AC_MSG_RESULT([        CFLAGS = $ZEROCONF_CFLAGS])
        fi
+       if test x"$netatalk_cv_ldap" = x"yes"; then
+               AC_MSG_RESULT([    LDAP:])
+               AC_MSG_RESULT([        LIBS   = $LDAP_LDLFLAGS $LDAP_LIBS])
+               AC_MSG_RESULT([        CFLAGS = $LDAP_CFLAGS])
+       fi
 ])
index c96eddb828d95ab0c585d260245112ec3f1a9cc8..096cce0376d073393e3c1592464848ad288d2ec5 100644 (file)
@@ -624,7 +624,7 @@ guest account = \fIname\fR \fB(G)\fR
 Specifies the user that guests should use (default is "nobody")\&. The name should be quoted\&.
 .RE
 .PP
-login message = \fImessage\fR \fB(G)\fR
+login message = \fImessage\fR \fB(G)/(V)\fR
 .RS 4
 Sets a message to be displayed when clients logon to the server\&. The message should be in
 \fBunix charset\fR
index cb870d0c06813c0b561cc2b5307ae5fe9434ccb6..033c9e1d3784c3b4c0651100d0243c2aa02bf84f 100644 (file)
@@ -52,7 +52,7 @@ test_CFLAGS = \
        -I$(top_srcdir)/etc/afpd \
        -I$(top_srcdir)/include \
        -I$(top_srcdir)/sys \
-       @ZEROCONF_CFLAGS@ @GSSAPI_CFLAGS@ \
+       @ZEROCONF_CFLAGS@ @GSSAPI_CFLAGS@ @KRB5_CFLAGS@\
        -DAPPLCNAME \
        -DSERVERTEXT=\"$(SERVERTEXT)/\" \
        -D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\" \
@@ -62,6 +62,6 @@ test_CFLAGS = \
 
 test_LDADD = \
        $(top_builddir)/libatalk/libatalk.la \
-       @LIBGCRYPT_LIBS@ @QUOTA_LIBS@ @WRAP_LIBS@ @LIBADD_DL@ @ACL_LIBS@ @ZEROCONF_LIBS@ @PTHREAD_LIBS@ @GSSAPI_LIBS@
+       @LIBGCRYPT_LIBS@ @QUOTA_LIBS@ @WRAP_LIBS@ @LIBADD_DL@ @ACL_LIBS@ @ZEROCONF_LIBS@ @PTHREAD_LIBS@ @GSSAPI_LIBS@ @KRB5_LIBS@
 
 test_LDFLAGS = -export-dynamic
index 1a8830029b3c2b838b42ce2a927b1e92d6151ce7..acc46a8765b37227ec630e0efa35c49841970314 100644 (file)
@@ -64,7 +64,7 @@ int main(int argc, char **argv)
 
     TEST( afp_options_parse_cmdline(&obj, 3, &args[0]) );
 
-    TEST_int( afp_config_parse(&obj), 0);
+    TEST_int( afp_config_parse(&obj, ""), 0);
     TEST_int( configinit(&obj), 0);
     TEST( cnid_init() );
     TEST( load_volumes(&obj, NULL) );