diff options
author | Gerald Carter <jerry@samba.org> | 2005-01-05 16:20:35 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:53:46 -0500 |
commit | d097ea490525e7a35739dae6a295fd03ba52cfc0 (patch) | |
tree | 131dc7af2e2e944283c70d255d8ad5d6bbef0726 /source3/printing/nt_printing.c | |
parent | 846b8d4cfdee815cd22d7e00b7f120668f9758a9 (diff) | |
download | samba-d097ea490525e7a35739dae6a295fd03ba52cfc0.tar.gz samba-d097ea490525e7a35739dae6a295fd03ba52cfc0.tar.bz2 samba-d097ea490525e7a35739dae6a295fd03ba52cfc0.zip |
r4539: patch from Rob -- adding real printcap name cache function to speed up printcap reloads
(This used to be commit 1cad5250932b963c2eb9b775221b13db386d601b)
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r-- | source3/printing/nt_printing.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 3ffedcf185..a72f63009a 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -2046,17 +2046,32 @@ static int pack_values(NT_PRINTER_DATA *data, char *buf, int buflen) handles are not affected. ****************************************************************************/ -uint32 del_a_printer(char *sharename) +uint32 del_a_printer(const char *sharename) { pstring key; TDB_DATA kbuf; + pstring printdb_path; slprintf(key, sizeof(key)-1, "%s%s", PRINTERS_PREFIX, sharename); - kbuf.dptr=key; kbuf.dsize=strlen(key)+1; + tdb_delete(tdb_printers, kbuf); + slprintf(key, sizeof(key)-1, "%s%s", SECDESC_PREFIX, sharename); + kbuf.dptr=key; + kbuf.dsize=strlen(key)+1; tdb_delete(tdb_printers, kbuf); + + close_all_print_db(); + + if (geteuid() == 0) { + pstrcpy(printdb_path, lock_path("printing/")); + pstrcat(printdb_path, sharename); + pstrcat(printdb_path, ".tdb"); + + unlink(printdb_path); + } + return 0; } @@ -2899,7 +2914,8 @@ BOOL is_printer_published(Printer_entry *print_hnd, int snum, return False; } - if (regval_size(guid_val) == sizeof(struct uuid)) + /* fetching printer guids really ought to be a separate function.. */ + if (guid && regval_size(guid_val) == sizeof(struct uuid)) memcpy(guid, regval_data_p(guid_val), sizeof(struct uuid)); free_a_printer(&printer, 2); |