]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/status.c
Initial checkin of ACLs patch
[netatalk.git] / etc / afpd / status.c
index e7cf092b543783fe8c534f567913e237e193db43..0d842e562329e85c95ce71b8d28ae0a29dd58294 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: status.c,v 1.16 2005-04-28 20:49:44 bfernhomberg Exp $
+ * $Id: status.c,v 1.19 2009-02-02 11:55:01 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -65,6 +65,9 @@ static void status_flags(char *data, const int notif, const int ipok,
     status |= AFPSRVRINFO_SRVRDIR; /* AFP 3.1 specs says we need to specify this, but may set the count to 0 */
     /* We don't set the UTF8 name flag here, we don't know whether we have enough space ... */
 
+    if (flags & OPTION_UUID)   /* 05122008 FIXME: can we set AFPSRVRINFO_UUID here ? see AFPSRVRINFO_SRVRDIR*/
+       status |= AFPSRVRINFO_UUID;
+
     status = htons(status);
     memcpy(data + AFPSTATUS_FLAGOFF, &status, sizeof(status));
 }
@@ -85,7 +88,7 @@ static int status_server(char *data, const char *server, const struct afp_option
     nbp_name(server, &Obj, &Type, &Zone);
     if ((size_t)-1 == (len = convert_string( 
                        options->unixcharset, options->maccharset, 
-                       Obj, strlen(Obj), buf, 31)) ) {
+                       Obj, strlen(Obj), buf, sizeof(buf))) ) {
        len = MIN(strlen(Obj), 31);
        *data++ = len;
        memcpy( data, Obj, len );
@@ -481,7 +484,7 @@ void status_init(AFPConfig *aspconfig, AFPConfig *dsiconfig,
 {
     ASP asp;
     DSI *dsi;
-    u_int8_t *status = NULL;
+    char *status = NULL;
     size_t statuslen;
     int c, sigoff;
 
@@ -525,7 +528,8 @@ void status_init(AFPConfig *aspconfig, AFPConfig *dsiconfig,
     status_flags(status, options->server_notif, options->fqdn ||
                  (dsiconfig && dsi->server.sin_addr.s_addr),
                  options->passwdbits, 
-                (options->k5service && options->k5realm && options->fqdn));
+                (options->k5service && options->k5realm && options->fqdn), 
+                options->flags);
     /* returns offset to signature offset */
     c = status_server(status, options->server ? options->server :
                       options->hostname, options);