diff options
author | Simo Sorce <idra@samba.org> | 2010-04-26 18:50:44 -0400 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2010-07-27 10:27:10 -0400 |
commit | a1fe2ed68aef71083dc6a9938440e32e5a0cf63c (patch) | |
tree | 302c14b90ef5ae2a5ac807cd737155eb06ea7f1c /source3/printing | |
parent | fdf669d37744487a7671b1d90541dbc21a41aeb6 (diff) | |
download | samba-a1fe2ed68aef71083dc6a9938440e32e5a0cf63c.tar.gz samba-a1fe2ed68aef71083dc6a9938440e32e5a0cf63c.tar.bz2 samba-a1fe2ed68aef71083dc6a9938440e32e5a0cf63c.zip |
s3-spoolss: Use winreg_delete_printer_key to delete printers.
Signed-off-by: Jim McDonough <jmcd@samba.org>
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/nt_printing.c | 43 |
1 files changed, 11 insertions, 32 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index a3b5c7f1dc..74a2dc433e 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -2114,38 +2114,6 @@ static int pack_values(NT_PRINTER_DATA *data, uint8 *buf, int buflen) /**************************************************************************** - Delete a printer - this just deletes the printer info file, any open - handles are not affected. -****************************************************************************/ - -uint32 del_a_printer(const char *sharename) -{ - TDB_DATA kbuf; - char *printdb_path = NULL; - TALLOC_CTX *ctx = talloc_tos(); - - kbuf = make_printer_tdbkey(ctx, sharename); - tdb_delete(tdb_printers, kbuf); - - kbuf= make_printers_secdesc_tdbkey(ctx, sharename); - tdb_delete(tdb_printers, kbuf); - - close_all_print_db(); - - if (geteuid() == sec_initial_uid()) { - if (asprintf(&printdb_path, "%s%s.tdb", - cache_path("printing/"), - sharename) < 0) { - return (uint32)-1; - } - unlink(printdb_path); - SAFE_FREE(printdb_path); - } - - return 0; -} - -/**************************************************************************** ****************************************************************************/ static WERROR update_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info) { @@ -5238,4 +5206,15 @@ bool print_time_access_check(struct auth_serversupplied_info *server_info, return ok; } +void nt_printer_remove(TALLOC_CTX *mem_ctx, + struct auth_serversupplied_info *server_info, + const char *printer) +{ + WERROR result; + result = winreg_delete_printer_key(mem_ctx, server_info, printer, ""); + if (!W_ERROR_IS_OK(result)) { + DEBUG(0, ("nt_printer_remove: failed to remove rpinter %s", + printer)); + } +} |