1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

s3:param: avoid the use the global variable iServiceIndex in handle_copy

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-19 13:53:53 +13:00 committed by Jeremy Allison
parent 6f8b2ab54f
commit 2f47965ba9

View File

@ -2641,13 +2641,13 @@ static bool handle_copy(struct loadparm_context *unused, int snum, const char *p
DEBUG(3, ("Copying service from service %s\n", pszParmValue));
if ((iTemp = getservicebyname(pszParmValue, NULL)) >= 0) {
if (iTemp == iServiceIndex) {
if (iTemp == snum) {
DEBUG(0, ("Can't copy service %s - unable to copy self!\n", pszParmValue));
} else {
copy_service(ServicePtrs[iServiceIndex],
ServicePtrs[iTemp],
ServicePtrs[iServiceIndex]->copymap);
string_set(ServicePtrs[iServiceIndex], ptr, pszParmValue);
copy_service(ServicePtrs[snum],
serviceTemp,
ServicePtrs[snum]->copymap);
string_set(ServicePtrs[snum], ptr, pszParmValue);
bRetval = true;
}
} else {