The branch, master has been updated
       via  f75f1d6 s3: handle non-POSIX compliant Tru64, NetBSD and FreeBSD 
errno on O_NOFOLLOW symlink open calls
      from  046dacc s3:smb2_ioctl: make use of file_fsp_smb2()

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f75f1d62339f0accb4e574645b1d265c75a01b5b
Author: Björn Jacke <[email protected]>
Date:   Sun Jun 7 13:55:26 2009 +0200

    s3: handle non-POSIX compliant Tru64, NetBSD and FreeBSD errno on 
O_NOFOLLOW symlink open calls
    
    or should we leave the NetBSD and FreeBSD platforms just broken? Actually 
these
    two *want* to have broken platforms as they use different errno's than POSIX
    demands *interntionally*. The POSIX errno ELOOP for O_NOFOLLOW open calls on
    symlinks is clear and unambiguous. See http://gnats.netbsd.org/43154 for the
    interesting NetBSD discussion on that.
    
    Autobuild-User(master): Björn Jacke <[email protected]>
    Autobuild-Date(master): Sun Jun 10 16:10:02 CEST 2012 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/open.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 4581553..cb43dd2 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -291,7 +291,26 @@ static NTSTATUS fd_open(struct connection_struct *conn,
 
        fsp->fh->fd = SMB_VFS_OPEN(conn, smb_fname, fsp, flags, mode);
        if (fsp->fh->fd == -1) {
-               status = map_nt_error_from_unix(errno);
+#ifdef O_NOFOLLOW
+               int posix_errno = errno;
+#if defined(ENOTSUP) && defined(OSF1)
+               /* handle special Tru64 errno */
+               if (errno == ENOTSUP) {
+                       posix_errno = ELOOP;
+               }
+#endif /* ENOTSUP */
+#ifdef EFTYPE
+               /* fix broken NetBSD errno */
+               if (errno == EFTYPE) {
+                       posix_errno = ELOOP;
+               }
+#endif /* EFTYPE */
+               /* fix broken FreeBSD errno */
+               if (errno == EMLINK) {
+                       posix_errno = ELOOP;
+               }
+#endif /* O_NOFOLLOW */
+               status = map_nt_error_from_unix(posix_errno);
                if (errno == EMFILE) {
                        static time_t last_warned = 0L;
 


-- 
Samba Shared Repository

Reply via email to