summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-12-16 18:37:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:33 -0500
commit34a0885df06f17799860d611397562a7d307f060 (patch)
tree876cd0e0a332c74bfa8ad16f9bfcdd7e41493895
parentb1de1a6eabcb565cb37307df3a0cf63697ca0dce (diff)
downloadsamba-34a0885df06f17799860d611397562a7d307f060.tar.gz
samba-34a0885df06f17799860d611397562a7d307f060.tar.bz2
samba-34a0885df06f17799860d611397562a7d307f060.zip
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)
-rw-r--r--source3/nsswitch/idmap_ldap.c20
1 files 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) {