]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/switch.c
Initial checkin of ACLs patch
[netatalk.git] / etc / afpd / switch.c
index d988852aa4085bfcafba6cfce7ca518cf5a45c40..fd9770841910f6da250aaa334c8371281bcc81e6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: switch.c,v 1.4 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: switch.c,v 1.15 2009-02-02 11:55:01 franklahm Exp $
  *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
@@ -29,7 +29,7 @@
 
 #include <stdio.h>  /* to pick up NULL */
 #include <sys/stat.h> /* works around a bug */
-#include <syslog.h>
+#include <atalk/logger.h>
 
 #include <atalk/afp.h>
 #include <atalk/uam.h>
 #include "filedir.h"
 #include "status.h"
 #include "misc.h"
+#ifdef HAVE_NFSv4_ACLS
+#include "acls.h"
+#endif
 
 static int afp_null(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj      *obj;
-char   *ibuf, *rbuf;
-int            ibuflen, *rbuflen;
+AFPObj  *obj _U_;
+char   *ibuf, *rbuf _U_;
+int    ibuflen _U_, *rbuflen;
 {
-    syslog( LOG_INFO, "afp_null handle %d", *ibuf );
+    LOG(log_info, logtype_afpd, "afp_null handle %d", *ibuf );
     *rbuflen = 0;
     return( AFPERR_NOOP );
 }
@@ -72,13 +75,13 @@ int (*preauth_switch[])() = {
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,                                    /*  24 -  31 */
     NULL, NULL, NULL, NULL,
-    NULL, NULL, NULL, NULL,                            /*  32 -  39 */
+    NULL, NULL, NULL, NULL,                                    /*  32 -  39 */
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,                                    /*  40 -  47 */
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,                                    /*  48 -  55 */
     NULL, NULL, NULL, NULL,
-    NULL, NULL, NULL, NULL,                                    /*  56 -  63 */
+    NULL, NULL, NULL, afp_login_ext,                           /*  56 -  63 */
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,                                    /*  64 -  71 */
     NULL, NULL, NULL, NULL,
@@ -143,7 +146,7 @@ int (*postauth_switch[])() = {
     /*  24 -  31 */
     afp_setvolparams, afp_write, afp_getfildirparams, afp_setfildirparams,
     afp_changepw, afp_getuserinfo, afp_getsrvrmesg, afp_createid, /*  32 -  39 */
-    afp_deleteid, afp_resolveid, afp_exchangefiles, afp_null /*afp_catsearch*/,
+    afp_deleteid, afp_resolveid, afp_exchangefiles, afp_catsearch,
     afp_null, afp_null, afp_null, afp_null,                    /*  40 -  47 */
     afp_opendt, afp_closedt, afp_null, afp_geticon,
     afp_geticoninfo, afp_addappl, afp_rmvappl, afp_getappl,    /*  48 -  55 */
@@ -152,7 +155,7 @@ int (*postauth_switch[])() = {
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,                                    /*  64 -  71 */
     NULL, NULL, NULL, NULL,
-    NULL, NULL, NULL, NULL,                                    /*  72 -  79 */
+    NULL, NULL, afp_syncdir, NULL,                             /*  72 -  79 */
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,                                    /*  80 -  87 */
     NULL, NULL, NULL, NULL,
@@ -203,24 +206,24 @@ int       (*postauth_switch[])() = {
 /* add a new function if it's specified. return the old function in
  * "old" if there's a pointer there. */
 int uam_afpserver_action(const int id, const int which,
-                         int (**new)(), int (**old)())
+                         int (*new)(), int (**old)())
 {
     switch (which) {
     case UAM_AFPSERVER_PREAUTH:
         if (old)
             *old = preauth_switch[id];
         if (new)
-            preauth_switch[id] = *new;
+            preauth_switch[id] = new;
         break;
     case UAM_AFPSERVER_POSTAUTH:
         if (old)
             *old = postauth_switch[id];
         if (new)
-            postauth_switch[id] = *new;
+            postauth_switch[id] = new;
         break;
     default:
-        syslog(LOG_DEBUG, "uam_afpserver_action: unknown switch %d[%d]",
-               which, id);
+        LOG(log_debug, logtype_afpd, "uam_afpserver_action: unknown switch %d[%d]",
+            which, id);
         return -1;
     }