From a3a28675fafbbc5a5a378b3a7235253d772ef63e Mon Sep 17 00:00:00 2001 From: David O'Neill Date: Fri, 1 Sep 2000 18:49:26 +0000 Subject: Changes from APPLIANCE_HEAD (per Tim Potter): - make proto - addition of function to convert from errno values to NT status codes (source/lib/error.c) - purge queue done without full access permission will purge only the jobs owned by that user, rather than failing. - unlock job database tdb before sending job to printer - in print_job_start(), ensure that we don't pick a jobid with an existing temporary file that may be owned by another user, as it causes silent failures. - fixes for printer permission checking for NT5 clients (source/include/rpc_spoolss.h, source/printing/nt_printing.c, source/printing/printing.c, source/rpc_server/srv_spoolss_nt.c) - change from uint8 to 'enum SID_NAME_USE' (source/rpc_server/srv_lsa.c) - fixed memory leaks for win95 driver download process (source/smbd/lanman.c) - properly free prs_structs and dacl in testsuite/printing/psec.c (This used to be commit 74af3e2caec7197e5d1ca389e2f78054a4197502) --- source3/smbd/lanman.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'source3/smbd/lanman.c') diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c index 6595163ba9..54bfa3155b 100644 --- a/source3/smbd/lanman.c +++ b/source3/smbd/lanman.c @@ -540,7 +540,7 @@ static void fill_printq_info_52(connection_struct *conn, int snum, int uLevel, DEBUG(3,("Can't open %s - %s\n", lp_driverfile(snum), strerror(errno))); desc->errcode=NERR_notsupported; - return; + goto done; } /* lookup the long printer driver name in the file description */ @@ -651,14 +651,16 @@ static void fill_printq_info_52(connection_struct *conn, int snum, int uLevel, SERVICE(snum),count)); desc->errcode=NERR_Success; - file_lines_free(lines); - return; + goto done; } err: DEBUG(3,("fill_printq_info: Can't supply driver files\n")); desc->errcode=NERR_notsupported; + + done: + safe_free(info); file_lines_free(lines); } @@ -741,7 +743,7 @@ static void fill_printq_info(connection_struct *conn, int snum, int uLevel, /* This function returns the number of files for a given driver */ static int get_printerdrivernumber(int snum) { - int i; + int i, result = 0; BOOL ok = False; pstring tok; char *p; @@ -777,7 +779,7 @@ static int get_printerdrivernumber(int snum) if (!lines) { DEBUG(3,("Can't open %s - %s\n", lp_driverfile(snum),strerror(errno))); - return 0; + goto done; } /* lookup the long printer driver name in the file description */ @@ -800,22 +802,24 @@ static int get_printerdrivernumber(int snum) while (*p && i) { if (*p++ == ':') i--; } - if (!*p || i) - goto err; + if (!*p || i) { + DEBUG(3,("Can't determine number of printer driver files\n")); + goto done; + } /* count the number of files */ while (next_token(&p,tok,",",sizeof(tok))) i++; - file_lines_free(lines); - return(i); + result = i; } - err: + done: - DEBUG(3,("Can't determine number of printer driver files\n")); + safe_free(info); file_lines_free(lines); - return (0); + + return result; } static BOOL api_DosPrintQGetInfo(connection_struct *conn, -- cgit