summaryrefslogtreecommitdiff
path: root/source3/param
diff options
context:
space:
mode:
authorDavid O'Neill <dmo@samba.org>2001-01-17 18:47:46 +0000
committerDavid O'Neill <dmo@samba.org>2001-01-17 18:47:46 +0000
commit792ca5d98938c3c52ff4e598bcb55056565dc202 (patch)
treebb46ce6cad82833e1db7b15ebb9c1f91838405a4 /source3/param
parent73ba07b3623022e1bde22721b67dba769cc7a1f2 (diff)
downloadsamba-792ca5d98938c3c52ff4e598bcb55056565dc202.tar.gz
samba-792ca5d98938c3c52ff4e598bcb55056565dc202.tar.bz2
samba-792ca5d98938c3c52ff4e598bcb55056565dc202.zip
Changes from APPLIANCE_HEAD:
source/rpc_server/srv_spoolss_nt.c - Unrolled construct_notify_jobs_info() loop to only fetch printer info_2 structure once rather than num_print_jobs times. - convert command to unix codepage. - remove lp_remove_service() call as it prevents lp_killservice() from working. - Modified some DEBUG and DEBUGADD statements. source/param/loadparm.c source/param/params.c - change printer, preload, auto services to FLAG_DOS_STRING, reverted earlier changes to szPrintername et al, add comments. source/printing/load.c - fix bug with lp_auto_services() and strtok() source/printing/nt_printing.c source/printing/printing.c - remove redundant test that used SERVICE(snum) source/printing/pcap.c - add unix_to_dos() calls, add notes wrt FIXMEs for xxx_printer_fn() functions. source/web/swat.c - added FIXME comment. source/smbd/service.c - added comment re: dos codepage (This used to be commit 7b774b72c2857af9519012106714a9e2cb099da3)
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/loadparm.c29
-rw-r--r--source3/param/params.c2
2 files changed, 15 insertions, 16 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 57e8f17189..7750cb7ac7 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -830,8 +830,8 @@ static struct parm_struct parm_table[] = {
{"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, 0},
{"show add printer wizard", P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, 0},
- {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT},
- {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0},
+ {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT|FLAG_DOS_STRING},
+ {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_DOS_STRING},
{"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT},
{"printer driver file", P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT},
{"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL},
@@ -938,8 +938,8 @@ static struct parm_struct parm_table[] = {
{"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0},
{"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE},
- {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0},
- {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0},
+ {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_DOS_STRING},
+ {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_DOS_STRING},
{"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0},
{"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0},
#ifdef WITH_UTMP
@@ -1270,8 +1270,7 @@ static void init_globals(void)
Globals.sslCompatibility = False;
#endif /* WITH_SSL */
-/*
- these parameters are set to defaults that are more appropriate
+/* these parameters are set to defaults that are more appropriate
for the increasing samba install base:
as a member of the workgroup, that will possibly become a
@@ -1280,6 +1279,7 @@ static void init_globals(void)
doesn't provide WINS server service by default (wsupp = False),
and doesn't provide domain master browser services by default, either.
+
*/
Globals.bMsAddPrinterWizard = True;
@@ -1690,7 +1690,7 @@ static void free_service(service * pservice)
/***************************************************************************
add a new service to the services array initialising it with the given
-service
+service. name must be in DOS codepage.
***************************************************************************/
static int add_a_service(service * pservice, char *name)
{
@@ -1739,14 +1739,13 @@ static int add_a_service(service * pservice, char *name)
if (name)
{
string_set(&iSERVICE(i).szService, name);
- unix_to_dos(iSERVICE(i).szService, True);
}
return (i);
}
/***************************************************************************
add a new home service, with the specified home directory, defaults coming
-from service ifrom
+from service ifrom. homename must be in DOS codepage.
***************************************************************************/
BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir)
{
@@ -1775,7 +1774,7 @@ BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir)
}
/***************************************************************************
-add a new service, based on an old one
+add a new service, based on an old one. pszService must be in DOS codepage.
***************************************************************************/
int lp_add_service(char *pszService, int iDefaultService)
{
@@ -1817,7 +1816,8 @@ static BOOL lp_add_ipc(void)
/***************************************************************************
-add a new printer service, with defaults coming from service iFrom
+add a new printer service, with defaults coming from service iFrom.
+printername must be in DOS codepage.
***************************************************************************/
BOOL lp_add_printer(char *pszPrintername, int iDefaultService)
{
@@ -1834,9 +1834,7 @@ BOOL lp_add_printer(char *pszPrintername, int iDefaultService)
/* the printer name is set to the service name. */
string_set(&iSERVICE(i).szPrintername, pszPrintername);
- unix_to_dos(iSERVICE(i).szPrintername, True);
string_set(&iSERVICE(i).comment, comment);
- unix_to_dos(iSERVICE(i).comment, True);
iSERVICE(i).bBrowseable = sDefault.bBrowseable;
/* Printers cannot be read_only. */
iSERVICE(i).bRead_only = False;
@@ -2734,7 +2732,7 @@ void init_locals(void)
/***************************************************************************
Process a new section (service). At this stage all sections are services.
Later we'll have special sections that permit server parameters to be set.
-Returns True on success, False on failure.
+Returns True on success, False on failure. SectionName must be in DOS codepage.
***************************************************************************/
static BOOL do_section(char *pszSectionName)
{
@@ -3037,6 +3035,7 @@ void lp_add_one_printer(char *name, char *comment)
if ((i = lp_servicenumber(name)) >= 0)
{
string_set(&iSERVICE(i).comment, comment);
+ unix_to_dos(iSERVICE(i).comment, True);
iSERVICE(i).autoloaded = True;
}
}
@@ -3448,7 +3447,7 @@ void lp_remove_service(int snum)
}
/*******************************************************************
-copy a service
+copy a service. new_name must be in dos codepage
********************************************************************/
void lp_copy_service(int snum, char *new_name)
{
diff --git a/source3/param/params.c b/source3/param/params.c
index 9cb6412b96..b359b269d4 100644
--- a/source3/param/params.c
+++ b/source3/param/params.c
@@ -271,7 +271,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) )
DEBUG(0, ("%s Empty section name in configuration file.\n", func ));
return( False );
}
- if( !sfunc( bufr ) ) /* Got a valid name. Deal with it. */
+ if( !sfunc( unix_to_dos(bufr,True) ) ) /* Got a valid name. Deal with it. */
return( False );
(void)EatComment( InFile ); /* Finish off the line. */
return( True );