]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/extattrs.c
sigquit
[netatalk.git] / etc / afpd / extattrs.c
index 5db87f2bcc0d412c40da7fbb6f9bbbc12107421e..649cc6a30f3044b96533412751f850acee8a10be 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  $Id: extattrs.c,v 1.26 2009-11-13 13:52:02 didg Exp $
+  $Id: extattrs.c,v 1.29 2010-01-05 12:06:33 franklahm Exp $
   Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
 
   This program is free software; you can redistribute it and/or modify
@@ -140,7 +140,8 @@ int afp_listextattr(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf,
         }
 
         adp = of_ad(vol, s_path, &ad);
-        uname = s_path->u_name;        /*
+        uname = s_path->u_name;
+        /*
           We have to check the FinderInfo for the file, because if they aren't all 0
           we must return the synthetic attribute "com.apple.FinderInfo".
           Note: the client will never (never seen in traces) request that attribute
@@ -249,12 +250,12 @@ static char *to_stringz(char *ibuf, uint16_t len)
 {
 static char attrmname[256];
 
-    if (len > 256)
+    if (len > 255)
         /* dont fool with us */
-        len = 256;
+        len = 255;
 
     /* we must copy the name as its not 0-terminated and I DONT WANT TO WRITE to ibuf */
-    strlcpy(attrmname, ibuf, len);
+    strlcpy(attrmname, ibuf, len + 1);
     return attrmname;
 }