summaryrefslogtreecommitdiff
path: root/source3/smbd/vfs-wrap.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-03-26 19:18:06 +0000
committerJeremy Allison <jra@samba.org>2001-03-26 19:18:06 +0000
commite670b3564c3c12baaab0e988f155a86b9437f66e (patch)
tree3fdaeb0130850ed037f4e0a73ef1a65e75ff481d /source3/smbd/vfs-wrap.c
parentc4cfc3629038aa6c2d57d630452c538c737d1203 (diff)
downloadsamba-e670b3564c3c12baaab0e988f155a86b9437f66e.tar.gz
samba-e670b3564c3c12baaab0e988f155a86b9437f66e.tar.bz2
samba-e670b3564c3c12baaab0e988f155a86b9437f66e.zip
smbd/posix_acls.c: Saving and restoring errno here is the wrong place. Moved it
to the places where [f]chmod_acl is called instead. Jeremy. (This used to be commit 641ada44ae6429761c1fd0dbcafabc69f897fac7)
Diffstat (limited to 'source3/smbd/vfs-wrap.c')
-rw-r--r--source3/smbd/vfs-wrap.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/smbd/vfs-wrap.c b/source3/smbd/vfs-wrap.c
index 8750f71151..a4057eb7ce 100644
--- a/source3/smbd/vfs-wrap.c
+++ b/source3/smbd/vfs-wrap.c
@@ -115,8 +115,10 @@ int vfswrap_mkdir(connection_struct *conn, char *path, mode_t mode)
* group permission bits. This is not what we want, as it will
* mess up any inherited ACL bits that were set. JRA.
*/
+ int saved_errno = errno; /* We may get ENOSYS */
if (conn->vfs_ops.chmod_acl != NULL) {
- conn->vfs_ops.chmod_acl(conn, path, mode);
+ if ((conn->vfs_ops.chmod_acl(conn, path, mode) == -1) && (errno == ENOSYS))
+ errno = saved_errno;
}
}
@@ -351,11 +353,15 @@ int vfswrap_chmod(connection_struct *conn, char *path, mode_t mode)
* group owner bits directly. JRA.
*/
+
if (conn->vfs_ops.chmod_acl != NULL) {
+ int saved_errno = errno; /* We might get ENOSYS */
if ((result = conn->vfs_ops.chmod_acl(conn, path, mode)) == 0) {
END_PROFILE(syscall_chmod);
return result;
}
+ /* Error - return the old errno. */
+ errno = saved_errno;
}
result = chmod(path, mode);