Skip to content

Commit

Permalink
spoolss: purge the printer name cache on name change
Browse files Browse the repository at this point in the history
Currently the name cache is only cleared on printer deletion. This means
that if a printer undergoes a name change, the old name remains in the
cache and can be subsequently used incorrecly if another printer takes
the same name as the old.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11210

Reported-by: Franz Pförtsch <[email protected]>
Signed-off-by: David Disseldorp <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>

Autobuild-User(master): Jeremy Allison <[email protected]>
Autobuild-Date(master): Tue Apr 14 05:37:50 CEST 2015 on sn-devel-104
  • Loading branch information
ddiss authored and jrasamba committed Apr 14, 2015
1 parent 2d4db4a commit a97507a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source3/rpc_server/spoolss/srv_spoolss_nt.c
Original file line number Diff line number Diff line change
Expand Up @@ -6479,6 +6479,9 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx,
snum, printer->sharename ?
printer->sharename : "");
}

/* name change, purge any cache entries for the old */
prune_printername_cache();
}

if (printer->printername != NULL &&
Expand Down Expand Up @@ -6515,6 +6518,9 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx,
notify_printer_printername(server_event_context(),
msg_ctx, snum, p ? p : "");
}

/* name change, purge any cache entries for the old */
prune_printername_cache();
}

if (printer->portname != NULL &&
Expand Down

0 comments on commit a97507a

Please sign in to comment.