summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_spoolss_nt.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-05-27 09:53:11 +0000
committerAndrew Tridgell <tridge@samba.org>2000-05-27 09:53:11 +0000
commit5f7c40f6d02df70dd3a92d5658f79b668e0ed5df (patch)
tree2532d4f40a220d77bd4118e56c599acd51cc5353 /source3/rpc_server/srv_spoolss_nt.c
parent712a30ed51ca2b58e00d38a5d6d70d564b1da11b (diff)
downloadsamba-5f7c40f6d02df70dd3a92d5658f79b668e0ed5df.tar.gz
samba-5f7c40f6d02df70dd3a92d5658f79b668e0ed5df.tar.bz2
samba-5f7c40f6d02df70dd3a92d5658f79b668e0ed5df.zip
getting and setting security descriptors on printers now works
this needed some fixes in tdb_unpack(). Tim, you'll need to update (This used to be commit 9422719ab4c35e4ce3199b62dd632433bf391283)
Diffstat (limited to 'source3/rpc_server/srv_spoolss_nt.c')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 29294f1783..01535b2933 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -2620,9 +2620,6 @@ static void construct_printer_driver_info_3(DRIVER_INFO_3 *info, int snum,
get_a_printer_driver(&driver, 3, printer.info_2->drivername, architecture);
fill_printer_driver_info_3(info, driver, servername, architecture);
-
- free_a_printer_driver(driver, 3);
- free_a_printer(printer, 2);
}
/****************************************************************************
@@ -2933,6 +2930,23 @@ static uint32 control_printer(const POLICY_HND *handle, uint32 command)
* called by spoolss_api_setprinter
* when updating a printer description
********************************************************************/
+static uint32 update_printer_sec(const POLICY_HND *handle, uint32 level,
+ const SPOOL_PRINTER_INFO_LEVEL *info,
+ const SEC_DESC_BUF *secdesc_ctr)
+{
+ Printer_entry *Printer = find_printer_index_by_hnd(handle);
+
+ if (!OPEN_HANDLE(Printer))
+ return ERROR_INVALID_HANDLE;
+
+ return nt_printing_setsec(Printer->dev.printername, secdesc_ctr);
+}
+
+
+/********************************************************************
+ * called by spoolss_api_setprinter
+ * when updating a printer description
+ ********************************************************************/
static uint32 update_printer(const POLICY_HND *handle, uint32 level,
const SPOOL_PRINTER_INFO_LEVEL *info,
const DEVICEMODE *devmode)
@@ -3002,6 +3016,7 @@ static uint32 update_printer(const POLICY_HND *handle, uint32 level,
uint32 _spoolss_setprinter(const POLICY_HND *handle, uint32 level,
const SPOOL_PRINTER_INFO_LEVEL *info,
const DEVMODE_CTR devmode_ctr,
+ const SEC_DESC_BUF *secdesc_ctr,
uint32 command)
{
Printer_entry *Printer = find_printer_index_by_hnd(handle);
@@ -3017,6 +3032,9 @@ uint32 _spoolss_setprinter(const POLICY_HND *handle, uint32 level,
case 2:
return update_printer(handle, level, info, devmode_ctr.devmode);
break;
+ case 3:
+ return update_printer_sec(handle, level, info, secdesc_ctr);
+ break;
default:
return ERROR_INVALID_LEVEL;
break;