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

param: consolidate handle_copy method between the two loadparms

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Garming Sam
2014-02-20 10:24:00 +13:00
committed by Jeremy Allison
parent c3c8f4fe9c
commit ef3d445d88
2 changed files with 18 additions and 41 deletions

View File

@ -261,7 +261,6 @@ static bool bGlobalOnly = false;
/* prototypes for the special type handlers */
static bool handle_include(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr);
static bool handle_copy(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr);
static bool handle_idmap_backend(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr);
static bool handle_idmap_uid(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr);
static bool handle_idmap_gid(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr);
@ -2627,37 +2626,6 @@ static bool handle_include(struct loadparm_context *unused, int snum, const char
return true;
}
/***************************************************************************
Handle the interpretation of the copy parameter.
***************************************************************************/
static bool handle_copy(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr)
{
bool bRetval;
int iTemp;
bRetval = false;
DEBUG(3, ("Copying service from service %s\n", pszParmValue));
if ((iTemp = getservicebyname(pszParmValue, NULL)) >= 0) {
if (iTemp == snum) {
DEBUG(0, ("Can't copy service %s - unable to copy self!\n", pszParmValue));
} else {
copy_service(ServicePtrs[snum],
serviceTemp,
ServicePtrs[snum]->copymap);
string_set(ServicePtrs[snum], ptr, pszParmValue);
bRetval = true;
}
} else {
DEBUG(0, ("Unable to copy service - source not found: %s\n", pszParmValue));
bRetval = false;
}
return (bRetval);
}
static bool handle_ldap_debug_level(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr)
{
Globals.ldap_debug_level = lp_int(pszParmValue);