From 34a0885df06f17799860d611397562a7d307f060 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 16 Dec 2006 18:37:33 +0000 Subject: r20217: uid_t and gid_t are not necessarily 32 bit. In assignments we get an automatic conversion, but not when we pass pointers down to other functions. Simo, please check. Volker (This used to be commit 04845f600b2ac9a129b3ecdb1e9060a5d8502830) --- source3/nsswitch/idmap_ldap.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/source3/nsswitch/idmap_ldap.c b/source3/nsswitch/idmap_ldap.c index baa926d479..672d0b7979 100644 --- a/source3/nsswitch/idmap_ldap.c +++ b/source3/nsswitch/idmap_ldap.c @@ -145,8 +145,10 @@ static NTSTATUS idmap_ldap_alloc_init(const char *params) const char *secret; const char *range; const char *tmp; - uint32_t low_id = 0; - uint32_t high_id = 0; + uid_t low_uid = 0; + uid_t high_uid = 0; + gid_t low_gid = 0; + gid_t high_gid = 0; idmap_alloc_ldap = talloc_zero(NULL, struct idmap_ldap_alloc_context); if (!idmap_alloc_ldap) { @@ -162,6 +164,8 @@ static NTSTATUS idmap_ldap_alloc_init(const char *params) range = lp_parm_const_string(-1, "idmap alloc config", "range", NULL); if (range && range[0]) { + unsigned low_id, high_id; + if (sscanf(range, "%u - %u", &low_id, &high_id) == 2) { if (low_id < high_id) { idmap_alloc_ldap->low_gid = idmap_alloc_ldap->low_uid = low_id; @@ -174,14 +178,14 @@ static NTSTATUS idmap_ldap_alloc_init(const char *params) } } - if (lp_idmap_uid(&low_id, &high_id)) { - idmap_alloc_ldap->low_uid = low_id; - idmap_alloc_ldap->high_uid = high_id; + if (lp_idmap_uid(&low_uid, &high_uid)) { + idmap_alloc_ldap->low_uid = low_uid; + idmap_alloc_ldap->high_uid = high_uid; } - if (lp_idmap_gid(&low_id, &high_id)) { - idmap_alloc_ldap->low_gid = low_id; - idmap_alloc_ldap->high_gid= high_id; + if (lp_idmap_gid(&low_gid, &high_gid)) { + idmap_alloc_ldap->low_gid = low_gid; + idmap_alloc_ldap->high_gid= high_gid; } if (idmap_alloc_ldap->high_uid <= idmap_alloc_ldap->low_uid) { -- cgit