[SCM] Samba Shared Repository - branch v3-6-test updated

Jeremy Allison jra at samba.org
Thu Dec 16 14:53:10 MST 2010


The branch, v3-6-test has been updated
       via  c3a5b6e Do more vfs_stat_fsp calls instead of FSTAT - ensures fsp->fsp_name->st is kept up to date.
       via  da30912 spoolss: fill in PerMachineConnections add and delete IDL.
      from  6d6dc07 Fix old bug in openX code, exposed when "strict allocate" is set to true.

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


- Log -----------------------------------------------------------------
commit c3a5b6e76135ca20735c6631b4ab0e3ddd2edbef
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Dec 16 13:24:13 2010 -0800

    Do more vfs_stat_fsp calls instead of FSTAT - ensures fsp->fsp_name->st is kept up to date.

commit da309120d6f14d3bb671f43d534ee6357f536886
Author: Günther Deschner <gd at samba.org>
Date:   Mon Oct 4 15:03:08 2010 +0200

    spoolss: fill in PerMachineConnections add and delete IDL.
    
    Guenther
    (cherry picked from commit 1b293c90be3905911d401b2d5bb6dd5da979c809)

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

Summary of changes:
 librpc/idl/spoolss.idl                      |   12 +++++++--
 source3/modules/vfs_default.c               |   33 ++++++++++++++++----------
 source3/rpc_server/srv_spoolss_nt.c         |   18 +++++++-------
 source4/rpc_server/spoolss/dcesrv_spoolss.c |   18 +++++++-------
 4 files changed, 47 insertions(+), 34 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/idl/spoolss.idl b/librpc/idl/spoolss.idl
index 682b86a..c74bd69 100644
--- a/librpc/idl/spoolss.idl
+++ b/librpc/idl/spoolss.idl
@@ -2986,17 +2986,23 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
 
 	/******************/
 	/* Function: 0x55 */
