1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

r12964: Rewind rem_backend in the case we have to workaround the idmap_ prefix.

Else SAFE_FREE seg faults.  Thanks to Günther for pointing me at this.

I've implemented in in this was as we should announce to remove the
idmap_ strip stuff after some time at all.
This commit is contained in:
Lars Müller 2006-01-16 17:21:47 +00:00 committed by Gerald (Jerry) Carter
parent dd185c7aa8
commit 6a5bf399a5

View File

@ -120,6 +120,7 @@ BOOL idmap_init(const char **remote_backend)
char *rem_backend = smb_xstrdup(*remote_backend);
fstring params = "";
char *pparams;
BOOL idmap_prefix_workaround = False;
/* get any mode parameters passed in */
@ -132,6 +133,7 @@ BOOL idmap_init(const char **remote_backend)
/* strip any leading idmap_ prefix of */
if ( strncmp( rem_backend, "idmap_", 6) == 0 ) {
rem_backend += 6;
idmap_prefix_workaround = True;
DEBUG(0, ("idmap_init: idmap backend uses deprecated 'idmap_' prefix. Please replace 'idmap_%s' by '%s' in %s\n", rem_backend, rem_backend, dyn_CONFIGFILE));
}
@ -146,9 +148,13 @@ BOOL idmap_init(const char **remote_backend)
}
} else {
DEBUG(0, ("idmap_init: could not load remote backend '%s'\n", rem_backend));
if (idmap_prefix_workaround)
rem_backend -= 6;
SAFE_FREE(rem_backend);
return False;
}
if (idmap_prefix_workaround)
rem_backend -= 6;
SAFE_FREE(rem_backend);
}