mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
r242: adding 'cups options' parameter to allow raw printing without changing /etc/cups/cupsd.conf -- documentation to follow
(This used to be commit 2f323b0991
)
This commit is contained in:
parent
5b6286b26b
commit
578a7d254f
@ -539,7 +539,7 @@ enum {LPQ_QUEUED=0,LPQ_PAUSED,LPQ_SPOOLING,LPQ_PRINTING,LPQ_ERROR,LPQ_DELETING,
|
|||||||
|
|
||||||
typedef struct _print_queue_struct
|
typedef struct _print_queue_struct
|
||||||
{
|
{
|
||||||
int job; /* normally the SMB jobid -- see note in
|
int job; /* normally the UNIX jobid -- see note in
|
||||||
printing.c:traverse_fn_delete() */
|
printing.c:traverse_fn_delete() */
|
||||||
int size;
|
int size;
|
||||||
int page_count;
|
int page_count;
|
||||||
|
@ -315,6 +315,7 @@ typedef struct
|
|||||||
char *szPostExec;
|
char *szPostExec;
|
||||||
char *szRootPreExec;
|
char *szRootPreExec;
|
||||||
char *szRootPostExec;
|
char *szRootPostExec;
|
||||||
|
char *szCupsOptions;
|
||||||
char *szPrintcommand;
|
char *szPrintcommand;
|
||||||
char *szLpqcommand;
|
char *szLpqcommand;
|
||||||
char *szLprmcommand;
|
char *szLprmcommand;
|
||||||
@ -438,6 +439,7 @@ static service sDefault = {
|
|||||||
NULL, /* szPostExec */
|
NULL, /* szPostExec */
|
||||||
NULL, /* szRootPreExec */
|
NULL, /* szRootPreExec */
|
||||||
NULL, /* szRootPostExec */
|
NULL, /* szRootPostExec */
|
||||||
|
NULL, /* szCupsOptions */
|
||||||
NULL, /* szPrintcommand */
|
NULL, /* szPrintcommand */
|
||||||
NULL, /* szLpqcommand */
|
NULL, /* szLpqcommand */
|
||||||
NULL, /* szLprmcommand */
|
NULL, /* szLprmcommand */
|
||||||
@ -952,6 +954,7 @@ static struct parm_struct parm_table[] = {
|
|||||||
{"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT},
|
{"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT},
|
||||||
{"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_HIDE},
|
{"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_HIDE},
|
||||||
{"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, handle_printing, enum_printing, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
|
{"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, handle_printing, enum_printing, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
|
||||||
|
{"cups options", P_STRING, P_LOCAL, &sDefault.szCupsOptions, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
|
||||||
{"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
|
{"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
|
||||||
{"disable spoolss", P_BOOL, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
|
{"disable spoolss", P_BOOL, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
|
||||||
{"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
|
{"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
|
||||||
@ -1800,6 +1803,7 @@ FN_LOCAL_STRING(lp_username, szUsername)
|
|||||||
FN_LOCAL_LIST(lp_invalid_users, szInvalidUsers)
|
FN_LOCAL_LIST(lp_invalid_users, szInvalidUsers)
|
||||||
FN_LOCAL_LIST(lp_valid_users, szValidUsers)
|
FN_LOCAL_LIST(lp_valid_users, szValidUsers)
|
||||||
FN_LOCAL_LIST(lp_admin_users, szAdminUsers)
|
FN_LOCAL_LIST(lp_admin_users, szAdminUsers)
|
||||||
|
FN_LOCAL_STRING(lp_cups_options, szCupsOptions)
|
||||||
FN_LOCAL_STRING(lp_printcommand, szPrintcommand)
|
FN_LOCAL_STRING(lp_printcommand, szPrintcommand)
|
||||||
FN_LOCAL_STRING(lp_lpqcommand, szLpqcommand)
|
FN_LOCAL_STRING(lp_lpqcommand, szLpqcommand)
|
||||||
FN_LOCAL_STRING(lp_lprmcommand, szLprmcommand)
|
FN_LOCAL_STRING(lp_lprmcommand, szLprmcommand)
|
||||||
|
@ -683,6 +683,8 @@ cups_job_submit(int snum, struct printjob *pjob)
|
|||||||
char uri[HTTP_MAX_URI]; /* printer-uri attribute */
|
char uri[HTTP_MAX_URI]; /* printer-uri attribute */
|
||||||
char *clientname; /* hostname of client for job-originating-host attribute */
|
char *clientname; /* hostname of client for job-originating-host attribute */
|
||||||
pstring new_jobname;
|
pstring new_jobname;
|
||||||
|
int num_options = 0;
|
||||||
|
cups_option_t *options;
|
||||||
|
|
||||||
DEBUG(5,("cups_job_submit(%d, %p (%d))\n", snum, pjob, pjob->sysjob));
|
DEBUG(5,("cups_job_submit(%d, %p (%d))\n", snum, pjob, pjob->sysjob));
|
||||||
|
|
||||||
@ -751,6 +753,17 @@ cups_job_submit(int snum, struct printjob *pjob)
|
|||||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
|
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
|
||||||
new_jobname);
|
new_jobname);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* add any options defined in smb.conf
|
||||||
|
*/
|
||||||
|
|
||||||
|
num_options = 0;
|
||||||
|
options = NULL;
|
||||||
|
num_options = cupsParseOptions(lp_cups_options(snum), num_options, &options);
|
||||||
|
|
||||||
|
if ( num_options )
|
||||||
|
cupsEncodeOptions(request, num_options, options);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do the request and get back a response...
|
* Do the request and get back a response...
|
||||||
*/
|
*/
|
||||||
@ -782,7 +795,6 @@ cups_job_submit(int snum, struct printjob *pjob)
|
|||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 'cups_queue_get()' - Get all the jobs in the print queue.
|
* 'cups_queue_get()' - Get all the jobs in the print queue.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user