1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-31 22:02:58 +03:00

make the "printing" option a per share option rather than global. When

printing to lots of different sorts of remote printers this is useful
(This used to be commit 7a88bed4a5)
This commit is contained in:
Andrew Tridgell
1997-12-03 03:37:02 +00:00
parent cc12fc66d1
commit 11d7f4a2aa
4 changed files with 14 additions and 10 deletions

View File

@ -270,6 +270,9 @@ personality".
your NIS auto.map entry. If you have not compiled Samba with -DAUTOMOUNT your NIS auto.map entry. If you have not compiled Samba with -DAUTOMOUNT
then this value will be the same as %L. then this value will be the same as %L.
%R = the selected protocol level after protocol negotiation. As of
Samba 1.9.18 it can be one of CORE, COREPLUS, LANMAN1, LANMAN2 or NT1.
%d = The process id of the current server process %d = The process id of the current server process
%a = the architecture of the remote machine. Only some are recognised, %a = the architecture of the remote machine. Only some are recognised,
@ -449,8 +452,6 @@ preferred master
preload preload
printing
printcap name printcap name
printer driver file printer driver file
@ -642,6 +643,8 @@ printer driver
printer driver location printer driver location
printing
print ok print ok
printable printable
@ -2864,7 +2867,7 @@ Related paramerers.
.B printer driver file .B printer driver file
.SS printing (G) .SS printing (S)
This parameters controls how printer status information is interpreted This parameters controls how printer status information is interpreted
on your system, and also affects the default values for the "print on your system, and also affects the default values for the "print
command", "lpq command" and "lprm command". command", "lpq command" and "lprm command".
@ -2876,6 +2879,7 @@ bsd", "printing = sysv", "printing = hpux", "printing = aix",
To see what the defaults are for the other print commands when using To see what the defaults are for the other print commands when using
these three options use the "testparm" program. these three options use the "testparm" program.
As of version 1.9.18 of Samba this option can be set on a per printer basis
.SS protocol (G) .SS protocol (G)
The value of the parameter (a string) is the highest protocol level that will The value of the parameter (a string) is the highest protocol level that will

View File

@ -288,7 +288,6 @@ int lp_shmem_size(void);
int lp_deadtime(void); int lp_deadtime(void);
int lp_maxprotocol(void); int lp_maxprotocol(void);
int lp_security(void); int lp_security(void);
int lp_printing(void);
int lp_maxdisksize(void); int lp_maxdisksize(void);
int lp_lpqcachetime(void); int lp_lpqcachetime(void);
int lp_syslog(void); int lp_syslog(void);
@ -366,6 +365,7 @@ int lp_force_dir_mode(int );
int lp_max_connections(int ); int lp_max_connections(int );
int lp_defaultcase(int ); int lp_defaultcase(int );
int lp_minprintspace(int ); int lp_minprintspace(int );
int lp_printing(int );
char lp_magicchar(int ); char lp_magicchar(int );
BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir);
int lp_add_service(char *pszService, int iDefaultService); int lp_add_service(char *pszService, int iDefaultService);

View File

