mirror of
https://github.com/samba-team/samba.git
synced 2025-11-08 16:23:49 +03:00
r979: Implement the 'cups server' option. This makes it possible to have virtual
smbd's connect to different cups daemons. Volker
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
9ceff80327
commit
148dc71ea5
@@ -231,6 +231,7 @@ typedef struct
|
|||||||
char *szLdapFilter;
|
char *szLdapFilter;
|
||||||
char *szLdapAdminDn;
|
char *szLdapAdminDn;
|
||||||
char *szAclCompat;
|
char *szAclCompat;
|
||||||
|
char *szCupsServer;
|
||||||
int ldap_passwd_sync;
|
int ldap_passwd_sync;
|
||||||
int ldap_replication_sleep;
|
int ldap_replication_sleep;
|
||||||
BOOL ldap_delete_dn;
|
BOOL ldap_delete_dn;
|
||||||
@@ -953,6 +954,7 @@ static struct parm_struct parm_table[] = {
|
|||||||
{"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},
|
{"cups options", P_STRING, P_LOCAL, &sDefault.szCupsOptions, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
|
||||||
|
{"cups server", P_STRING, P_GLOBAL, &Globals.szCupsServer, 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},
|
||||||
@@ -1506,6 +1508,7 @@ static void init_globals(void)
|
|||||||
string_set(&Globals.szTemplatePrimaryGroup, "nobody");
|
string_set(&Globals.szTemplatePrimaryGroup, "nobody");
|
||||||
string_set(&Globals.szWinbindSeparator, "\\");
|
string_set(&Globals.szWinbindSeparator, "\\");
|
||||||
string_set(&Globals.szAclCompat, "");
|
string_set(&Globals.szAclCompat, "");
|
||||||
|
string_set(&Globals.szCupsServer, "");
|
||||||
|
|
||||||
Globals.winbind_cache_time = 300; /* 5 minutes */
|
Globals.winbind_cache_time = 300; /* 5 minutes */
|
||||||
Globals.bWinbindEnableLocalAccounts = True;
|
Globals.bWinbindEnableLocalAccounts = True;
|
||||||
@@ -1802,6 +1805,7 @@ 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_cups_options, szCupsOptions)
|
||||||
|
FN_GLOBAL_STRING(lp_cups_server, &Globals.szCupsServer)
|
||||||
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)
|
||||||
|
|||||||
@@ -65,6 +65,17 @@ cups_passwd_cb(const char *prompt) /* I - Prompt */
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *cups_server(void)
|
||||||
|
{
|
||||||
|
if ((lp_cups_server() != NULL) && (strlen(lp_cups_server()) > 0)) {
|
||||||
|
DEBUG(10, ("cups server explicitly set to %s\n",
|
||||||
|
lp_cups_server()));
|
||||||
|
return lp_cups_server();
|
||||||
|
}
|
||||||
|
|
||||||
|
DEBUG(10, ("cups server left to default %s\n", cupsServer()));
|
||||||
|
return cupsServer();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 'cups_printer_fn()' - Call a function for every printer known to the
|
* 'cups_printer_fn()' - Call a function for every printer known to the
|
||||||
@@ -102,10 +113,10 @@ void cups_printer_fn(void (*fn)(char *, char *))
|
|||||||
* Try to connect to the server...
|
* Try to connect to the server...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
|
if ((http = httpConnect(cups_server(), ippPort())) == NULL)
|
||||||
{
|
{
|
||||||
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
||||||
cupsServer(), strerror(errno)));
|
cups_server(), strerror(errno)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,10 +342,10 @@ int cups_printername_ok(const char *name)
|
|||||||
* Try to connect to the server...
|
* Try to connect to the server...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
|
if ((http = httpConnect(cups_server(), ippPort())) == NULL)
|
||||||
{
|
{
|
||||||
DEBUG(3,("Unable to connect to CUPS server %s - %s\n",
|
DEBUG(3,("Unable to connect to CUPS server %s - %s\n",
|
||||||
cupsServer(), strerror(errno)));
|
cups_server(), strerror(errno)));
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -425,10 +436,10 @@ cups_job_delete(int snum, struct printjob *pjob)
|
|||||||
* Try to connect to the server...
|
* Try to connect to the server...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
|
if ((http = httpConnect(cups_server(), ippPort())) == NULL)
|
||||||
{
|
{
|
||||||
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
||||||
cupsServer(), strerror(errno)));
|
cups_server(), strerror(errno)));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,10 +526,10 @@ cups_job_pause(int snum, struct printjob *pjob)
|
|||||||
* Try to connect to the server...
|
* Try to connect to the server...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
|
if ((http = httpConnect(cups_server(), ippPort())) == NULL)
|
||||||
{
|
{
|
||||||
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
||||||
cupsServer(), strerror(errno)));
|
cups_server(), strerror(errno)));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -605,10 +616,10 @@ cups_job_resume(int snum, struct printjob *pjob)
|
|||||||
* Try to connect to the server...
|
* Try to connect to the server...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
|
if ((http = httpConnect(cups_server(), ippPort())) == NULL)
|
||||||
{
|
{
|
||||||
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
||||||
cupsServer(), strerror(errno)));
|
cups_server(), strerror(errno)));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -698,10 +709,10 @@ cups_job_submit(int snum, struct printjob *pjob)
|
|||||||
* Try to connect to the server...
|
* Try to connect to the server...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
|
if ((http = httpConnect(cups_server(), ippPort())) == NULL)
|
||||||
{
|
{
|
||||||
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
||||||
cupsServer(), strerror(errno)));
|
cups_server(), strerror(errno)));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -848,10 +859,10 @@ cups_queue_get(int snum, print_queue_struct **q, print_status_struct *status)
|
|||||||
* Try to connect to the server...
|
* Try to connect to the server...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
|
if ((http = httpConnect(cups_server(), ippPort())) == NULL)
|
||||||
{
|
{
|
||||||
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
||||||
cupsServer(), strerror(errno)));
|
cups_server(), strerror(errno)));
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1153,10 +1164,10 @@ cups_queue_pause(int snum)
|
|||||||
* Try to connect to the server...
|
* Try to connect to the server...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
|
if ((http = httpConnect(cups_server(), ippPort())) == NULL)
|
||||||
{
|
{
|
||||||
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
||||||
cupsServer(), strerror(errno)));
|
cups_server(), strerror(errno)));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1245,10 +1256,10 @@ cups_queue_resume(int snum)
|
|||||||
* Try to connect to the server...
|
* Try to connect to the server...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
|
if ((http = httpConnect(cups_server(), ippPort())) == NULL)
|
||||||
{
|
{
|
||||||
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
|
||||||
cupsServer(), strerror(errno)));
|
cups_server(), strerror(errno)));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user