X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=etc%2Fafpd%2Fafp_dsi.c;h=7edb2e98740e650438f0132ba2e05c140940a6de;hb=37b0e216fc4f7661013a95f64b354354a6743bfb;hp=a58e6c874bf96722989ac449490ff7d504cd163f;hpb=78d8d7d0d01eacc9f585125d388061927729eff6;p=netatalk.git diff --git a/etc/afpd/afp_dsi.c b/etc/afpd/afp_dsi.c index a58e6c87..7edb2e98 100644 --- a/etc/afpd/afp_dsi.c +++ b/etc/afpd/afp_dsi.c @@ -1,5 +1,5 @@ /* - * $Id: afp_dsi.c,v 1.51 2010-02-16 02:37:38 didg Exp $ + * $Id: afp_dsi.c,v 1.52 2010-03-08 19:49:59 franklahm Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1993 Regents of The University of Michigan. @@ -48,6 +48,16 @@ #define CHILD_SLEEPING (1 << 2) #define CHILD_DATA (1 << 3) +/* + * We generally pass this from afp_over_dsi to all afp_* funcs, so it should already be + * available everywhere. Unfortunately some funcs (eg acltoownermode) need acces to it + * but are deeply nested in the function chain with the caller already without acces to it. + * Changing this would require adding a reference to the caller which itself might be + * called in many places (eg acltoownermode is called from accessmode). + * The only sane way out is providing a copy of it here: + */ +AFPObj *AFPobj = NULL; + static struct { AFPObj *obj; unsigned char flags; @@ -260,6 +270,7 @@ void afp_over_dsi(AFPObj *obj) u_int8_t function; struct sigaction action; + AFPobj = obj; obj->exit = afp_dsi_die; obj->reply = (int (*)()) dsi_cmdreply; obj->attention = (int (*)(void *, AFPUserBytes)) dsi_attention;