]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/uam.c
Merge remote-tracking branch 'remotes/origin/branch-netatalk-2-1'
[netatalk.git] / etc / afpd / uam.c
index 7d5ed70111d08ecb57a531b72b04fbaa9ca12054..92173915c5f5cc5e7dfa8934c00f1a1ba34a1d85 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uam.c,v 1.32 2009-11-05 14:38:07 franklahm Exp $
+ * $Id: uam.c,v 1.35 2009-11-08 01:15:31 didg Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
@@ -56,11 +56,7 @@ char *strchr (), *strrchr ();
 #include "auth.h"
 #include "uam_auth.h"
 
-#ifdef AFP3x
 #define utf8_encoding() (afp_version >= 30)
-#else
-#define utf8_encoding() (0)
-#endif
 
 #ifdef TRU64
 #include <netdb.h>
@@ -70,9 +66,6 @@ char *strchr (), *strrchr ();
 #endif /* TRU64 */
 
 /* --- server uam functions -- */
-#ifndef NO_LOAD_UAM
-extern  int uam_setup(const char *path);
-#endif
 
 /* uam_load. uams must have a uam_setup function. */
 struct uam_mod *uam_load(const char *path, const char *name)
@@ -81,12 +74,10 @@ struct uam_mod *uam_load(const char *path, const char *name)
     struct uam_mod *mod;
     void *module;
 
-#ifndef NO_LOAD_UAM
     if ((module = mod_open(path)) == NULL) {
         LOG(log_error, logtype_afpd, "uam_load(%s): failed to load: %s", name, mod_error());
         return NULL;
     }
-#endif
 
     if ((mod = (struct uam_mod *) malloc(sizeof(struct uam_mod))) == NULL) {
         LOG(log_error, logtype_afpd, "uam_load(%s): malloc failed", name);
@@ -97,7 +88,6 @@ struct uam_mod *uam_load(const char *path, const char *name)
     if ((p = strchr(buf, '.')))
         *p = '\0';
 
-#ifndef NO_LOAD_UAM
     if ((mod->uam_fcn = mod_symbol(module, buf)) == NULL) {
         LOG(log_error, logtype_afpd, "uam_load(%s): mod_symbol error for symbol %s",
             name,
@@ -118,9 +108,6 @@ struct uam_mod *uam_load(const char *path, const char *name)
         LOG(log_error, logtype_afpd, "uam_load(%s): uam_setup failed", name);
         goto uam_load_err;
     }
-#else
-   uam_setup(name);
-#endif
 
     mod->uam_module = module;
     return mod;
@@ -140,9 +127,7 @@ void uam_unload(struct uam_mod *mod)
     if (mod->uam_fcn->uam_cleanup)
         (*mod->uam_fcn->uam_cleanup)();
 
-#ifndef NO_LOAD_UAM
     mod_close(mod->uam_module);
-#endif    
     free(mod);
 }
 
@@ -439,7 +424,7 @@ int uam_afpserver_option(void *private, const int what, void *option,
     {
         struct DSI *dsi = obj->handle;
         const struct sockaddr *sa;
-        char hbuf[NI_MAXHOST];
+        static char hbuf[NI_MAXHOST];
         
         sa = (struct sockaddr *)&dsi->client;
         if (getnameinfo(sa, sizeof(dsi->client), hbuf, sizeof(hbuf), NULL, 0, 0) == 0)
@@ -583,7 +568,9 @@ int uam_sia_validate_user(sia_collect_func_t * collect, int argc, char **argv,
 #endif /* TRU64 */
 
 /* --- papd-specific functions (just placeholders) --- */
-void append(void *pf  _U_, char *data _U_, int len _U_)
+struct papfile;
+
+UAM_MODULE_EXPORT void append(struct papfile *pf  _U_, const char *data _U_, int len _U_)
 {
     return;
 }