diff options
Diffstat (limited to 'source3/param')
-rw-r--r-- | source3/param/loadparm.c | 106 | ||||
-rw-r--r-- | source3/param/params.c | 24 |
2 files changed, 65 insertions, 65 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 621aa67e6ac..2cc16ee79b0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -535,29 +535,29 @@ static int default_server_announce; #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct)) /* prototypes for the special type handlers */ -static BOOL handle_include(char *pszParmValue, char **ptr); -static BOOL handle_copy(char *pszParmValue, char **ptr); -static BOOL handle_vfs_object(char *pszParmValue, char **ptr); -static BOOL handle_source_env(char *pszParmValue, char **ptr); -static BOOL handle_netbios_name(char *pszParmValue, char **ptr); -static BOOL handle_winbind_uid(char *pszParmValue, char **ptr); -static BOOL handle_winbind_gid(char *pszParmValue, char **ptr); -static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr); -static BOOL handle_debug_list( char *pszParmValue, char **ptr ); -static BOOL handle_workgroup( char *pszParmValue, char **ptr ); -static BOOL handle_netbios_aliases( char *pszParmValue, char **ptr ); -static BOOL handle_netbios_scope( char *pszParmValue, char **ptr ); - -static BOOL handle_ldap_machine_suffix ( char *pszParmValue, char **ptr ); -static BOOL handle_ldap_user_suffix ( char *pszParmValue, char **ptr ); -static BOOL handle_ldap_suffix ( char *pszParmValue, char **ptr ); - -static BOOL handle_acl_compatibility(char *pszParmValue, char **ptr); +static BOOL handle_include(const char *pszParmValue, char **ptr); +static BOOL handle_copy(const char *pszParmValue, char **ptr); +static BOOL handle_vfs_object(const char *pszParmValue, char **ptr); +static BOOL handle_source_env(const char *pszParmValue, char **ptr); +static BOOL handle_netbios_name(const char *pszParmValue, char **ptr); +static BOOL handle_winbind_uid(const char *pszParmValue, char **ptr); +static BOOL handle_winbind_gid(const char *pszParmValue, char **ptr); +static BOOL handle_non_unix_account_range(const char *pszParmValue, char **ptr); +static BOOL handle_debug_list( const char *pszParmValue, char **ptr ); +static BOOL handle_workgroup( const char *pszParmValue, char **ptr ); +static BOOL handle_netbios_aliases( const char *pszParmValue, char **ptr ); +static BOOL handle_netbios_scope( const char *pszParmValue, char **ptr ); + +static BOOL handle_ldap_machine_suffix ( const char *pszParmValue, char **ptr ); +static BOOL handle_ldap_user_suffix ( const char *pszParmValue, char **ptr ); +static BOOL handle_ldap_suffix ( const char *pszParmValue, char **ptr ); + +static BOOL handle_acl_compatibility(const char *pszParmValue, char **ptr); static void set_server_role(void); static void set_default_server_announce_type(void); -static struct enum_list enum_protocol[] = { +static const struct enum_list enum_protocol[] = { {PROTOCOL_NT1, "NT1"}, {PROTOCOL_LANMAN2, "LANMAN2"}, {PROTOCOL_LANMAN1, "LANMAN1"}, @@ -567,7 +567,7 @@ static struct enum_list enum_protocol[] = { {-1, NULL} }; -static struct enum_list enum_security[] = { +static const struct enum_list enum_security[] = { {SEC_SHARE, "SHARE"}, {SEC_USER, "USER"}, {SEC_SERVER, "SERVER"}, @@ -578,7 +578,7 @@ static struct enum_list enum_security[] = { {-1, NULL} }; -static struct enum_list enum_printing[] = { +static const struct enum_list enum_printing[] = { {PRINT_SYSV, "sysv"}, {PRINT_AIX, "aix"}, {PRINT_HPUX, "hpux"}, @@ -597,7 +597,7 @@ static struct enum_list enum_printing[] = { {-1, NULL} }; -static struct enum_list enum_ldap_ssl[] = { +static const struct enum_list enum_ldap_ssl[] = { #ifdef WITH_LDAP_SAMCONFIG {LDAP_SSL_ON, "Yes"}, {LDAP_SSL_ON, "yes"}, @@ -613,7 +613,7 @@ static struct enum_list enum_ldap_ssl[] = { {-1, NULL} }; -static struct enum_list enum_ldap_passwd_sync[] = { +static const struct enum_list enum_ldap_passwd_sync[] = { {LDAP_PASSWD_SYNC_ON, "Yes"}, {LDAP_PASSWD_SYNC_ON, "yes"}, {LDAP_PASSWD_SYNC_ON, "on"}, @@ -635,7 +635,7 @@ static struct enum_list enum_ldap_passwd_sync[] = { #define ANNOUNCE_AS_WFW 3 #define ANNOUNCE_AS_NT_WORKSTATION 4 -static struct enum_list enum_announce_as[] = { +static const struct enum_list enum_announce_as[] = { {ANNOUNCE_AS_NT_SERVER, "NT"}, {ANNOUNCE_AS_NT_SERVER, "NT Server"}, {ANNOUNCE_AS_NT_WORKSTATION, "NT Workstation"}, @@ -644,13 +644,13 @@ static struct enum_list enum_announce_as[] = { {-1, NULL} }; -static struct enum_list enum_case[] = { +static const struct enum_list enum_case[] = { {CASE_LOWER, "lower"}, {CASE_UPPER, "upper"}, {-1, NULL} }; -static struct enum_list enum_bool_auto[] = { +static const struct enum_list enum_bool_auto[] = { {False, "No"}, {False, "False"}, {False, "0"}, @@ -667,7 +667,7 @@ static struct enum_list enum_bool_auto[] = { #define CSC_POLICY_PROGRAMS 2 #define CSC_POLICY_DISABLE 3 -static struct enum_list enum_csc_policy[] = { +static const struct enum_list enum_csc_policy[] = { {CSC_POLICY_MANUAL, "manual"}, {CSC_POLICY_DOCUMENTS, "documents"}, {CSC_POLICY_PROGRAMS, "programs"}, @@ -696,7 +696,7 @@ static struct enum_list enum_csc_policy[] = { level security. */ -static struct enum_list enum_map_to_guest[] = { +static const struct enum_list enum_map_to_guest[] = { {NEVER_MAP_TO_GUEST, "Never"}, {MAP_TO_GUEST_ON_BAD_USER, "Bad User"}, {MAP_TO_GUEST_ON_BAD_PASSWORD, "Bad Password"}, @@ -1821,15 +1821,15 @@ FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) /* local prototypes */ -static int map_parameter(char *pszParmName); +static int map_parameter(const char *pszParmName); static BOOL set_boolean(BOOL *pb, const char *pszParmValue); static int getservicebyname(const char *pszServiceName, service * pserviceDest); static void copy_service(service * pserviceDest, service * pserviceSource, BOOL *pcopymapDest); static BOOL service_ok(int iService); -static BOOL do_parameter(char *pszParmName, char *pszParmValue); -static BOOL do_section(char *pszSectionName); +static BOOL do_parameter(const char *pszParmName, const char *pszParmValue); +static BOOL do_section(const char *pszSectionName); static void init_copymap(service * pservice); /* This is a helper function for parametrical options support. */ @@ -2208,7 +2208,7 @@ int lp_add_service(const char *pszService, int iDefaultService) Add the IPC service. ***************************************************************************/ -static BOOL lp_add_ipc(char *ipc_name, BOOL guest_ok) +static BOOL lp_add_ipc(const char *ipc_name, BOOL guest_ok) { pstring comment; int i = add_a_service(&sDefault, ipc_name); @@ -2278,7 +2278,7 @@ BOOL lp_add_printer(const char *pszPrintername, int iDefaultService) Returns False if the parameter string is not recognised, else TRUE. ***************************************************************************/ -static int map_parameter(char *pszParmName) +static int map_parameter(const char *pszParmName) { int iIndex; @@ -2566,7 +2566,7 @@ BOOL lp_file_list_changed(void) Note: We must *NOT* use string_set() here as ptr points to global_myname. ***************************************************************************/ -static BOOL handle_netbios_name(char *pszParmValue, char **ptr) +static BOOL handle_netbios_name(const char *pszParmValue, char **ptr) { pstring netbios_name; @@ -2582,17 +2582,17 @@ static BOOL handle_netbios_name(char *pszParmValue, char **ptr) return (True); } -static BOOL handle_workgroup(char *pszParmValue, char **ptr) +static BOOL handle_workgroup(const char *pszParmValue, char **ptr) { return set_global_myworkgroup(pszParmValue); } -static BOOL handle_netbios_scope(char *pszParmValue, char **ptr) +static BOOL handle_netbios_scope(const char *pszParmValue, char **ptr) { return set_global_scope(pszParmValue); } -static BOOL handle_netbios_aliases(char *pszParmValue, char **ptr) +static BOOL handle_netbios_aliases(const char *pszParmValue, char **ptr) { Globals.szNetbiosAliases = str_list_make(pszParmValue, NULL); return set_netbios_aliases((const char **)Globals.szNetbiosAliases); @@ -2652,7 +2652,7 @@ static BOOL source_env(char **lines) Handle the source environment operation. ***************************************************************************/ -static BOOL handle_source_env(char *pszParmValue, char **ptr) +static BOOL handle_source_env(const char *pszParmValue, char **ptr) { pstring fname; char *p = fname; @@ -2692,7 +2692,7 @@ static BOOL handle_source_env(char *pszParmValue, char **ptr) Handle the interpretation of the vfs object parameter. *************************************************************************/ -static BOOL handle_vfs_object(char *pszParmValue, char **ptr) +static BOOL handle_vfs_object(const char *pszParmValue, char **ptr) { /* Set string value */ @@ -2708,7 +2708,7 @@ static BOOL handle_vfs_object(char *pszParmValue, char **ptr) Handle the include operation. ***************************************************************************/ -static BOOL handle_include(char *pszParmValue, char **ptr) +static BOOL handle_include(const char *pszParmValue, char **ptr) { pstring fname; pstrcpy(fname, pszParmValue); @@ -2731,7 +2731,7 @@ static BOOL handle_include(char *pszParmValue, char **ptr) Handle the interpretation of the copy parameter. ***************************************************************************/ -static BOOL handle_copy(char *pszParmValue, char **ptr) +static BOOL handle_copy(const char *pszParmValue, char **ptr) { BOOL bRetval; int iTemp; @@ -2827,7 +2827,7 @@ BOOL lp_non_unix_account_range(uint32 *low, uint32 *high) /* Do some simple checks on "winbind [ug]id" parameter values */ -static BOOL handle_winbind_uid(char *pszParmValue, char **ptr) +static BOOL handle_winbind_uid(const char *pszParmValue, char **ptr) { uint32 low, high; @@ -2844,7 +2844,7 @@ static BOOL handle_winbind_uid(char *pszParmValue, char **ptr) return True; } -static BOOL handle_winbind_gid(char *pszParmValue, char **ptr) +static BOOL handle_winbind_gid(const char *pszParmValue, char **ptr) { uint32 low, high; @@ -2865,7 +2865,7 @@ static BOOL handle_winbind_gid(char *pszParmValue, char **ptr) Do some simple checks on "non unix account range" parameter values. ***************************************************************************/ -static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr) +static BOOL handle_non_unix_account_range(const char *pszParmValue, char **ptr) { uint32 low, high; @@ -2886,7 +2886,7 @@ static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr) Handle the DEBUG level list. ***************************************************************************/ -static BOOL handle_debug_list( char *pszParmValueIn, char **ptr ) +static BOOL handle_debug_list( const char *pszParmValueIn, char **ptr ) { pstring pszParmValue; @@ -2899,7 +2899,7 @@ static BOOL handle_debug_list( char *pszParmValueIn, char **ptr ) Handle the ldap machine suffix option. ***************************************************************************/ -static BOOL handle_ldap_machine_suffix( char *pszParmValue, char **ptr) +static BOOL handle_ldap_machine_suffix( const char *pszParmValue, char **ptr) { pstring suffix; @@ -2923,7 +2923,7 @@ static BOOL handle_ldap_machine_suffix( char *pszParmValue, char **ptr) Handle the ldap user suffix option. ***************************************************************************/ -static BOOL handle_ldap_user_suffix( char *pszParmValue, char **ptr) +static BOOL handle_ldap_user_suffix( const char *pszParmValue, char **ptr) { pstring suffix; @@ -2948,7 +2948,7 @@ static BOOL handle_ldap_user_suffix( char *pszParmValue, char **ptr) to be set as well. ***************************************************************************/ -static BOOL handle_ldap_suffix( char *pszParmValue, char **ptr) +static BOOL handle_ldap_suffix( const char *pszParmValue, char **ptr) { pstring suffix; pstring user_suffix; @@ -2981,7 +2981,7 @@ static BOOL handle_ldap_suffix( char *pszParmValue, char **ptr) return True; } -static BOOL handle_acl_compatibility(char *pszParmValue, char **ptr) +static BOOL handle_acl_compatibility(const char *pszParmValue, char **ptr) { if (strequal(pszParmValue, "auto")) string_set(ptr, ""); @@ -3027,7 +3027,7 @@ void *lp_local_ptr(int snum, void *ptr) then assume we are in the globals. ***************************************************************************/ -BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) +BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue) { int parmnum, i, slen; void *parm_ptr = NULL; /* where we are going to store the result */ @@ -3187,7 +3187,7 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) Process a parameter. ***************************************************************************/ -static BOOL do_parameter(char *pszParmName, char *pszParmValue) +static BOOL do_parameter(const char *pszParmName, const char *pszParmValue) { if (!bInGlobalSection && bGlobalOnly) return (True); @@ -3328,7 +3328,7 @@ void init_locals(void) Returns True on success, False on failure. ***************************************************************************/ -static BOOL do_section(char *pszSectionName) +static BOOL do_section(const char *pszSectionName) { BOOL bRetval; BOOL isglobal = ((strwicmp(pszSectionName, GLOBAL_NAME) == 0) || @@ -4068,7 +4068,7 @@ void lp_remove_service(int snum) Copy a service. ********************************************************************/ -void lp_copy_service(int snum, char *new_name) +void lp_copy_service(int snum, const char *new_name) { char *oldname = lp_servicename(snum); do_section(new_name); diff --git a/source3/param/params.c b/source3/param/params.c index bc93a1fedfe..892e5476cc0 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -201,7 +201,7 @@ static int Continuation(char *line, int pos ) } -static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) ) +static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *) ) /* ------------------------------------------------------------------------ ** * Scan a section name, and pass the name to function sfunc(). * @@ -219,7 +219,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) ) int c; int i; int end; - char *func = "params.c:Section() -"; + const char *func = "params.c:Section() -"; i = 0; /* <i> is the offset of the next free byte in bufr[] and */ end = 0; /* <end> is the current "end of string" offset. In most */ @@ -297,7 +297,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) ) return( False ); } /* Section */ -static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(char *, char *), int c ) +static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *), int c ) /* ------------------------------------------------------------------------ ** * Scan a parameter name and value, and pass these two fields to pfunc(). * @@ -325,7 +325,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(char *, char *), int c ) int i = 0; /* Position within bufr. */ int end = 0; /* bufr[end] is current end-of-string. */ int vstart = 0; /* Starting position of the parameter value. */ - char *func = "params.c:Parameter() -"; + const char *func = "params.c:Parameter() -"; /* Read the parameter name. */ while( 0 == vstart ) /* Loop until we've found the start of the value. */ @@ -445,8 +445,8 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(char *, char *), int c ) } /* Parameter */ static BOOL Parse( myFILE *InFile, - BOOL (*sfunc)(char *), - BOOL (*pfunc)(char *, char *) ) + BOOL (*sfunc)(const char *), + BOOL (*pfunc)(const char *, const char *) ) /* ------------------------------------------------------------------------ ** * Scan & parse the input. * @@ -505,7 +505,7 @@ static BOOL Parse( myFILE *InFile, return( True ); } /* Parse */ -static myFILE *OpenConfFile( char *FileName ) +static myFILE *OpenConfFile( const char *FileName ) /* ------------------------------------------------------------------------ ** * Open a configuration file. * @@ -516,7 +516,7 @@ static myFILE *OpenConfFile( char *FileName ) * ------------------------------------------------------------------------ ** */ { - char *func = "params.c:OpenConfFile() -"; + const char *func = "params.c:OpenConfFile() -"; extern BOOL in_client; int lvl = in_client?1:0; myFILE *ret; @@ -538,9 +538,9 @@ static myFILE *OpenConfFile( char *FileName ) return( ret ); } /* OpenConfFile */ -BOOL pm_process( char *FileName, - BOOL (*sfunc)(char *), - BOOL (*pfunc)(char *, char *) ) +BOOL pm_process( const char *FileName, + BOOL (*sfunc)(const char *), + BOOL (*pfunc)(const char *, const char *) ) /* ------------------------------------------------------------------------ ** * Process the named parameter file. * @@ -557,7 +557,7 @@ BOOL pm_process( char *FileName, { int result; myFILE *InFile; - char *func = "params.c:pm_process() -"; + const char *func = "params.c:pm_process() -"; InFile = OpenConfFile( FileName ); /* Open the config file. */ if( NULL == InFile ) |