@ -160,7 +160,6 @@ typedef struct
int deadtime; int deadtime;
int maxprotocol; int maxprotocol;
int security; int security;
int printing;
int maxdisksize; int maxdisksize;
int lpqcachetime; int lpqcachetime;
int syslog; int syslog;
@ -248,6 +247,7 @@ typedef struct
int iDir_force_mode; int iDir_force_mode;
int iMaxConnections; int iMaxConnections;
int iDefaultCase; int iDefaultCase;
int iPrinting;
BOOL bAlternatePerm; BOOL bAlternatePerm;
BOOL bRevalidate; BOOL bRevalidate;
BOOL bCaseSensitive; BOOL bCaseSensitive;
@ -333,6 +333,7 @@ static service sDefault =
0000, /* iDir_force_mode */ 0000, /* iDir_force_mode */
0, /* iMaxConnections */ 0, /* iMaxConnections */
CASE_LOWER, /* iDefaultCase */ CASE_LOWER, /* iDefaultCase */
DEFAULT_PRINTING, /* iPrinting */
False, /* bAlternatePerm */ False, /* bAlternatePerm */
False, /* revalidate */ False, /* revalidate */
False, /* case sensitive */ False, /* case sensitive */
@ -430,7 +431,6 @@ static struct parm_struct
{"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL}, {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL},
{"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol}, {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol},
{"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security}, {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security},
{"printing", P_ENUM, P_GLOBAL, &Globals.printing, NULL, enum_printing},
{"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL}, {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL},
{"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL}, {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL},
{"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as}, {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as},
@ -600,6 +600,7 @@ static struct parm_struct
{"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL}, {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL},
{"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL}, {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL},
{"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL}, {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL},
{"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing},
{"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL}, {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL},
{"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL}, {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL},
{"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL}, {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL},
@ -689,7 +690,6 @@ static void init_globals(void)
Globals.maxprotocol = PROTOCOL_NT1; Globals.maxprotocol = PROTOCOL_NT1;
Globals.security = SEC_SHARE; Globals.security = SEC_SHARE;
Globals.bEncryptPasswords = False; Globals.bEncryptPasswords = False;
Globals.printing = DEFAULT_PRINTING;
Globals.bReadRaw = True; Globals.bReadRaw = True;
Globals.bWriteRaw = True; Globals.bWriteRaw = True;
Globals.bReadPrediction = False; Globals.bReadPrediction = False;
@ -752,7 +752,7 @@ Initialise the sDefault parameter structure.
static void init_locals(void) static void init_locals(void)
{ {
/* choose defaults depending on the type of printing */ /* choose defaults depending on the type of printing */
switch (Globals.printing) switch (sDefault.iPrinting)
{ {
case PRINT_BSD: case PRINT_BSD:
case PRINT_AIX: case PRINT_AIX:
@ -941,7 +941,6 @@ FN_GLOBAL_INTEGER(lp_shmem_size,&Globals.shmem_size)
FN_GLOBAL_INTEGER(lp_deadtime,&Globals.deadtime) FN_GLOBAL_INTEGER(lp_deadtime,&Globals.deadtime)
FN_GLOBAL_INTEGER(lp_maxprotocol,&Globals.maxprotocol) FN_GLOBAL_INTEGER(lp_maxprotocol,&Globals.maxprotocol)
FN_GLOBAL_INTEGER(lp_security,&Globals.security) FN_GLOBAL_INTEGER(lp_security,&Globals.security)
FN_GLOBAL_INTEGER(lp_printing,&Globals.printing)
FN_GLOBAL_INTEGER(lp_maxdisksize,&Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_maxdisksize,&Globals.maxdisksize)
FN_GLOBAL_INTEGER(lp_lpqcachetime,&Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_lpqcachetime,&Globals.lpqcachetime)
FN_GLOBAL_INTEGER(lp_syslog,&Globals.syslog) FN_GLOBAL_INTEGER(lp_syslog,&Globals.syslog)
@ -1022,6 +1021,7 @@ FN_LOCAL_INTEGER(lp_force_dir_mode,iDir_force_mode)
FN_LOCAL_INTEGER(lp_max_connections,iMaxConnections) FN_LOCAL_INTEGER(lp_max_connections,iMaxConnections)
FN_LOCAL_INTEGER(lp_defaultcase,iDefaultCase) FN_LOCAL_INTEGER(lp_defaultcase,iDefaultCase)
FN_LOCAL_INTEGER(lp_minprintspace,iMinPrintSpace) FN_LOCAL_INTEGER(lp_minprintspace,iMinPrintSpace)
FN_LOCAL_INTEGER(lp_printing,iPrinting)
FN_LOCAL_CHAR(lp_magicchar,magic_char) FN_LOCAL_CHAR(lp_magicchar,magic_char)

View File

@ -832,7 +832,7 @@ static BOOL parse_lpq_entry(int snum,char *line,
{ {
BOOL ret; BOOL ret;
switch (lp_printing()) switch (lp_printing(snum))
{ {
case PRINT_SYSV: case PRINT_SYSV:
ret = parse_lpq_sysv(line,buf,first); ret = parse_lpq_sysv(line,buf,first);