]> arthur.barton.de Git - netatalk.git/blobdiff - etc/uams/uams_gss.c
Merge master
[netatalk.git] / etc / uams / uams_gss.c
index 044dd278bac78dea2d88ac3e72e8555ccf440812..da0411f949c4ff3e0483a99df2430f4481813405 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: uams_gss.c,v 1.12 2010-03-30 10:25:49 franklahm Exp $
- *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
  * Copyright (c) 2003 The Reed Institute
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif /* HAVE_UNISTD_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 */
-
 #include <errno.h>
+#include <arpa/inet.h>
+
 #include <atalk/logger.h>
 #include <atalk/afp.h>
 #include <atalk/uam.h>
 #include <atalk/util.h>
+#include <atalk/compat.h>
 
 /* Kerberos includes */
 
@@ -107,7 +93,7 @@ static void log_status( char *s, OM_uint32 major_status,
 
 static void log_ctx_flags( OM_uint32 flags )
 {
-#ifdef DEBUG1
+#ifdef DEBUG
     if (flags & GSS_C_DELEG_FLAG)
         LOG(log_debug, logtype_uams, "uams_gss.c :context flag: GSS_C_DELEG_FLAG" );
     if (flags & GSS_C_MUTUAL_FLAG)
@@ -424,7 +410,7 @@ static int do_gss_auth(void *obj, char *ibuf, int ticket_len,
         if (!ret) {
             /* FIXME: Is copying the authenticator really necessary?
                Where is this documented? */
-            u_int16_t auth_len = htons( authenticator_buff.length );
+            uint16_t auth_len = htons( authenticator_buff.length );
 
             /* copy the authenticator length into the reply buffer */
             memcpy( rbuf, &auth_len, sizeof(auth_len) );
@@ -457,7 +443,7 @@ static int gss_login(void *obj, struct passwd **uam_pwd,
                      char *rbuf, size_t *rbuflen)
 {
 
-    u_int16_t  temp16;
+    uint16_t  temp16;
 
     *rbuflen = 0;
 
@@ -475,9 +461,9 @@ static int gss_logincont(void *obj, struct passwd **uam_pwd,
                          char *rbuf, size_t *rbuflen)
 {
     struct passwd *pwd = NULL;
-    u_int16_t login_id;
+    uint16_t login_id;
     char *username;
-    u_int16_t ticket_len;
+    uint16_t ticket_len;
     char *p;
     int rblen;
     size_t userlen;
@@ -486,9 +472,9 @@ static int gss_logincont(void *obj, struct passwd **uam_pwd,
     /* Apple's AFP 3.1 documentation specifies that this command
      * takes the following format:
      * pad (byte)
-     * id returned in LoginExt response (u_int16_t)
+     * id returned in LoginExt response (uint16_t)
      * username (format unspecified) padded, when necessary, to end on an even boundary
-     * ticket length (u_int16_t)
+     * ticket length (uint16_t)
      * ticket
      */
 
@@ -496,14 +482,14 @@ static int gss_logincont(void *obj, struct passwd **uam_pwd,
      * format of this request is as follows:
      * pad (byte) [consumed before login_ext is called]
      * ?? (byte) - always observed to be 0
-     * id returned in LoginExt response (u_int16_t)
+     * id returned in LoginExt response (uint16_t)
      * username, encoding unspecified, null terminated C string,
      *   padded when the terminating null is an even numbered byte.
      *   The packet is formated such that the username begins on an
      *   odd numbered byte. Eg if the username is 3 characters and the
      *   terminating null makes 4, expect to pad the the result.
      *   The encoding of this string is unknown.
-     * ticket length (u_int16_t)
+     * ticket length (uint16_t)
      * ticket
      */
 
@@ -593,7 +579,7 @@ static int gss_login_ext(void *obj, char *uname, struct passwd **uam_pwd,
                          char *ibuf, size_t ibuflen,
                          char *rbuf, size_t *rbuflen)
 {
-    u_int16_t  temp16;
+    uint16_t  temp16;
 
     *rbuflen = 0;