diff options
author | Jeremy Allison <jra@samba.org> | 2004-06-01 20:43:32 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:51:51 -0500 |
commit | 03d4344432c6aa75d400afc501aec1a14070f35d (patch) | |
tree | 8abb111853211e521eeefcdf8ac5e4a5095ce664 /source3/smbd/dosmode.c | |
parent | 027c5068cd29263cd57fd3723eeeea5b1fd3a4a9 (diff) | |
download | samba-03d4344432c6aa75d400afc501aec1a14070f35d.tar.gz samba-03d4344432c6aa75d400afc501aec1a14070f35d.tar.xz samba-03d4344432c6aa75d400afc501aec1a14070f35d.zip |
r971: Auto remove store dos attributes if underlying filesystem
doesn't support EA's.
Jeremy.
(This used to be commit 9de6b25c9e9abe982e21b0229df520802cafbfd8)
Diffstat (limited to 'source3/smbd/dosmode.c')
-rw-r--r-- | source3/smbd/dosmode.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index d7dc63bb2fd..33c75fffd53 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -182,6 +182,7 @@ static BOOL get_ea_dos_attribute(connection_struct *conn, const char *path,SMB_S if ((errno != ENOTSUP) && (errno != ENOATTR) && (errno != EACCES)) { DEBUG(1,("get_ea_dos_attributes: Cannot get attribute from EA on file %s: Error = %s\n", path, strerror(errno) )); + set_store_dos_attributes(SNUM(conn), False); } #endif return False; @@ -224,9 +225,21 @@ static BOOL set_ea_dos_attribute(connection_struct *conn, const char *path, SMB_ files_struct *fsp = NULL; BOOL ret = False; + if (!lp_store_dos_attributes(SNUM(conn))) { + return False; + } + snprintf(attrstr, sizeof(attrstr)-1, "0x%x", dosmode & SAMBA_ATTRIBUTES_MASK); if (SMB_VFS_SETXATTR(conn, path, SAMBA_XATTR_DOS_ATTRIB, attrstr, strlen(attrstr), 0) == -1) { if((errno != EPERM) && (errno != EACCES)) { + if (errno == ENOSYS +#if defined(ENOTSUP) + || errno == ENOTSUP) { +#else + ) { +#endif + set_store_dos_attributes(SNUM(conn), False); + } return False; } |