]> arthur.barton.de Git - netatalk.git/commitdiff
return 0xffff if more than 65536 entries in a directory.
authordidg <didg>
Tue, 20 May 2003 14:46:50 +0000 (14:46 +0000)
committerdidg <didg>
Tue, 20 May 2003 14:46:50 +0000 (14:46 +0000)
etc/afpd/directory.c
etc/afpd/directory.h
etc/afpd/enumerate.c

index 5490755726a5dbffec56677658b09693870b3641..7f6660bba3140183afc6c0de018aec9e27aac829 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.73 2003-05-12 09:43:11 didg Exp $
+ * $Id: directory.c,v 1.74 2003-05-20 14:46:50 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1344,12 +1344,12 @@ int getdirparams(const struct vol *vol,
             ashort = 0;
             /* this needs to handle current directory access rights */
             if (st->st_ctime == dir->ctime) {
-               ashort = dir->offcnt;
+                ashort = (dir->offcnt > 0xffff)?0xffff:dir->offcnt;
             }
             else if ((ret = for_each_dirent(vol, upath, NULL,NULL)) >= 0) {
-                ashort = ret;
-                dir->offcnt = ashort;
+                dir->offcnt = ret;
                 dir->ctime = st->st_ctime;
+                ashort = (dir->offcnt > 0xffff)?0xffff:dir->offcnt;
             }
             ashort = htons( ashort );
             memcpy( data, &ashort, sizeof( ashort ));
index c6cc34b2860cfffe416ea707bda6a1f474355de7..fff173ca8d1e2eb80a112e5b03879e6c1b60bd41 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.h,v 1.14 2003-05-02 18:22:13 didg Exp $
+ * $Id: directory.h,v 1.15 2003-05-20 14:46:50 didg Exp $
  *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
@@ -53,7 +53,7 @@ struct dir {
     int                d_flags;
 
     time_t      ctime;                /* inode ctime */
-    int         offcnt;               /* offspring count */
+    u_int32_t   offcnt;               /* offspring count */
 
     char       *d_m_name;            /* mac name */
     char        *d_u_name;            /* unix name */
index f91754ba343bc0838a8603553f18f699fa3a18fc..01f9628ef65ad79239f9bfc05d829dda52a0d33e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: enumerate.c,v 1.40 2003-05-16 14:38:20 didg Exp $
+ * $Id: enumerate.c,v 1.41 2003-05-20 14:46:50 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -495,6 +495,7 @@ int     ext;
         }
         data += esz;
         actcnt++;
+        /* FIXME if we rollover 16 bits and it's not FPEnumerateExt2 */
     }
 
     if ( actcnt == 0 ) {