From e670b3564c3c12baaab0e988f155a86b9437f66e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 26 Mar 2001 19:18:06 +0000 Subject: 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) --- source3/smbd/open.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source3/smbd/open.c') diff --git a/source3/smbd/open.c b/source3/smbd/open.c index afcaeff1ae..c601121459 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -194,9 +194,12 @@ static BOOL open_file(files_struct *fsp,connection_struct *conn, * Take care of inherited ACLs on created files. JRA. */ - if ((flags & O_CREAT) && (conn->vfs_ops.fchmod_acl != NULL)) - conn->vfs_ops.fchmod_acl(fsp, fsp->fd, mode); - + if ((flags & O_CREAT) && (conn->vfs_ops.fchmod_acl != NULL)) { + int saved_errno = errno; /* We might get ENOSYS in the next call.. */ + if (conn->vfs_ops.fchmod_acl(fsp, fsp->fd, mode) == -1 && errno == ENOSYS) + errno = saved_errno; /* Ignore ENOSYS */ + } + return True; } -- cgit