diff options
Diffstat (limited to 'source3/smbd/vfs-wrap.c')
-rw-r--r-- | source3/smbd/vfs-wrap.c | 8 |
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); |