]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/uam.c
Merge master
[netatalk.git] / etc / afpd / uam.c
index 37ef9dd2d0a8a6b901e2cd8417e51f0140692cb0..0f5afb41c4a4e0f15e67f771d543e34fa5731a24 100644 (file)
 
 #include <stdio.h>
 #include <stdlib.h>
-
-/* STDC check */
-#if STDC_HEADERS
 #include <string.h>
-#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 <unistd.h>
-#endif /* HAVE_UNISTD_H */
-#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
-#endif /* HAVE_FCNTL_H */
 #include <ctype.h>
 #include <atalk/logger.h>
 #include <sys/param.h>
@@ -45,8 +26,6 @@ char *strchr (), *strrchr ();
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
-#include <netatalk/endian.h>
-#include <atalk/asp.h>
 #include <atalk/dsi.h>
 #include <atalk/afp.h>
 #include <atalk/util.h>
@@ -359,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;
@@ -487,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);
@@ -507,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: