summaryrefslogtreecommitdiff
path: root/source3/printing/print_generic.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-04-14 00:19:12 +0000
committerJeremy Allison <jra@samba.org>2001-04-14 00:19:12 +0000
commit53850c51caf1c4d53ff285b2e5505e0615beeeee (patch)
tree03e7d594efd340da6909e0efa2cf3dd05b6a610b /source3/printing/print_generic.c
parent9444e9d9f350961b594a1acbe7a7652d97faec0a (diff)
downloadsamba-53850c51caf1c4d53ff285b2e5505e0615beeeee.tar.gz
configure:
configure.in: include/config.h.in: include/profile.h: smbd/vfs-wrap.c: smbd/vfs.c: Added fchmod and fchown to VFS (sorry Gerald - but we needed them anyway). smbd/dosmode.c: smbd/files.c: printing/printfsp.c: smbd/close.c: smbd/open.c: Fixed "dos filemode" correctly so there are no race conditions. Forces test of open of file O_WRONLY before allowing fchmod as root. Afterwards, calls standard close function that preserves POSIX locks due to POSIX-me-harder braindamage. :-). Andrew please review this code. Also - in removing the tmpdir param in smbrun an extra NULL parameter was missed in each print_run_command() call (which is a varargs fn.). Now fixed. Jeremy. (This used to be commit 32397e5bc6d995ce7ca37c82d6aedc1e5b1b6fbd)
Diffstat (limited to 'source3/printing/print_generic.c')
-rw-r--r--source3/printing/print_generic.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/source3/printing/print_generic.c b/source3/printing/print_generic.c
index eff394593ce..ef38d26493c 100644
--- a/source3/printing/print_generic.c
+++ b/source3/printing/print_generic.c
@@ -104,7 +104,7 @@ static int generic_job_delete(int snum, struct printjob *pjob)
slprintf(jobstr, sizeof(jobstr)-1, "%d", pjob->sysjob);
return print_run_command(
snum,
- lp_lprmcommand(snum), NULL, NULL,
+ lp_lprmcommand(snum), NULL,
"%j", jobstr,
"%T", http_timestring(pjob->starttime),
NULL);
@@ -120,7 +120,7 @@ static int generic_job_pause(int snum, struct printjob *pjob)
/* need to pause the spooled entry */
slprintf(jobstr, sizeof(jobstr)-1, "%d", pjob->sysjob);
return print_run_command(snum,
- lp_lppausecommand(snum), NULL, NULL,
+ lp_lppausecommand(snum), NULL,
"%j", jobstr,
NULL);
}
@@ -135,7 +135,7 @@ static int generic_job_resume(int snum, struct printjob *pjob)
/* need to pause the spooled entry */
slprintf(jobstr, sizeof(jobstr)-1, "%d", pjob->sysjob);
return print_run_command(snum,
- lp_lpresumecommand(snum), NULL, NULL,
+ lp_lpresumecommand(snum), NULL,
"%j", jobstr,
NULL);
}
@@ -172,7 +172,7 @@ static int generic_job_submit(int snum, struct printjob *pjob)
/* send it to the system spooler */
ret = print_run_command(snum,
- lp_printcommand(snum), NULL, NULL,
+ lp_printcommand(snum), NULL,
"%s", p,
"%J", jobname,
"%f", p,
@@ -189,11 +189,8 @@ get the current list of queued jobs
****************************************************************************/
static int generic_queue_get(int snum, print_queue_struct **q, print_status_struct *status)
{
- char *path = lp_pathname(snum);
- char *cmd = lp_lpqcommand(snum);
char **qlines;
int fd;
- pstring tmp_file;
int numlines, i, qcount;
print_queue_struct *queue = NULL;
fstring printer_name;
@@ -202,10 +199,7 @@ static int generic_queue_get(int snum, print_queue_struct **q, print_status_stru
fstrcpy(printer_name, lp_servicename(snum));
dos_to_unix(printer_name, True);
- slprintf(tmp_file, sizeof(tmp_file)-1, "%s/smblpq.%d", path, sys_getpid());
-
- unlink(tmp_file);
- print_run_command(snum, cmd, &fd, tmp_file, NULL);
+ print_run_command(snum, lp_lpqcommand(snum), &fd, NULL);
if (fd == -1) {
DEBUG(5,("generic_queue_get: Can't read print queue status for printer %s\n",
@@ -243,8 +237,7 @@ static int generic_queue_get(int snum, print_queue_struct **q, print_status_stru
****************************************************************************/
static int generic_queue_pause(int snum)
{
- return print_run_command(snum, lp_queuepausecommand(snum), NULL, NULL,
- NULL);
+ return print_run_command(snum, lp_queuepausecommand(snum), NULL, NULL);
}
/****************************************************************************
@@ -252,6 +245,5 @@ static int generic_queue_pause(int snum)
****************************************************************************/
static int generic_queue_resume(int snum)
{
- return print_run_command(snum, lp_queueresumecommand(snum), NULL, NULL,
- NULL);
+ return print_run_command(snum, lp_queueresumecommand(snum), NULL, NULL);
}