Diff of /etc/afpd/volume.c [c17bbd] .. [145bde] Maximize Restore

  Switch to side-by-side view

--- a/etc/afpd/volume.c
+++ b/etc/afpd/volume.c
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.51.2.7.2.33.2.25 2009-09-07 11:35:04 franklahm Exp $
+ * $Id: volume.c,v 1.51.2.7.2.33.2.26 2009-11-30 13:32:24 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1389,10 +1389,6 @@
         switch ( bit ) {
         case VOLPBIT_ATTR :
             ashort = 0;
-            if (0 == (vol->v_flags & AFPVOL_NOFILEID) && vol->v_cdb != NULL &&
-                           (vol->v_cdb->flags & CNID_FLAG_PERSISTENT)) {
-                ashort = VOLPBIT_ATTR_FILEID;
-            }
             /* check for read-only.
              * NOTE: we don't actually set the read-only flag unless
              *       it's passed in that way as it's possible to mount
@@ -1401,13 +1397,22 @@
                     ((utime(vol->v_path, NULL) < 0) && (errno == EROFS))) {
                 ashort |= VOLPBIT_ATTR_RO;
             }
-            ashort |= VOLPBIT_ATTR_CATSEARCH;
-            if (afp_version >= 30) {
-                ashort |= VOLPBIT_ATTR_UTF8;
-                if (vol->v_flags & AFPVOL_UNIX_PRIV)
-                    ashort |= VOLPBIT_ATTR_UNIXPRIV;
-                if (vol->v_flags & AFPVOL_TM)
-                    ashort |= VOLPBIT_ATTR_TM;
+            /* prior 2.1 only VOLPBIT_ATTR_RO is defined */
+            if (afp_version > 20) {
+
+                if (0 == (vol->v_flags & AFPVOL_NOFILEID) && vol->v_cdb != NULL &&
+                           (vol->v_cdb->flags & CNID_FLAG_PERSISTENT)) {
+                    ashort |= VOLPBIT_ATTR_FILEID;
+                }
+
+                ashort |= VOLPBIT_ATTR_CATSEARCH;
+                if (afp_version >= 30) {
+                    ashort |= VOLPBIT_ATTR_UTF8;
+                    if (vol->v_flags & AFPVOL_UNIX_PRIV)
+                        ashort |= VOLPBIT_ATTR_UNIXPRIV;
+                    if (vol->v_flags & AFPVOL_TM)
+                        ashort |= VOLPBIT_ATTR_TM;
+                }
             }
             ashort = htons(ashort);
             memcpy(data, &ashort, sizeof( ashort ));