diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-07-28 08:14:17 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-07-28 08:14:17 +0000 |
commit | 551d50c4e2bdde0b4f92001c92f8f69ffade44ad (patch) | |
tree | 3b75016e14af5a3658312baa6d08d418b6993926 /source3/param/loadparm.c | |
parent | 24d71da71d107c16c0d322b9c9f7b0073841c9f4 (diff) | |
download | samba-551d50c4e2bdde0b4f92001c92f8f69ffade44ad.tar.gz samba-551d50c4e2bdde0b4f92001c92f8f69ffade44ad.tar.bz2 samba-551d50c4e2bdde0b4f92001c92f8f69ffade44ad.zip |
This patch does two things:
The first is to add sensible quotes to various default paramaters, and the
second is to ensure that we don't remove to many " characters from paramaters.
(Both from the debian patches to Samba).
Andrew Bartlett
(This used to be commit 03892bcfbb566f866fa8943dc42b844d833690f4)
Diffstat (limited to 'source3/param/loadparm.c')
-rw-r--r-- | source3/param/loadparm.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6f976cda64..445663f547 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1060,26 +1060,26 @@ static void init_printer_values(void) case PRINT_AIX: case PRINT_LPRNT: case PRINT_LPROS2: - string_set(&sDefault.szLpqcommand, "lpq -P%p"); - string_set(&sDefault.szLprmcommand, "lprm -P%p %j"); + string_set(&sDefault.szLpqcommand, "lpq -P'%p'"); + string_set(&sDefault.szLprmcommand, "lprm -P'%p' %j"); string_set(&sDefault.szPrintcommand, - "lpr -r -P%p %s"); + "lpr -r -P'%p' %s"); break; case PRINT_LPRNG: case PRINT_PLP: - string_set(&sDefault.szLpqcommand, "lpq -P%p"); - string_set(&sDefault.szLprmcommand, "lprm -P%p %j"); + string_set(&sDefault.szLpqcommand, "lpq -P'%p'"); + string_set(&sDefault.szLprmcommand, "lprm -P'%p' %j"); string_set(&sDefault.szPrintcommand, - "lpr -r -P%p %s"); + "lpr -r -P'%p' %s"); string_set(&sDefault.szQueuepausecommand, - "lpc stop %p"); + "lpc stop '%p'"); string_set(&sDefault.szQueueresumecommand, - "lpc start %p"); + "lpc start '%p'"); string_set(&sDefault.szLppausecommand, - "lpc hold %p %j"); + "lpc hold '%p' %j"); string_set(&sDefault.szLpresumecommand, - "lpc release %p %j"); + "lpc release '%p' %j"); break; case PRINT_CUPS: @@ -1095,19 +1095,19 @@ static void init_printer_values(void) string_set(&Globals.szPrintcapname, "cups"); #else string_set(&sDefault.szLpqcommand, - "/usr/bin/lpstat -o %p"); + "/usr/bin/lpstat -o '%p'"); string_set(&sDefault.szLprmcommand, - "/usr/bin/cancel %p-%j"); + "/usr/bin/cancel '%p-%j'"); string_set(&sDefault.szPrintcommand, - "/usr/bin/lp -d %p %s; rm %s"); + "/usr/bin/lp -d '%p' %s; rm %s"); string_set(&sDefault.szLppausecommand, - "lp -i %p-%j -H hold"); + "lp -i '%p-%j' -H hold"); string_set(&sDefault.szLpresumecommand, - "lp -i %p-%j -H resume"); + "lp -i '%p-%j' -H resume"); string_set(&sDefault.szQueuepausecommand, - "/usr/bin/disable %p"); + "/usr/bin/disable '%p'"); string_set(&sDefault.szQueueresumecommand, - "/usr/bin/enable %p"); + "/usr/bin/enable '%p'"); string_set(&Globals.szPrintcapname, "lpstat"); #endif /* HAVE_CUPS */ break; @@ -1413,7 +1413,10 @@ static char *lp_string(const char *s) else StrnCpy(ret, s, len); - trim_string(ret, "\"", "\""); + if (trim_string(ret, "\"", "\"")) { + if (strchr(ret,'"') != NULL) + StrnCpy(ret, s, len); + } standard_sub_basic(current_user_info.smb_name,ret,len+100); return (ret); |