[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha5-70-g502739f

Andrew Bartlett abartlet at samba.org
Wed Jul 16 04:01:07 GMT 2008


The branch, v4-0-test has been updated
       via  502739ff90d56d2c9aabe8e224317f6ceb175c17 (commit)
       via  f13572d9e9f1962b637cbd573588184d1459d252 (commit)
      from  5d539b7da46e38e7570fa5af4549b142f25e4585 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 502739ff90d56d2c9aabe8e224317f6ceb175c17
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Jul 16 14:00:18 2008 +1000

    Ignore and handle more NT Create & X options.
    
    The MS-SMB document explains that some of these options should be
    ignored.  The test proves it.
    
    /* Must be ignored by the server, per MS-SMB 2.2.8 */
    /* Must be ignored by the server, per MS-SMB 2.2.8 */
    
    If we implement HSM in samba4 (likely) we should honour this bit.
    /* Don't pull this file off tape in a HSM system */
    
    Andrew Bartlett

commit f13572d9e9f1962b637cbd573588184d1459d252
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Jul 16 11:11:25 2008 +1000

    Don't keep an extra ldb around forever.
    
    We just open it to figure out if we need to be a Global Catalog server.
    
    Andrew Bartlett

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

Summary of changes:
 source/ldap_server/ldap_server.c |    6 +++-
 source/libcli/raw/smb.h          |   11 +++++--
 source/ntvfs/posix/pvfs_open.c   |   13 ++++++++-
 source/torture/raw/open.c        |   56 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 81 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/ldap_server/ldap_server.c b/source/ldap_server/ldap_server.c
index 197f846..39a55f4 100644
--- a/source/ldap_server/ldap_server.c
+++ b/source/ldap_server/ldap_server.c
@@ -477,7 +477,7 @@ static NTSTATUS add_socket(struct event_context *event_context,
 		}
 	}
 
-	/* Load LDAP database */
+	/* Load LDAP database, but only to read our settings */
 	ldb = samdb_connect(ldap_service, ldap_service->task->event_ctx, 
 			    lp_ctx, system_session(ldap_service, lp_ctx));
 	if (!ldb) {
@@ -497,6 +497,10 @@ static NTSTATUS add_socket(struct event_context *event_context,
 		}
 	}
 
+	/* And once we are bound, free the tempoary ldb, it will
+	 * connect again on each incoming LDAP connection */
+	talloc_free(ldb);
+
 	return status;
 }
 
diff --git a/source/libcli/raw/smb.h b/source/libcli/raw/smb.h
index 5a92b99..f54e979 100644
--- a/source/libcli/raw/smb.h
+++ b/source/libcli/raw/smb.h
@@ -156,15 +156,20 @@
 #define NTCREATEX_OPTIONS_DELETE_ON_CLOSE          0x1000
 #define NTCREATEX_OPTIONS_OPEN_BY_FILE_ID          0x2000
 #define NTCREATEX_OPTIONS_BACKUP_INTENT            0x4000
-#define NTCREATEX_OPTIONS_REPARSE_POINT          0x200000
-#define NTCREATEX_OPTIONS_UNKNOWN_400000         0x400000
+/* Must be ignored by the server, per MS-SMB 2.2.8 */
+#define NTCREATEX_OPTIONS_OPFILTER             0x00100000
+#define NTCREATEX_OPTIONS_REPARSE_POINT        0x00200000
+/* Don't pull this file off tape in a HSM system */
+#define NTCREATEX_OPTIONS_NO_RECALL            0x00400000
+/* Must be ignored by the server, per MS-SMB 2.2.8 */
+#define NTCREATEX_OPTIONS_FREE_SPACE_QUERY     0x00800000
 /* create options these bits are for private use by backends, they are
    not valid on the wire */
 #define NTCREATEX_OPTIONS_PRIVATE_MASK         0xFF000000
 #define NTCREATEX_OPTIONS_PRIVATE_DENY_DOS     0x01000000
 #define NTCREATEX_OPTIONS_PRIVATE_DENY_FCB     0x02000000
 
-#define NTCREATEX_OPTIONS_NOT_SUPPORTED_MASK   0x00DFA188 
+#define NTCREATEX_OPTIONS_NOT_SUPPORTED_MASK   0x000FA188 
 
 
 
diff --git a/source/ntvfs/posix/pvfs_open.c b/source/ntvfs/posix/pvfs_open.c
index 4320308..5302fc3 100644
--- a/source/ntvfs/posix/pvfs_open.c
+++ b/source/ntvfs/posix/pvfs_open.c
@@ -1206,11 +1206,22 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 
-	/* some create options are not supported */
 	if (create_options & NTCREATEX_OPTIONS_NOT_SUPPORTED_MASK) {
 		return NT_STATUS_NOT_SUPPORTED;
 	}
 
