summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_autorid.c
diff options
context:
space:
mode:
authorAtul Kulkarni <atul.kulkarni@in.ibm.com>2013-08-28 17:19:30 +0200
committerMichael Adam <obnox@samba.org>2013-10-02 00:06:17 +0200
commit65881c3118044e101d4b04737c471725802a4e09 (patch)
tree422a7da62cc7350c36cfcc23b39b6f647fffcb3c /source3/winbindd/idmap_autorid.c
parent802b9d7ec614e25ff99c367cfaf267d8334311f1 (diff)
downloadsamba-65881c3118044e101d4b04737c471725802a4e09.tar.gz
samba-65881c3118044e101d4b04737c471725802a4e09.tar.bz2
samba-65881c3118044e101d4b04737c471725802a4e09.zip
idmap_autorid: move the checks from idmap_autorid_initialize to idmap_autorid_saveconfig()
Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/winbindd/idmap_autorid.c')
-rw-r--r--source3/winbindd/idmap_autorid.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c
index 60ce33c35f..fb0985b9dd 100644
--- a/source3/winbindd/idmap_autorid.c
+++ b/source3/winbindd/idmap_autorid.c
@@ -595,9 +595,7 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom)
{
struct idmap_tdb_common_context *commonconfig;
struct autorid_global_config *config;
- struct autorid_global_config *storedconfig = NULL;
NTSTATUS status;
- uint32_t hwm;
if (!strequal(dom->name, "*")) {
DEBUG(0, ("idmap_autorid_initialize: Error: autorid configured "
@@ -635,12 +633,6 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom)
config->rangesize = lp_parm_int(-1, "idmap config *",
"rangesize", 100000);
- if (config->rangesize < 2000) {
- DEBUG(1, ("autorid rangesize must be at least 2000\n"));
- status = NT_STATUS_INVALID_PARAMETER;
- goto error;
- }
-
config->maxranges = (dom->high_id - dom->low_id + 1) /
config->rangesize;
@@ -660,50 +652,6 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom)
config->maxranges));
}
- DEBUG(10, ("Current configuration in config is "
- "minvalue:%d rangesize:%d maxranges:%d\n",
- config->minvalue, config->rangesize, config->maxranges));
-
- /* read previously stored config and current HWM */
- status = idmap_autorid_loadconfig(autorid_db, talloc_tos(),
- &storedconfig);
- if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
- DEBUG(5, ("No configuration found. Storing initial "
- "configuration.\n"));
- } else if (!NT_STATUS_IS_OK(status)) {
- goto error;
- }
-
- status = dbwrap_fetch_uint32_bystring(autorid_db, HWM, &hwm);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(1, ("Fatal error while fetching current "
- "HWM value: %s\n", nt_errstr(status)));
- status = NT_STATUS_INTERNAL_ERROR;
- goto error;
- }
-
- /* did the minimum value or rangesize change? */
- if (storedconfig &&
- ((storedconfig->minvalue != config->minvalue) ||
- (storedconfig->rangesize != config->rangesize))) {
- DEBUG(1, ("New configuration values for rangesize or "
- "minimum uid value conflict with previously "
- "used values! Aborting initialization\n"));
- status = NT_STATUS_INVALID_PARAMETER;
- goto error;
- }
-
- /*
- * has the highest uid value been reduced to setting that is not
- * sufficient any more for already existing ranges?
- */
- if (hwm > config->maxranges) {
- DEBUG(1, ("New upper uid limit is too low to cover "
- "existing mappings! Aborting initialization\n"));
- status = NT_STATUS_INVALID_PARAMETER;
- goto error;
- }
-
status = idmap_autorid_saveconfig(autorid_db, config);
if (!NT_STATUS_IS_OK(status)) {
@@ -738,8 +686,6 @@ error:
talloc_free(config);
done:
- talloc_free(storedconfig);
-
return status;
}