X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fuam.c;h=0f5afb41c4a4e0f15e67f771d543e34fa5731a24;hb=b0bcb8f6b0571592a50ce039882c9319e012a270;hp=1b71fc9bebacc3d856e779e14965fdee68b4ec3c;hpb=4a4ad1cb481f03126e14407a8c869bb31824607c;p=netatalk.git diff --git a/etc/afpd/uam.c b/etc/afpd/uam.c index 1b71fc9b..0f5afb41 100644 --- a/etc/afpd/uam.c +++ b/etc/afpd/uam.c @@ -1,5 +1,5 @@ /* - * $Id: uam.c,v 1.34 2009-11-08 01:01:43 didg 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. @@ -11,28 +11,9 @@ #include #include - -/* STDC check */ -#if STDC_HEADERS #include -#else /* STDC_HEADERS */ -#ifndef HAVE_STRCHR -#define strchr index -#define strrchr index -#endif /* HAVE_STRCHR */ -char *strchr (), *strrchr (); -#ifndef HAVE_MEMCPY -#define memcpy(d,s,n) bcopy ((s), (d), (n)) -#define memmove(d,s,n) bcopy ((s), (d), (n)) -#endif /* ! HAVE_MEMCPY */ -#endif /* STDC_HEADERS */ - -#ifdef HAVE_UNISTD_H #include -#endif /* HAVE_UNISTD_H */ -#ifdef HAVE_FCNTL_H #include -#endif /* HAVE_FCNTL_H */ #include #include #include @@ -45,22 +26,16 @@ char *strchr (), *strrchr (); #include #include -#include -#include #include #include #include +#include -#include "globals.h" #include "afp_config.h" #include "auth.h" #include "uam_auth.h" -#ifdef AFP3x #define utf8_encoding() (afp_version >= 30) -#else -#define utf8_encoding() (0) -#endif #ifdef TRU64 #include @@ -363,7 +338,7 @@ int uam_afpserver_option(void *private, const int what, void *option, switch (what) { case UAM_OPTION_USERNAME: - *buf = obj->username; + *buf = &(obj->username[0]); if (len) *len = sizeof(obj->username) - 1; break; @@ -428,7 +403,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) @@ -491,14 +466,6 @@ int uam_afp_read(void *handle, char *buf, size_t *buflen, if (!obj) return AFPERR_PARAM; - switch (obj->proto) { - case AFPPROTO_ASP: - if ((len = asp_wrtcont(obj->handle, buf, buflen )) < 0) - goto uam_afp_read_err; - return action(handle, buf, *buflen); - break; - - case AFPPROTO_DSI: len = dsi_writeinit(obj->handle, buf, *buflen); if (!len || ((len = action(handle, buf, len)) < 0)) { dsi_writeflush(obj->handle); @@ -511,8 +478,6 @@ int uam_afp_read(void *handle, char *buf, size_t *buflen, goto uam_afp_read_err; } } - break; - } return 0; uam_afp_read_err: @@ -573,7 +538,8 @@ int uam_sia_validate_user(sia_collect_func_t * collect, int argc, char **argv, /* --- papd-specific functions (just placeholders) --- */ struct papfile; -void append(struct papfile *pf _U_, const char *data _U_, int len _U_) + +UAM_MODULE_EXPORT void append(struct papfile *pf _U_, const char *data _U_, int len _U_) { return; }