summaryrefslogtreecommitdiff
path: root/source3/printing/nt_printing.c
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
commitabe6aff924ed56a36ba6390d692446019bef0f21 (patch)
treeab5b4fe34c0ef260e843fc7aa4bb1a5774e8c6b1 /source3/printing/nt_printing.c
parent585d0efbc6428e5876d354fee49c241c1bad809d (diff)
downloadsamba-abe6aff924ed56a36ba6390d692446019bef0f21.tar.gz
samba-abe6aff924ed56a36ba6390d692446019bef0f21.tar.bz2
samba-abe6aff924ed56a36ba6390d692446019bef0f21.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! (This used to be commit f85c976acc08a16bce6cb4053708485ccdea0d77)
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r--source3/printing/nt_printing.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index b03f9ff213..ae3c43fd93 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/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;
}