X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fswitch.c;h=2e2c69e01212f56e25df986d83c46e478c42ad55;hb=0bc1f040edf0e9414eb1f0979605155a5a14d483;hp=7a853be16fbcdd75ba491a3604e5d6bac7065702;hpb=f291e1ee2d32891f4f451e946b5894a038ed8c48;p=netatalk.git diff --git a/etc/afpd/switch.c b/etc/afpd/switch.c index 7a853be1..2e2c69e0 100644 --- a/etc/afpd/switch.c +++ b/etc/afpd/switch.c @@ -1,5 +1,5 @@ /* - * $Id: switch.c,v 1.7 2002-03-24 01:23:41 sibaz Exp $ + * $Id: switch.c,v 1.19 2009-10-15 10:43:13 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -46,11 +46,11 @@ #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; +static int afp_null(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { LOG(log_info, logtype_afpd, "afp_null handle %d", *ibuf ); *rbuflen = 0; @@ -62,7 +62,7 @@ int ibuflen, *rbuflen; * Routines marked "afp_null" are AFP functions * which are not yet implemented. A fine line... */ -int (*preauth_switch[])() = { +static AFPCmd preauth_switch[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 - 7 */ NULL, NULL, NULL, NULL, @@ -72,13 +72,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, @@ -129,9 +129,9 @@ int (*preauth_switch[])() = { NULL, NULL, NULL, NULL, /* 248 - 255 */ }; -int (**afp_switch)() = preauth_switch; +AFPCmd *afp_switch = preauth_switch; -int (*postauth_switch[])() = { +AFPCmd postauth_switch[] = { NULL, afp_bytelock, afp_closevol, afp_closedir, afp_closefork, afp_copyfile, afp_createdir, afp_createfile, /* 0 - 7 */ afp_delete, afp_enumerate, afp_flush, afp_flushfork, @@ -143,7 +143,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 +152,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, afp_syncfork, /* 72 - 79 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 80 - 87 */ NULL, NULL, NULL, NULL, @@ -203,20 +203,20 @@ 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)()) + AFPCmd new_table, AFPCmd *old) { switch (which) { case UAM_AFPSERVER_PREAUTH: if (old) *old = preauth_switch[id]; - if (new) - preauth_switch[id] = *new; + if (new_table) + preauth_switch[id] = new_table; break; case UAM_AFPSERVER_POSTAUTH: if (old) *old = postauth_switch[id]; - if (new) - postauth_switch[id] = *new; + if (new_table) + postauth_switch[id] = new_table; break; default: LOG(log_debug, logtype_afpd, "uam_afpserver_action: unknown switch %d[%d]",