[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-3046-g9fe0939

Volker Lendecke vlendec at samba.org
Sat Jun 28 14:11:19 GMT 2008


The branch, v3-3-test has been updated
       via  9fe09398b79ae7c5e78182112a8cd2c9b5f99ad3 (commit)
      from  8704c2ab37479236788c0a99465d73643d3d555a (commit)

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


- Log -----------------------------------------------------------------
commit 9fe09398b79ae7c5e78182112a8cd2c9b5f99ad3
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Jun 28 16:09:34 2008 +0200

    Fix a file descriptor leak in add_port_hook
    
    This was probably cut&paste from add_printer_hook which further down has the
    unconditional close(fd). In add_port_hook() we're not interested in the output
    of 'addport command', so don't create the out fd.
    (cherry picked from commit 0c5ca2127ac6e3c71e369242376d27429c3aee5e)

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

Summary of changes:
 source/rpc_server/srv_spoolss_nt.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c
index cb784a6..72ceb1d 100644
--- a/source/rpc_server/srv_spoolss_nt.c
+++ b/source/rpc_server/srv_spoolss_nt.c
@@ -6155,7 +6155,6 @@ WERROR add_port_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, const char *portname
 	char *cmd = lp_addport_cmd();
 	char *command = NULL;
 	int ret;
-	int fd;
 	SE_PRIV se_printop = SE_PRINT_OPERATOR;
 	bool is_print_op = False;
 
@@ -6179,7 +6178,7 @@ WERROR add_port_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, const char *portname
 	if ( is_print_op )
 		become_root();
 
-	ret = smbrun(command, &fd);
+	ret = smbrun(command, NULL);
 
 	if ( is_print_op )
 		unbecome_root();
@@ -6191,8 +6190,6 @@ WERROR add_port_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, const char *portname
 	TALLOC_FREE(command);
 
 	if ( ret != 0 ) {
-		if (fd != -1)
-			close(fd);
 		return WERR_ACCESS_DENIED;
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list