param: add getservicebyname to s3_helpers
authorGarming Sam <garming@catalyst.net.nz>
Wed, 19 Feb 2014 05:08:47 +0000 (18:08 +1300)
committerJeremy Allison <jra@samba.org>
Wed, 7 May 2014 17:49:15 +0000 (19:49 +0200)
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/param/loadparm.h
lib/param/s3_param.h
source3/param/loadparm.c
source3/param/loadparm_ctx.c

index 2b890db5c4d5c89204c54728a7f149c2a659cc9a..c9baed5c7c53fbdc2c3e746c5048c3bea3f0ab54 100644 (file)
@@ -262,6 +262,7 @@ bool lp_is_security_and_server_role_valid(int server_role, int security);
 struct loadparm_global * get_globals(void);
 char * lp_string(TALLOC_CTX *, const char *);
 bool lp_string_set(char **, const char *);
+int getservicebyname(const char *, struct loadparm_service *);
 
 /**
  * Check if two parameters are equal.
index 276810427edf27767e587755655a7bf5cb27aa93..4ec922f07b6bdd050b8c43b0e81ed7667a7b6a6b 100644 (file)
@@ -9,6 +9,7 @@ struct loadparm_s3_helpers
        struct loadparm_service * (*get_service)(const char *service_name);
        struct loadparm_service * (*get_default_loadparm_service)(void);
        struct loadparm_service * (*get_servicebynum)(int snum);
+       int (*getservicebyname)(const char *, struct loadparm_service *);
        int (*get_numservices)(void);
        bool (*load)(const char *filename);
        bool (*set_cmdline)(const char *pszParmName, const char *pszParmValue);
index b206f6be7aa2ffa6d791e86b0d0bfb7a93ff3ffe..16dd70f26540aa8d9790b5cfdd05d2ad5160ac95 100644 (file)
@@ -1173,8 +1173,6 @@ FN_LOCAL_BOOL(autoloaded, autoloaded)
 
 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 loadparm_service *pserviceDest);
 static bool do_parameter(const char *pszParmName, const char *pszParmValue,
                         void *userdata);
 static bool do_section(const char *pszSectionName, void *userdata);
@@ -2071,7 +2069,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 loadparm_service *pserviceDest)
+int getservicebyname(const char *pszServiceName, struct loadparm_service *pserviceDest)
 {
        int iService = -1;
        char *canon_name;
index ed21e4fb5e818e9146a75ef43e525fea05f7803f..d13304ff210f19197a423fa5f60a6c03dce9edb7 100644 (file)
@@ -63,6 +63,7 @@ static struct loadparm_s3_helpers s3_fns =
        .get_parm_ptr = lp_parm_ptr,
        .get_service = lp_service_for_s4_ctx,
        .get_servicebynum = lp_servicebynum_for_s4_ctx,
+       .getservicebyname = getservicebyname,
        .get_default_loadparm_service = lp_default_loadparm_service,
        .get_numservices = lp_numservices,
        .load = lp_load_for_s4_ctx,