From 8453b27983fd91986867a5eed4f5ae5d65ab4bfb Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 17 Jul 2000 05:37:16 +0000 Subject: [PATCH] Initialise current time to time(NULL) in add_a_printer_2() Added get and free security old descriptor in nt_printing_setsec() after access checking was moved up to rpc level. (This used to be commit a5b7cafc87e14ca3f28dcfc1ed6bcc6f47e79639) --- source3/printing/nt_printing.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 1496fb90d8d..00735ecbc18 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -613,7 +613,7 @@ static uint32 add_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info) int buflen, len, ret; TDB_DATA kbuf, dbuf; NTTIME time_nt; - time_t time_unix; + time_t time_unix = time(NULL); /* * in addprinter: no servername and the printer is the name @@ -1502,6 +1502,8 @@ uint32 nt_printing_setsec(char *printername, SEC_DESC_BUF *secdesc_ctr) SEC_DESC *psd = NULL; size_t size; + nt_printing_getsec(printername, &old_secdesc_ctr); + /* Pick out correct owner and group sids */ owner_sid = secdesc_ctr->sec->owner_sid ? @@ -1526,6 +1528,7 @@ uint32 nt_printing_setsec(char *printername, SEC_DESC_BUF *secdesc_ctr) /* Free up memory */ free_sec_desc(&psd); + free_sec_desc_buf(&old_secdesc_ctr); } if (!new_secdesc_ctr) {