+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
=====================
-3.0alpha1
\ No newline at end of file
+3.0dev
\ No newline at end of file
return 1;
}
- if (afp_config_parse(&obj) != 0)
+ if (afp_config_parse(&obj, "") != 0)
return 1;
setuplog("default:note", "/dev/tty");
[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
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)
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\" \
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,
/* 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);
* 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;
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 );
}
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);
}
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);
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) );
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);
#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 *));
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
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
#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>
#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' )
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;
}
#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>
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/") );
/*!
* 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;
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;
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);
/* 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)
-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"
])
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],
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])
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
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])
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
])
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
-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\" \
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
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) );