diff options
author | Gerald Carter <jerry@samba.org> | 2005-07-15 17:38:55 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:00:07 -0500 |
commit | eb1123e5009c900c0eb741c0a075f918b16bbeab (patch) | |
tree | bb3a26b18f929f9f0ee577255960797e3fd2988e /source3/printing | |
parent | 6fe54515435e351ba958886cb9a7175c436ef88d (diff) | |
download | samba-eb1123e5009c900c0eb741c0a075f918b16bbeab.tar.gz samba-eb1123e5009c900c0eb741c0a075f918b16bbeab.tar.bz2 samba-eb1123e5009c900c0eb741c0a075f918b16bbeab.zip |
r8506: BUG 2853: don't strip out characters like '$' from printer names
when substituting for the lpq command.
(This used to be commit 2f5de718a98e56fe55d8905b12505dfc3e432544)
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/printing.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c index 0737cf00d1..b49f0716ea 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -43,13 +43,6 @@ static BOOL remove_from_jobs_changed(const char* sharename, uint32 jobid); jobids are assigned when a job starts spooling. */ -struct print_queue_update_context { - char* sharename; - int printing_type; - char* lpqcommand; -}; - - static TDB_CONTEXT *rap_tdb; static uint16 next_rap_jobid; struct rap_jobid_key { @@ -1290,14 +1283,14 @@ this is the receive function of the background lpq updater ****************************************************************************/ static void print_queue_receive(int msg_type, pid_t src, void *buf, size_t msglen) { - struct print_queue_update_context ctx; fstring sharename; pstring lpqcommand; + int printing_type; size_t len; len = tdb_unpack( buf, msglen, "fdP", sharename, - &ctx.printing_type, + &printing_type, lpqcommand ); if ( len == -1 ) { @@ -1305,12 +1298,9 @@ static void print_queue_receive(int msg_type, pid_t src, void *buf, size_t msgle return; } - ctx.sharename = sharename; - ctx.lpqcommand = lpqcommand; - - print_queue_update_with_lock(ctx.sharename, - get_printer_fns_from_type(ctx.printing_type), - ctx.lpqcommand ); + print_queue_update_with_lock(sharename, + get_printer_fns_from_type(printing_type), + lpqcommand ); return; } @@ -1390,8 +1380,10 @@ static void print_queue_update(int snum, BOOL force) fstrcpy( sharename, lp_const_servicename(snum)); + /* don't strip out characters like '$' from the printername */ + pstrcpy( lpqcommand, lp_lpqcommand(snum)); - pstring_sub( lpqcommand, "%p", PRINTERNAME(snum) ); + string_sub2( lpqcommand, "%p", PRINTERNAME(snum), sizeof(lpqcommand), False ); standard_sub_snum( snum, lpqcommand, sizeof(lpqcommand) ); /* |