]> arthur.barton.de Git - netatalk.git/commitdiff
sys_lsetxattr error messages when mounting read only filesystem
authorRalph Boehme <sloowfranklin@gmail.com>
Tue, 5 Mar 2013 16:40:22 +0000 (17:40 +0100)
committerRalph Boehme <sloowfranklin@gmail.com>
Tue, 5 Mar 2013 16:40:22 +0000 (17:40 +0100)
Fixes bug #504.

NEWS
include/atalk/adouble.h
libatalk/adouble/ad_conv.c
libatalk/adouble/ad_open.c
libatalk/util/netatalk_conf.c

diff --git a/NEWS b/NEWS
index 42f7d498386e1b8ac08cae07ead23ee0d57e7bf0..35f9ea2b041d81b3458ad03355d9110e49a53b59 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,8 @@ Changes in 3.0.3
        Fixes bug #501.
 * FIX: Conversion from adouble v2 to ea for directories.
        Fixes bug #500.
+* FIX: Error messages when mounting read-only filesystems.
+       Fixes bug #504.
 
 Changes in 3.0.2
 ================
index fd870876cd18698fa1790128178fbc6b07150c4e..de0598b5a9f2b279eedb71dd01cc24700d20a495 100644 (file)
@@ -245,6 +245,7 @@ struct adouble {
 #define ADFLAGS_TRUNC     (1<<12) /* truncate, open called with O_TRUNC */
 
 #define ADVOL_NODEV      (1 << 0)
+#define ADVOL_RO         (1 << 1)
 #define ADVOL_UNIXPRIV   (1 << 2) /* adouble unix priv */
 #define ADVOL_INVDOTS    (1 << 3) /* dot files (.DS_Store) are invisible) */
 #define ADVOL_FOLLO_SYML (1 << 4)
index 486b0313594e0e71e17e39f622f43c5b225119af..c68cad45c881aaef42b12fdaf514ee22c319a3ac 100644 (file)
@@ -264,6 +264,9 @@ int ad_convert(const char *path, const struct stat *sp, const struct vol *vol, c
     if (newpath)
         *newpath = NULL;
 
+    if (vol->v_flags & AFPVOL_RO)
+        EC_EXIT_STATUS(0);
+
     if ((vol->v_adouble == AD_VERSION_EA) && !(vol->v_flags & AFPVOL_NOV2TOEACONV))
         EC_ZERO( ad_conv_v22ea(path, sp, vol) );
 
index cd45fef2e20ddf9c526b08a07f7c2a6f9c8a5717..4e1253d1febf6e70b8cef6576b54b98015385eb9 100644 (file)
@@ -1087,6 +1087,10 @@ static int ad_open_hf_ea(const char *path, int adflags, int mode, struct adouble
             errno = ENOENT;
             EC_FAIL;
         }
+        if ((adflags & ADFLAGS_CREATE) && (ad->ad_options & ADVOL_RO)) {
+            errno = EROFS;
+            EC_FAIL;
+        }
 
         LOG(log_debug, logtype_ad, "ad_open_hf_ea(\"%s\"): creating metadata EA", path);
 
index fdc7e556b2a646b95b1e51908b3465a0c2618646..6445d3fe3dd4e02ec4fffa306b9d620c436147a1 100644 (file)
@@ -801,6 +801,8 @@ static struct vol *creatvol(AFPObj *obj,
         volume->v_ad_options |= ADVOL_INVDOTS;
     if ((volume->v_flags & AFPVOL_FOLLOWSYM))
         volume->v_ad_options |= ADVOL_FOLLO_SYML;
+    if ((volume->v_flags & AFPVOL_RO))
+        volume->v_ad_options |= ADVOL_RO;
 
     /* Mac to Unix conversion flags*/
     if ((volume->v_flags & AFPVOL_EILSEQ))