+	/* TODO: When we implement HSM, add a hook here not to pull
+	 * the actual file off tape, when this option is passed from
+	 * the client */
+	if (create_options & NTCREATEX_OPTIONS_NO_RECALL) {
+		/* no-op */
+	}
+
+	/* These options are ignored */
+	if (create_options & (NTCREATEX_OPTIONS_FREE_SPACE_QUERY | NTCREATEX_OPTIONS_OPFILTER)) {
+		/* no-op */
+	}
+
 	/* other create options are not allowed */
 	if ((create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE) &&
 	    !(access_mask & SEC_STD_DELETE)) {
diff --git a/source/torture/raw/open.c b/source/torture/raw/open.c
index c6ba0d2..3e310eb 100644
--- a/source/torture/raw/open.c
+++ b/source/torture/raw/open.c
@@ -954,6 +954,62 @@ static bool test_nttrans_create(struct smbcli_state *cli, struct torture_context
 	CHECK_ALL_INFO(io.ntcreatex.out.is_directory, directory);
 	CHECK_VAL(io.ntcreatex.out.file_type, FILE_TYPE_DISK);
 	smbcli_close(cli->tree, fnum);
+
+	/* check no-recall - don't pull a file from tape on a HSM */
+	io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_NO_RECALL;
+	status = smb_raw_open(cli->tree, tctx, &io);
+	CHECK_STATUS(status, NT_STATUS_OK);
+	fnum = io.ntcreatex.out.file.fnum;
+
+	CHECK_VAL(io.ntcreatex.out.oplock_level, 0);
+	CHECK_VAL(io.ntcreatex.out.create_action, NTCREATEX_ACTION_EXISTED);
+	CHECK_NTTIME(io.ntcreatex.out.create_time, create_time);
+	CHECK_NTTIME(io.ntcreatex.out.access_time, access_time);
+	CHECK_NTTIME(io.ntcreatex.out.write_time, write_time);
+	CHECK_NTTIME(io.ntcreatex.out.change_time, change_time);
+	CHECK_ALL_INFO(io.ntcreatex.out.attrib, attrib);
+	CHECK_ALL_INFO(io.ntcreatex.out.alloc_size, alloc_size);
+	CHECK_ALL_INFO(io.ntcreatex.out.size, size);
+	CHECK_ALL_INFO(io.ntcreatex.out.is_directory, directory);
+	CHECK_VAL(io.ntcreatex.out.file_type, FILE_TYPE_DISK);
+	smbcli_close(cli->tree, fnum);
+
+	/* Check some create options (these all should be ignored) */
+	io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_OPFILTER;
+	status = smb_raw_open(cli->tree, tctx, &io);
+	CHECK_STATUS(status, NT_STATUS_OK);
+
+	CHECK_VAL(io.ntcreatex.out.oplock_level, 0);
+	CHECK_VAL(io.ntcreatex.out.create_action, NTCREATEX_ACTION_EXISTED);
+	CHECK_NTTIME(io.ntcreatex.out.create_time, create_time);
+	CHECK_NTTIME(io.ntcreatex.out.access_time, access_time);
+	CHECK_NTTIME(io.ntcreatex.out.write_time, write_time);
+	CHECK_NTTIME(io.ntcreatex.out.change_time, change_time);
+	CHECK_ALL_INFO(io.ntcreatex.out.attrib, attrib);
+	CHECK_ALL_INFO(io.ntcreatex.out.alloc_size, alloc_size);
+	CHECK_ALL_INFO(io.ntcreatex.out.size, size);
+	CHECK_ALL_INFO(io.ntcreatex.out.is_directory, directory);
+	CHECK_VAL(io.ntcreatex.out.file_type, FILE_TYPE_DISK);
+	smbcli_close(cli->tree, fnum);
+
+	io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_FREE_SPACE_QUERY;
+	status = smb_raw_open(cli->tree, tctx, &io);
+	CHECK_STATUS(status, NT_STATUS_OK);
+	fnum = io.ntcreatex.out.file.fnum;
+
+	CHECK_VAL(io.ntcreatex.out.oplock_level, 0);
+	CHECK_VAL(io.ntcreatex.out.create_action, NTCREATEX_ACTION_EXISTED);
+	CHECK_NTTIME(io.ntcreatex.out.create_time, create_time);
+	CHECK_NTTIME(io.ntcreatex.out.access_time, access_time);
+	CHECK_NTTIME(io.ntcreatex.out.write_time, write_time);
+	CHECK_NTTIME(io.ntcreatex.out.change_time, change_time);
+	CHECK_ALL_INFO(io.ntcreatex.out.attrib, attrib);
+	CHECK_ALL_INFO(io.ntcreatex.out.alloc_size, alloc_size);
+	CHECK_ALL_INFO(io.ntcreatex.out.size, size);
+	CHECK_ALL_INFO(io.ntcreatex.out.is_directory, directory);
+	CHECK_VAL(io.ntcreatex.out.file_type, FILE_TYPE_DISK);
+	smbcli_close(cli->tree, fnum);
+
 	smbcli_unlink(cli->tree, fname);
 
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list