svn commit: samba r20217 - in branches/SAMBA_3_0/source/nsswitch: .
vlendec at samba.org
vlendec at samba.org
Sat Dec 16 18:37:34 GMT 2006
Author: vlendec
Date: 2006-12-16 18:37:33 +0000 (Sat, 16 Dec 2006)
New Revision: 20217
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20217
Log:
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
Modified:
branches/SAMBA_3_0/source/nsswitch/idmap_ldap.c
Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/idmap_ldap.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/idmap_ldap.c 2006-12-16 18:13:12 UTC (rev 20216)
+++ branches/SAMBA_3_0/source/nsswitch/idmap_ldap.c 2006-12-16 18:37:33 UTC (rev 20217)
@@ -145,8 +145,10 @@
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 @@
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 @@
}
}
- 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) {
More information about the samba-cvs
mailing list