-	[todo] WERROR spoolss_55(
+	WERROR spoolss_AddPerMachineConnection(
+		[in,unique] [string,charset(UTF16)] uint16 *server,
+		[in,ref] [string,charset(UTF16)] uint16 *printername,
+		[in,ref] [string,charset(UTF16)] uint16 *printserver,
+		[in,ref] [string,charset(UTF16)] uint16 *provider
 	);
 
 	/******************/
 	/* Function: 0x56 */
-	[todo] WERROR spoolss_56(
+	WERROR spoolss_DeletePerMachineConnection(
+		[in,unique] [string,charset(UTF16)] uint16 *server,
+		[in,ref] [string,charset(UTF16)] uint16 *printername
 	);
 
 	/******************/
 	/* Function: 0x57 */
-	[todo] WERROR spoolss_57(
+	[todo] WERROR spoolss_EnumPerMachineConnections(
 	);
 
 	/******************/
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 648aa34..66dd5a9 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -821,35 +821,39 @@ static int vfswrap_ntimes(vfs_handle_struct *handle,
 
 static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T len)
 {
-	SMB_STRUCT_STAT st;
 	SMB_OFF_T space_to_write;
 	uint64_t space_avail;
 	uint64_t bsize,dfree,dsize;
 	int ret;
+	NTSTATUS status;
+	SMB_STRUCT_STAT *pst;
 
-	if (SMB_VFS_FSTAT(fsp, &st) == -1)
+	status = vfs_stat_fsp(fsp);
+	if (!NT_STATUS_IS_OK(status)) {
 		return -1;
+	}
+	pst = &fsp->fsp_name->st;
 
 #ifdef S_ISFIFO
-	if (S_ISFIFO(st.st_ex_mode))
+	if (S_ISFIFO(pst->st_ex_mode))
 		return 0;
 #endif
 
-	if (st.st_ex_size == len)
+	if (pst->st_ex_size == len)
 		return 0;
 
 	/* Shrink - just ftruncate. */
-	if (st.st_ex_size > len)
+	if (pst->st_ex_size > len)
 		return sys_ftruncate(fsp->fh->fd, len);
 
-	space_to_write = len - st.st_ex_size;
+	space_to_write = len - pst->st_ex_size;
 
 	/* for allocation try posix_fallocate first. This can fail on some
 	   platforms e.g. when the filesystem doesn't support it and no
 	   emulation is being done by the libc (like on AIX with JFS1). In that
 	   case we do our own emulation. posix_fallocate implementations can
 	   return ENOTSUP or EINVAL in cases like that. */
-	ret = SMB_VFS_POSIX_FALLOCATE(fsp, st.st_ex_size, space_to_write);
+	ret = SMB_VFS_POSIX_FALLOCATE(fsp, pst->st_ex_size, space_to_write);
 	if (ret == ENOSPC) {
 		errno = ENOSPC;
 		return -1;
@@ -872,7 +876,7 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
 	}
 
 	/* Write out the real space on disk. */
-	ret = vfs_slow_fallocate(fsp, st.st_ex_size, space_to_write);
+	ret = vfs_slow_fallocate(fsp, pst->st_ex_size, space_to_write);
 	if (ret != 0) {
 		errno = ret;
 		ret = -1;
@@ -884,7 +888,8 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
 static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T len)
 {
 	int result = -1;
-	SMB_STRUCT_STAT st;
+	SMB_STRUCT_STAT *pst;
+	NTSTATUS status;
 	char c = 0;
 
 	START_PROFILE(syscall_ftruncate);
@@ -913,23 +918,25 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_O
 	   size in which case the ftruncate above should have
 	   succeeded or shorter, in which case seek to len - 1 and
 	   write 1 byte of zero */
-	if (SMB_VFS_FSTAT(fsp, &st) == -1) {
+	status = vfs_stat_fsp(fsp);
+	if (!NT_STATUS_IS_OK(status)) {
 		goto done;
 	}
+	pst = &fsp->fsp_name->st;
 
 #ifdef S_ISFIFO
-	if (S_ISFIFO(st.st_ex_mode)) {
+	if (S_ISFIFO(pst->st_ex_mode)) {
 		result = 0;
 		goto done;
 	}
 #endif
 
-	if (st.st_ex_size == len) {
+	if (pst->st_ex_size == len) {
 		result = 0;
 		goto done;
 	}
 
-	if (st.st_ex_size > len) {
+	if (pst->st_ex_size > len) {
 		/* the sys_ftruncate should have worked */
 		goto done;
 	}
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 56991ac..65314df 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -10388,33 +10388,33 @@ WERROR _spoolss_53(struct pipes_struct *p,
 }
 
 /****************************************************************
- _spoolss_55
+ _spoolss_AddPerMachineConnection
 ****************************************************************/
 
-WERROR _spoolss_55(struct pipes_struct *p,
-		   struct spoolss_55 *r)
+WERROR _spoolss_AddPerMachineConnection(struct pipes_struct *p,
+					struct spoolss_AddPerMachineConnection *r)
 {
 	p->rng_fault_state = true;
 	return WERR_NOT_SUPPORTED;
 }
 
 /****************************************************************
- _spoolss_56
+ _spoolss_DeletePerMachineConnection
 ****************************************************************/
 
-WERROR _spoolss_56(struct pipes_struct *p,
-		   struct spoolss_56 *r)
+WERROR _spoolss_DeletePerMachineConnection(struct pipes_struct *p,
+					   struct spoolss_DeletePerMachineConnection *r)
 {
 	p->rng_fault_state = true;
 	return WERR_NOT_SUPPORTED;
 }
 
 /****************************************************************
- _spoolss_57
+ _spoolss_EnumPerMachineConnections
 ****************************************************************/
 
-WERROR _spoolss_57(struct pipes_struct *p,
-		   struct spoolss_57 *r)
+WERROR _spoolss_EnumPerMachineConnections(struct pipes_struct *p,
+					  struct spoolss_EnumPerMachineConnections *r)
 {
 	p->rng_fault_state = true;
 	return WERR_NOT_SUPPORTED;
diff --git a/source4/rpc_server/spoolss/dcesrv_spoolss.c b/source4/rpc_server/spoolss/dcesrv_spoolss.c
index 66cd14d..4c22d35 100644
--- a/source4/rpc_server/spoolss/dcesrv_spoolss.c
+++ b/source4/rpc_server/spoolss/dcesrv_spoolss.c
@@ -1445,30 +1445,30 @@ static WERROR dcesrv_spoolss_DeletePrinterDriverEx(struct dcesrv_call_state *dce
 
 
 /* 
-  spoolss_55 
+  spoolss_AddPerMachineConnection
 */
-static WERROR dcesrv_spoolss_55(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
-		       struct spoolss_55 *r)
+static WERROR dcesrv_spoolss_AddPerMachineConnection(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
+		       struct spoolss_AddPerMachineConnection *r)
 {
 	DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
 }
 
 
 /* 
-  spoolss_56 
+  spoolss_DeletePerMachineConnection
 */
-static WERROR dcesrv_spoolss_56(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
-		       struct spoolss_56 *r)
+static WERROR dcesrv_spoolss_DeletePerMachineConnection(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
+		       struct spoolss_DeletePerMachineConnection *r)
 {
 	DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
 }
 
 
 /* 
-  spoolss_57 
+  spoolss_EnumPerMachineConnections
 */
-static WERROR dcesrv_spoolss_57(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
-		       struct spoolss_57 *r)
+static WERROR dcesrv_spoolss_EnumPerMachineConnections(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
+		       struct spoolss_EnumPerMachineConnections *r)
 {
 	DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
 }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list