s3-vfs: Avoid loops in VFS modules: call _NEXT functions in xattr emulation
authorAndrew Bartlett <abartlet@samba.org>
Wed, 15 Aug 2012 12:21:48 +0000 (22:21 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 15 Aug 2012 14:28:03 +0000 (16:28 +0200)
We need to call the next module in the stack otherwise we will loop if
the stat call is in turn implemented in terms of extended attribute
lookup.

Andrew Bartlett

source3/modules/vfs_posix_eadb.c
source3/modules/vfs_xattr_tdb.c

index e1b90ffbc6e3f34bddb2acc78280e0ce7a6cadf4..c8bebc4c0f1b0c7b0d99a183ea13c2f916b38f2c 100644 (file)
@@ -293,9 +293,9 @@ static int posix_eadb_unlink(vfs_handle_struct *handle,
        }
 
        if (lp_posix_pathnames()) {
-               ret = SMB_VFS_LSTAT(handle->conn, smb_fname_tmp);
+               ret = SMB_VFS_NEXT_LSTAT(handle, smb_fname_tmp);
        } else {
-               ret = SMB_VFS_STAT(handle->conn, smb_fname_tmp);
+               ret = SMB_VFS_NEXT_STAT(handle, smb_fname_tmp);
        }
        if (ret == -1) {
                goto out;
index f09eec2cd8dc8d75ff7072298f005f2abe06be2f..80db90441d3fd8cd1284dbadd19a07b86c6c4570 100644 (file)
@@ -76,7 +76,7 @@ static ssize_t xattr_tdb_fgetxattr(struct vfs_handle_struct *handle,
 
        SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, TALLOC_FREE(frame); return -1);
 
-       if (SMB_VFS_FSTAT(fsp, &sbuf) == -1) {
+       if (SMB_VFS_NEXT_FSTAT(handle, fsp, &sbuf) == -1) {
                TALLOC_FREE(frame);
                return -1;
        }
@@ -128,7 +128,7 @@ static int xattr_tdb_fsetxattr(struct vfs_handle_struct *handle,
 
        SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, return -1);
 
-       if (SMB_VFS_FSTAT(fsp, &sbuf) == -1) {
+       if (SMB_VFS_NEXT_FSTAT(handle, fsp, &sbuf) == -1) {
                return -1;
        }
 
@@ -165,7 +165,7 @@ static ssize_t xattr_tdb_flistxattr(struct vfs_handle_struct *handle,
 
        SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, return -1);
 
-       if (SMB_VFS_FSTAT(fsp, &sbuf) == -1) {
+       if (SMB_VFS_NEXT_FSTAT(handle, fsp, &sbuf) == -1) {
                return -1;
        }
 
@@ -201,7 +201,7 @@ static int xattr_tdb_fremovexattr(struct vfs_handle_struct *handle,
 
        SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, return -1);
 
-       if (SMB_VFS_FSTAT(fsp, &sbuf) == -1) {
+       if (SMB_VFS_NEXT_FSTAT(handle, fsp, &sbuf) == -1) {
                return -1;
        }
 
@@ -272,9 +272,9 @@ static int xattr_tdb_unlink(vfs_handle_struct *handle,
        }
 
        if (lp_posix_pathnames()) {
-               ret = SMB_VFS_LSTAT(handle->conn, smb_fname_tmp);
+               ret = SMB_VFS_NEXT_LSTAT(handle, smb_fname_tmp);
        } else {
-               ret = SMB_VFS_STAT(handle->conn, smb_fname_tmp);
+               ret = SMB_VFS_NEXT_STAT(handle, smb_fname_tmp);
        }
        if (ret == -1) {
                goto out;