summaryrefslogtreecommitdiffstats
path: root/source/printing
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-11-26 03:39:16 +0000
committerTim Potter <tpot@samba.org>2001-11-26 03:39:16 +0000
commitf85c976acc08a16bce6cb4053708485ccdea0d77 (patch)
tree37d4dbcb45ba0671047b5942aaa4be0689ebf347 /source/printing
parent778f5f77a66cda76348a7c6f64cd63afe2bfe077 (diff)
downloadsamba-f85c976acc08a16bce6cb4053708485ccdea0d77.tar.gz
samba-f85c976acc08a16bce6cb4053708485ccdea0d77.tar.xz
samba-f85c976acc08a16bce6cb4053708485ccdea0d77.zip
Merge from appliance-head: when creating a default security descriptor
for a printer, save it in ntprinters.tdb instead of recreating it every time it is required. This can save at least one winbind lookup per secdesc creation. Opening a port monitor and viewing the security tab in the properties dialog required the security descriptor to be returned 25 times!
Diffstat (limited to 'source/printing')
-rw-r--r--source/printing/nt_printing.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c
index b03f9ff213d..ae3c43fd93a 100644
--- a/source/printing/nt_printing.c
+++ b/source/printing/nt_printing.c
@@ -3523,7 +3523,7 @@ static SEC_DESC_BUF *construct_default_printer_sdb(TALLOC_CTX *ctx)
}
if (!psd) {
- DEBUG(0,("construct_default_printer_sd: Failed to make SEC_DESC.\n"));
+ DEBUG(0,("construct_default_printer_sdb: Failed to make SEC_DESC.\n"));
return NULL;
}
@@ -3562,6 +3562,16 @@ BOOL nt_printing_getsec(TALLOC_CTX *ctx, char *printername, SEC_DESC_BUF **secde
return False;
}
+ /* Save default security descriptor for later */
+
+ prs_init(&ps, (uint32)sec_desc_size((*secdesc_ctr)->sec) +
+ sizeof(SEC_DESC_BUF), ctx, MARSHALL);
+
+ if (sec_io_desc_buf("nt_printing_setsec", secdesc_ctr, &ps, 1))
+ tdb_prs_store(tdb_printers, key, &ps);
+
+ prs_mem_free(&ps);
+
return True;
}