diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-11-18 15:57:08 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-11-18 15:57:08 +0000 |
commit | b1d699c434745143813d05619febe6b0274587db (patch) | |
tree | 7b97212b47587f987fb5ee5ea79e5d287c28e172 | |
parent | edabf07696a44d58601f78c9bbf6d95fbe50118d (diff) | |
download | newlib-b1d699c434745143813d05619febe6b0274587db.zip newlib-b1d699c434745143813d05619febe6b0274587db.tar.gz newlib-b1d699c434745143813d05619febe6b0274587db.tar.bz2 |
* ntea.cc (read_ea): Always add length of "user." prefix, not only
on Samba. Change comment.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/ntea.cc | 13 |
2 files changed, 11 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 21ec061..8ec0a07 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2009-11-18 Corinna Vinschen <corinna@vinschen.de> + * ntea.cc (read_ea): Always add length of "user." prefix, not only + on Samba. Change comment. + +2009-11-18 Corinna Vinschen <corinna@vinschen.de> + * ntea.cc (read_ea): Try to open file first to have more sensible error codes. Always refuse non "user." EAs for Linux compatibility and return EOPNOTSUPP. Fix handling of empty (== non-existant) EAs. diff --git a/winsup/cygwin/ntea.cc b/winsup/cygwin/ntea.cc index 7e3240a..147b672 100644 --- a/winsup/cygwin/ntea.cc +++ b/winsup/cygwin/ntea.cc @@ -156,8 +156,7 @@ read_ea (HANDLE hdl, path_conv &pc, const char *name, char *value, size_t size) ret = 0; do { - if (pc.fs_is_samba ()) /* See below. */ - fea->EaNameLength += 5; + fea->EaNameLength += 5; /* "user." */ if (size > 0) { if ((size_t) ret + fea->EaNameLength + 1 > size) @@ -165,11 +164,11 @@ read_ea (HANDLE hdl, path_conv &pc, const char *name, char *value, size_t size) set_errno (ERANGE); goto out; } - /* Samba hides the user namespace from Windows clients. We add - it in EA listings to keep tools like attr/getfattr/setfattr - happy. */ - char tmpbuf[MAX_EA_NAME_LEN * 2], *tp = tmpbuf; - tp = stpcpy (tmpbuf, "user."); + /* For compatibility with Linux, we always prepend "user." to + the attribute name, so effectively we only support user + attributes from a application point of view. */ + char tmpbuf[MAX_EA_NAME_LEN * 2]; + char *tp = stpcpy (tmpbuf, "user."); stpcpy (tp, fea->EaName); /* NTFS stores all EA names in uppercase unfortunately. To keep compatibility with ext/xfs EA namespaces and accompanying |