#include "includes.h"
#include "printing.h"
+#include "smbd/proto.h"
-extern struct current_user current_user;
extern userdom_struct current_user_info;
/****************************************************************************
}
if (do_sub && snum != -1) {
- syscmd = talloc_sub_advanced(ctx,
- lp_servicename(snum),
+ syscmd = talloc_sub_full(ctx,
+ lp_servicename(talloc_tos(), snum),
current_user_info.unix_name,
"",
- current_user.ut.gid,
+ get_current_gid(NULL),
get_current_username(),
current_user_info.domain,
syscmd);
}
}
- ret = smbrun_no_sanitize(syscmd,outfd);
+ ret = smbrun_no_sanitize(syscmd, outfd, NULL);
DEBUG(3,("Running the command `%s' gave %d\n",syscmd,ret));
/* need to pause the spooled entry */
slprintf(jobstr, sizeof(jobstr)-1, "%d", pjob->sysjob);
- return print_run_command(snum, lp_printername(snum), True,
- lp_lppausecommand(snum), NULL,
+ return print_run_command(snum, lp_printername(talloc_tos(), snum), True,
+ lp_lppause_command(talloc_tos(), snum), NULL,
"%j", jobstr,
NULL);
}
/* need to pause the spooled entry */
slprintf(jobstr, sizeof(jobstr)-1, "%d", pjob->sysjob);
- return print_run_command(snum, lp_printername(snum), True,
- lp_lpresumecommand(snum), NULL,
+ return print_run_command(snum, lp_printername(talloc_tos(), snum), True,
+ lp_lpresume_command(talloc_tos(), snum), NULL,
"%j", jobstr,
NULL);
}
slprintf(job_size, sizeof(job_size)-1, "%lu", (unsigned long)pjob->size);
/* send it to the system spooler */
- ret = print_run_command(snum, lp_printername(snum), True,
- lp_printcommand(snum), NULL,
+ ret = print_run_command(snum, lp_printername(talloc_tos(), snum), True,
+ lp_print_command(talloc_tos(), snum), NULL,
"%s", p,
"%J", jobname,
"%f", p,
* determine the backend job identifier (sysjob).
*/
pjob->sysjob = -1;
- ret = generic_queue_get(lp_printername(snum), printing_type, lpq_cmd,
- &q, &status);
+ ret = generic_queue_get(lp_printername(talloc_tos(), snum),
+ printing_type, lpq_cmd, &q, &status);
if (ret > 0) {
int i;
for (i = 0; i < ret; i++) {
ret = 0;
}
if (pjob->sysjob == -1) {
- DEBUG(0, ("failed to get sysjob for job %u (%s), tracking as "
+ DEBUG(2, ("failed to get sysjob for job %u (%s), tracking as "
"Unix job\n", pjob->jobid, jobname));
}
****************************************************************************/
static int generic_queue_pause(int snum)
{
- return print_run_command(snum, lp_printername(snum), True,
- lp_queuepausecommand(snum), NULL, NULL);
+ return print_run_command(snum, lp_printername(talloc_tos(), snum), True,
+ lp_queuepause_command(talloc_tos(), snum), NULL, NULL);
}
/****************************************************************************
****************************************************************************/
static int generic_queue_resume(int snum)
{
- return print_run_command(snum, lp_printername(snum), True,
- lp_queueresumecommand(snum), NULL, NULL);
+ return print_run_command(snum, lp_printername(talloc_tos(), snum), True,
+ lp_queueresume_command(talloc_tos(), snum), NULL, NULL);
}
/****************************************************************************