[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Tue Jun 28 02:44:02 MDT 2011


The branch, master has been updated
       via  ecc0177 s3-smbd Remove set but unused variables
       via  dd7d655 s3-param Rename struct service and struct globals
       via  ed2b452 s3-param Remove lp_parm_string
       via  9d72efd s3-param make lp_passdb_backend() a normal lp_ function again
      from  0a74caa s3: explicitly pass domain_sid to wbint_LookupRids() (bug #7841)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ecc0177f2cffa41892cbe85ec21d76c4c4ae0854
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Jun 28 13:14:22 2011 +1000

    s3-smbd Remove set but unused variables
    
    Autobuild-User: Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date: Tue Jun 28 10:43:26 CEST 2011 on sn-devel-104

commit dd7d655b8333190af4e8683376ce91eff2b35128
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Jun 28 10:06:05 2011 +1000

    s3-param Rename struct service and struct globals
    
    The rename of struct service -> loadparm_service and struct globals ->
    loadparm_globals makes this match the names used in source4/param, and
    is one step towards a single loadparm definition.
    
    Andrew Bartlett

commit ed2b4520242da5261ed3b8cea4091981516f37ff
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Jun 27 15:59:54 2011 +1000

    s3-param Remove lp_parm_string
    
    Samba 4.0 makes no attempt to provide a loader environment that
    will allow a module that is not rebuilt to operate.
    
    Andrew Bartlett

commit 9d72efd3748cadc8a62216bd6575d5e91e37e184
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Jun 27 15:58:45 2011 +1000

    s3-param make lp_passdb_backend() a normal lp_ function again
    
    It is now a large number of releases since the multiple passdb backend
    support was removed in 3.0.23.
    
    Andrew Bartlett

-----------------------------------------------------------------------

Summary of changes:
 source3/param/loadparm.c   |  117 ++++++++++++--------------------------------
 source3/smbd/mangle_hash.c |    9 ---
 2 files changed, 32 insertions(+), 94 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 3f622ac..a1ee2a7 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -125,7 +125,7 @@ struct param_opt_struct {
 /*
  * This structure describes global (ie., server-wide) parameters.
  */
-struct global {
+struct loadparm_global {
 	int ConfigBackend;
 	char *smb_ports;
 	char *dos_charset;
@@ -385,12 +385,12 @@ struct global {
 	char *ncalrpc_dir;
 };
 
-static struct global Globals;
+static struct loadparm_global Globals;
 
 /*
  * This structure describes a single service.
  */
-struct service {
+struct loadparm_service {
 	bool valid;
 	bool autoloaded;
 	int usershare;
@@ -535,7 +535,7 @@ struct service {
 
 
 /* This is a default service used to prime a services structure */
-static struct service sDefault = {
+static struct loadparm_service sDefault = {
 	True,			/* valid */
 	False,			/* not autoloaded */
 	0,			/* not a usershare */
@@ -683,7 +683,7 @@ static struct service sDefault = {
 };
 
 /* local variables */
-static struct service **ServicePtrs = NULL;
+static struct loadparm_service **ServicePtrs = NULL;
 static int iNumServices = 0;
 static int iServiceIndex = 0;
 static struct db_context *ServiceHash;
@@ -712,7 +712,7 @@ static bool handle_ldap_debug_level( int snum, const char *pszParmValue, char **
 static void set_default_server_announce_type(void);
 static void set_allowed_client_auth(void);
 
-static void *lp_local_ptr(struct service *service, void *ptr);
+static void *lp_local_ptr(struct loadparm_service *service, void *ptr);
 
 static void add_to_file_list(const char *fname, const char *subfname);
 static bool lp_set_cmdline_helper(const char *pszParmName, const char *pszParmValue, bool store_values);
@@ -4740,7 +4740,7 @@ static struct parm_struct parm_table[] = {
  Initialise the sDefault parameter structure for the printer values.
 ***************************************************************************/
 
-static void init_printer_values(struct service *pService)
+static void init_printer_values(struct loadparm_service *pService)
 {
 	/* choose defaults depending on the type of printing */
 	switch (pService->iPrinting) {
@@ -4942,7 +4942,7 @@ static void free_one_parameter_common(void *parm_ptr,
  * Free the allocated data for one parameter for a share
  * given as a service struct.
  */
-static void free_one_parameter(struct service *service,
+static void free_one_parameter(struct loadparm_service *service,
 			       struct parm_struct parm)
 {
 	void *parm_ptr;
@@ -4960,7 +4960,7 @@ static void free_one_parameter(struct service *service,
  * Free the allocated parameter data of a share given
  * as a service struct.
  */
-static void free_parameters(struct service *service)
+static void free_parameters(struct loadparm_service *service)
 {
 	uint32_t i;
 
@@ -5566,48 +5566,7 @@ FN_GLOBAL_LIST(lp_wins_server_list, szWINSservers)
 FN_GLOBAL_LIST(lp_interfaces, szInterfaces)
 FN_GLOBAL_STRING(lp_nis_home_map_name, szNISHomeMapName)
 FN_GLOBAL_LIST(lp_netbios_aliases, szNetbiosAliases)
-/* FN_GLOBAL_STRING(lp_passdb_backend, szPassdbBackend)
- * lp_passdb_backend() should be replace by the this macro again after
- * some releases.
- * */
-const char *lp_passdb_backend(void)
-{
-	char *delim, *quote;
-
-	delim = strchr( Globals.szPassdbBackend, ' ');
-	/* no space at all */
-	if (delim == NULL) {
-		goto out;
-	}
-
-	quote = strchr(Globals.szPassdbBackend, '"');
-	/* no quote char or non in the first part */
-	if (quote == NULL || quote > delim) {
-		*delim = '\0';
-		goto warn;
-	}
-
-	quote = strchr(quote+1, '"');
-	if (quote == NULL) {
-		DEBUG(0, ("WARNING: Your 'passdb backend' configuration is invalid due to a missing second \" char.\n"));
-		goto out;
-	} else if (*(quote+1) == '\0') {
-		/* space, fitting quote char, and one backend only */
-		goto out;
-	} else {
-		/* terminate string after the fitting quote char */
-		*(quote+1) = '\0';
-	}
-
-warn:
-	DEBUG(0, ("WARNING: Your 'passdb backend' configuration includes multiple backends.  This\n"
-		"is deprecated since Samba 3.0.23.  Please check WHATSNEW.txt or the section 'Passdb\n"
-		"Changes' from the ChangeNotes as part of the Samba HOWTO collection.  Only the first\n"
-		"backend (%s) is used.  The rest is ignored.\n", Globals.szPassdbBackend));
-
-out:
-	return Globals.szPassdbBackend;
-}
+FN_GLOBAL_CONST_STRING(lp_passdb_backend, szPassdbBackend)
 FN_GLOBAL_LIST(lp_preload_modules, szPreloadModules)
 FN_GLOBAL_STRING(lp_panic_action, szPanicAction)
 FN_GLOBAL_STRING(lp_adduser_script, szAddUserScript)
@@ -5985,14 +5944,14 @@ FN_GLOBAL_CONST_STRING(lp_ncalrpc_dir, ncalrpc_dir)
 static int map_parameter_canonical(const char *pszParmName, bool *inverse);
 static const char *get_boolean(bool bool_value);
 static int getservicebyname(const char *pszServiceName,
-			    struct service *pserviceDest);
-static void copy_service(struct service *pserviceDest,
-			 struct service *pserviceSource,
+			    struct loadparm_service *pserviceDest);
+static void copy_service(struct loadparm_service *pserviceDest,
+			 struct loadparm_service *pserviceSource,
 			 struct bitmap *pcopymapDest);
 static bool do_parameter(const char *pszParmName, const char *pszParmValue,
 			 void *userdata);
 static bool do_section(const char *pszSectionName, void *userdata);
-static void init_copymap(struct service *pservice);
+static void init_copymap(struct loadparm_service *pservice);
 static bool hash_a_service(const char *name, int number);
 static void free_service_byindex(int iService);
 static void free_param_opts(struct param_opt_struct **popts);
@@ -6126,18 +6085,6 @@ static int lp_enum(const char *s,const struct enum_list *_enum)
 
 #undef MISSING_PARAMETER
 
-/* DO NOT USE lp_parm_string ANYMORE!!!!
- * use lp_parm_const_string or lp_parm_talloc_string
- *
- * lp_parm_string is only used to let old modules find this symbol
- */
-#undef lp_parm_string
- char *lp_parm_string(const char *servicename, const char *type, const char *option);
- char *lp_parm_string(const char *servicename, const char *type, const char *option)
-{
-	return lp_parm_talloc_string(lp_servicenumber(servicename), type, option, NULL);
-}
-
 /* Return parametric option from a given service. Type is a part of option before ':' */
 /* Parametric option has following syntax: 'Type: option = value' */
 /* the returned value is talloced on the talloc_tos() */
@@ -6243,9 +6190,9 @@ int lp_parm_enum(int snum, const char *type, const char *option,
  Initialise a service to the defaults.
 ***************************************************************************/
 
-static void init_service(struct service *pservice)
+static void init_service(struct loadparm_service *pservice)
 {
-	memset((char *)pservice, '\0', sizeof(struct service));
+	memset((char *)pservice, '\0', sizeof(struct loadparm_service));
 	copy_service(pservice, &sDefault, NULL);
 }
 
@@ -6283,7 +6230,7 @@ static void free_param_opts(struct param_opt_struct **popts)
  Free the dynamically allocated parts of a service struct.
 ***************************************************************************/
 
-static void free_service(struct service *pservice)
+static void free_service(struct loadparm_service *pservice)
 {
 	if (!pservice)
 		return;
@@ -6335,10 +6282,10 @@ static void free_service_byindex(int idx)
  service. 
 ***************************************************************************/
 
-static int add_a_service(const struct service *pservice, const char *name)
+static int add_a_service(const struct loadparm_service *pservice, const char *name)
 {
 	int i;
-	struct service tservice;
+	struct loadparm_service tservice;
 	int num_to_alloc = iNumServices + 1;
 
 	tservice = *pservice;
@@ -6359,16 +6306,16 @@ static int add_a_service(const struct service *pservice, const char *name)
 
 	/* if not, then create one */
 	if (i == iNumServices) {
-		struct service **tsp;
+		struct loadparm_service **tsp;
 		int *tinvalid;
 
-		tsp = SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(ServicePtrs, struct service *, num_to_alloc);
+		tsp = SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(ServicePtrs, struct loadparm_service *, num_to_alloc);
 		if (tsp == NULL) {
 			DEBUG(0,("add_a_service: failed to enlarge ServicePtrs!\n"));
 			return (-1);
 		}
 		ServicePtrs = tsp;
-		ServicePtrs[iNumServices] = SMB_MALLOC_P(struct service);
+		ServicePtrs[iNumServices] = SMB_MALLOC_P(struct loadparm_service);
 		if (!ServicePtrs[iNumServices]) {
 			DEBUG(0,("add_a_service: out of memory!\n"));
 			return (-1);
@@ -6942,7 +6889,7 @@ bool lp_canonicalize_boolean(const char *str, const char**canon_str)
 Find a service by name. Otherwise works like get_service.
 ***************************************************************************/
 
-static int getservicebyname(const char *pszServiceName, struct service *pserviceDest)
+static int getservicebyname(const char *pszServiceName, struct loadparm_service *pserviceDest)
 {
 	int iService = -1;
 	char *canon_name;
@@ -7023,7 +6970,7 @@ static void set_param_opt(struct param_opt_struct **opt_list,
 	}
 }
 
-static void copy_service(struct service *pserviceDest, struct service *pserviceSource,
+static void copy_service(struct loadparm_service *pserviceDest, struct loadparm_service *pserviceSource,
 			 struct bitmap *pcopymapDest)
 {
 	int i;
@@ -7578,7 +7525,7 @@ static bool handle_copy(int snum, const char *pszParmValue, char **ptr)
 {
 	bool bRetval;
 	int iTemp;
-	struct service serviceTemp;
+	struct loadparm_service serviceTemp;
 
 	string_set(ptr, pszParmValue);
 
@@ -7769,7 +7716,7 @@ static void lp_set_enum_parm( struct parm_struct *parm, const char *pszParmValue
 static bool handle_printing(int snum, const char *pszParmValue, char **ptr)
 {
 	static int parm_num = -1;
-	struct service *s;
+	struct loadparm_service *s;
 
 	if ( parm_num == -1 )
 		parm_num = map_parameter( "printing" );
@@ -7791,7 +7738,7 @@ static bool handle_printing(int snum, const char *pszParmValue, char **ptr)
  Initialise a copymap.
 ***************************************************************************/
 
-static void init_copymap(struct service *pservice)
+static void init_copymap(struct loadparm_service *pservice)
 {
 	int i;
 
@@ -7812,7 +7759,7 @@ static void init_copymap(struct service *pservice)
  pointer into the default structure.
 ***************************************************************************/
 
-static void *lp_local_ptr(struct service *service, void *ptr)
+static void *lp_local_ptr(struct loadparm_service *service, void *ptr)
 {
 	return (void *)(((char *)service) + PTR_DIFF(ptr, &sDefault));
 }
@@ -8304,7 +8251,7 @@ bool lp_is_default(int snum, struct parm_struct *parm)
  Display the contents of a single services record.
 ***************************************************************************/
 
-static void dump_a_service(struct service *pService, FILE * f)
+static void dump_a_service(struct loadparm_service *pService, FILE * f)
 {
 	int i;
 	struct param_opt_struct *data;
@@ -8402,7 +8349,7 @@ bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal)
 			if (isGlobal) {
 				ptr = parm_table[i].ptr;
 			} else {
-				struct service *pService = ServicePtrs[snum];
+				struct loadparm_service *pService = ServicePtrs[snum];
 				ptr = ((char *)pService) +
 					PTR_DIFF(parm_table[i].ptr, &sDefault);
 			}
@@ -8463,7 +8410,7 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters)
 			return &parm_table[(*i)++];
 		}
 	} else {
-		struct service *pService = ServicePtrs[snum];
+		struct loadparm_service *pService = ServicePtrs[snum];
 
 		for (; parm_table[*i].label; (*i)++) {
 			if (parm_table[*i].p_class == P_SEPARATOR)
@@ -9078,7 +9025,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i
 
 	/* Everything ok - add the service possibly using a template. */
 	if (iService < 0) {
-		const struct service *sp = &sDefault;
+		const struct loadparm_service *sp = &sDefault;
 		if (snum_template != -1) {
 			sp = ServicePtrs[snum_template];
 		}
diff --git a/source3/smbd/mangle_hash.c b/source3/smbd/mangle_hash.c
index c196a13..a51ea6b 100644
--- a/source3/smbd/mangle_hash.c
+++ b/source3/smbd/mangle_hash.c
@@ -333,9 +333,6 @@ static bool is_8_3(const char *fname, bool check_case, bool allow_wildcards,
 	smb_ucs2_t *ucs2name;
 	NTSTATUS ret = NT_STATUS_UNSUCCESSFUL;
 	size_t size;
-	char magic_char;
-
-	magic_char = lp_magicchar(p);
 
 	if (!fname || !*fname)
 		return False;
@@ -534,9 +531,6 @@ static bool lookup_name_from_8_3(TALLOC_CTX *ctx,
 	TDB_DATA data_val;
 	char *saved_ext = NULL;
 	char *s = talloc_strdup(ctx, in);
-	char magic_char;
-
-	magic_char = lp_magicchar(p);
 
 	/* If the cache isn't initialized, give up. */
 	if(!s || !tdb_mangled_cache ) {
@@ -684,9 +678,6 @@ static bool must_mangle(const char *name,
 	smb_ucs2_t *name_ucs2 = NULL;
 	NTSTATUS status;
 	size_t converted_size;
-	char magic_char;
-
-	magic_char = lp_magicchar(p);
 
 	if (!push_ucs2_talloc(NULL, &name_ucs2, name, &converted_size)) {
 		DEBUG(0, ("push_ucs2_talloc failed!\n"));


-- 
Samba Shared Repository


More information about the samba-cvs mailing list