summaryrefslogtreecommitdiff
path: root/source3/sam
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2003-08-02 20:06:57 +0000
committerSimo Sorce <idra@samba.org>2003-08-02 20:06:57 +0000
commit04bf12b176d5abe06b7f1401810369bcafe0b611 (patch)
tree8bb6627c3ffa4cab902787b874206f8012a33e3a /source3/sam
parent7efce478976e2ac71bcaf4e4d1049bb263634711 (diff)
downloadsamba-04bf12b176d5abe06b7f1401810369bcafe0b611.tar.gz
samba-04bf12b176d5abe06b7f1401810369bcafe0b611.tar.bz2
samba-04bf12b176d5abe06b7f1401810369bcafe0b611.zip
port latest changes from SAMBA_3_0 tree
(This used to be commit 3101c236b8241dc0183995ffceed551876427de4)
Diffstat (limited to 'source3/sam')
-rw-r--r--source3/sam/idmap.c7
-rw-r--r--source3/sam/idmap_tdb.c28
-rw-r--r--source3/sam/idmap_util.c8
3 files changed, 25 insertions, 18 deletions
diff --git a/source3/sam/idmap.c b/source3/sam/idmap.c
index 7a8f270e15..4d8b768c2f 100644
--- a/source3/sam/idmap.c
+++ b/source3/sam/idmap.c
@@ -2,7 +2,7 @@
Unix SMB/CIFS implementation.
ID Mapping
Copyright (C) Tim Potter 2000
- Copyright (C) Anthony Liguori <aliguor@us.ibm.com> 2003
+ Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003
Copyright (C) Simo Sorce 2003
Copyright (C) Jeremy Allison 2003.
@@ -153,10 +153,11 @@ NTSTATUS idmap_set_mapping(const DOM_SID *sid, unid_t id, int id_type)
struct idmap_methods *map = remote_map;
DOM_SID tmp_sid;
- DEBUG(10, ("idmap_set_mapping: Set %s to %s %d\n",
+ DEBUG(10, ("idmap_set_mapping: Set %s to %s %lu\n",
sid_string_static(sid),
((id_type & ID_TYPEMASK) == ID_USERID) ? "UID" : "GID",
- ((id_type & ID_TYPEMASK) == ID_USERID) ? id.uid : id.gid));
+ ((id_type & ID_TYPEMASK) == ID_USERID) ? (unsigned long)id.uid :
+ (unsigned long)id.gid));
if ( (NT_STATUS_IS_OK(cache_map->
get_sid_from_id(&tmp_sid, id,
diff --git a/source3/sam/idmap_tdb.c b/source3/sam/idmap_tdb.c
index 7f8dce1f1a..2055103898 100644
--- a/source3/sam/idmap_tdb.c
+++ b/source3/sam/idmap_tdb.c
@@ -4,7 +4,7 @@
idmap TDB backend
Copyright (C) Tim Potter 2000
- Copyright (C) Anthony Liguori 2003
+ Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003
Copyright (C) Simo Sorce 2003
This program is free software; you can redistribute it and/or modify
@@ -116,7 +116,8 @@ static NTSTATUS db_allocate_id(unid_t *id, int id_type)
/* check it is in the range */
if (hwm > idmap_state.uid_high) {
- DEBUG(0, ("idmap Fatal Error: UID range full!! (max: %u)\n", idmap_state.uid_high));
+ DEBUG(0, ("idmap Fatal Error: UID range full!! (max: %lu)\n",
+ (unsigned long)idmap_state.uid_high));
return NT_STATUS_UNSUCCESSFUL;
}
@@ -129,7 +130,8 @@ static NTSTATUS db_allocate_id(unid_t *id, int id_type)
/* recheck it is in the range */
if (hwm > idmap_state.uid_high) {
- DEBUG(0, ("idmap Fatal Error: UID range full!! (max: %u)\n", idmap_state.uid_high));
+ DEBUG(0, ("idmap Fatal Error: UID range full!! (max: %lu)\n",
+ (unsigned long)idmap_state.uid_high));
return NT_STATUS_UNSUCCESSFUL;
}
@@ -144,7 +146,8 @@ static NTSTATUS db_allocate_id(unid_t *id, int id_type)
/* check it is in the range */
if (hwm > idmap_state.gid_high) {
- DEBUG(0, ("idmap Fatal Error: GID range full!! (max: %u)\n", idmap_state.gid_high));
+ DEBUG(0, ("idmap Fatal Error: GID range full!! (max: %lu)\n",
+ (unsigned long)idmap_state.gid_high));
return NT_STATUS_UNSUCCESSFUL;
}
@@ -158,7 +161,8 @@ static NTSTATUS db_allocate_id(unid_t *id, int id_type)
/* recheck it is in the range */
if (hwm > idmap_state.gid_high) {
- DEBUG(0, ("idmap Fatal Error: GID range full!! (max: %u)\n", idmap_state.gid_high));
+ DEBUG(0, ("idmap Fatal Error: GID range full!! (max: %lu)\n",
+ (unsigned long)idmap_state.gid_high));
return NT_STATUS_UNSUCCESSFUL;
}
@@ -185,10 +189,10 @@ static NTSTATUS internal_get_sid_from_id(DOM_SID *sid, unid_t id, int id_type)
switch (id_type & ID_TYPEMASK) {
case ID_USERID:
- slprintf(keystr, sizeof(keystr), "UID %d", id.uid);
+ slprintf(keystr, sizeof(keystr), "UID %lu", (unsigned long)id.uid);
break;
case ID_GROUPID:
- slprintf(keystr, sizeof(keystr), "GID %d", id.gid);
+ slprintf(keystr, sizeof(keystr), "GID %lu", (unsigned long)id.gid);
break;
default:
return NT_STATUS_UNSUCCESSFUL;
@@ -374,9 +378,11 @@ static NTSTATUS db_get_id_from_sid(unid_t *id, int *id_type, const DOM_SID *sid)
/* Store the UID side */
/* Store new id */
if (*id_type & ID_USERID) {
- slprintf(ugid_str, sizeof(ugid_str), "UID %d", (*id).uid);
+ slprintf(ugid_str, sizeof(ugid_str), "UID %lu",
+ (unsigned long)((*id).uid));
} else {
- slprintf(ugid_str, sizeof(ugid_str), "GID %d", (*id).gid);
+ slprintf(ugid_str, sizeof(ugid_str), "GID %lu",
+ (unsigned long)((*id).gid));
}
ugid_data.dptr = ugid_str;
@@ -430,9 +436,9 @@ static NTSTATUS db_set_mapping(const DOM_SID *sid, unid_t id, int id_type)
ksid.dsize = strlen(ksidstr) + 1;
if (id_type & ID_USERID) {
- slprintf(kidstr, sizeof(kidstr), "UID %d", id.uid);
+ slprintf(kidstr, sizeof(kidstr), "UID %lu", (unsigned long)id.uid);
} else if (id_type & ID_GROUPID) {
- slprintf(kidstr, sizeof(kidstr), "GID %d", id.gid);
+ slprintf(kidstr, sizeof(kidstr), "GID %lu", (unsigned long)id.gid);
} else {
return NT_STATUS_INVALID_PARAMETER;
}
diff --git a/source3/sam/idmap_util.c b/source3/sam/idmap_util.c
index f767cc898c..f794ea5173 100644
--- a/source3/sam/idmap_util.c
+++ b/source3/sam/idmap_util.c
@@ -146,7 +146,7 @@ NTSTATUS idmap_uid_to_sid(DOM_SID *sid, uid_t uid)
unid_t id;
int flags;
- DEBUG(10,("idmap_uid_to_sid: uid = [%d]\n", uid));
+ DEBUG(10,("idmap_uid_to_sid: uid = [%lu]\n", (unsigned long)uid));
flags = ID_USERID;
id.uid = uid;
@@ -164,7 +164,7 @@ NTSTATUS idmap_gid_to_sid(DOM_SID *sid, gid_t gid)
unid_t id;
int flags;
- DEBUG(10,("idmap_gid_to_sid: gid = [%d]\n", gid));
+ DEBUG(10,("idmap_gid_to_sid: gid = [%lu]\n", (unsigned long)gid));
flags = ID_GROUPID;
#if 0 /* JERRY */
@@ -195,7 +195,7 @@ NTSTATUS idmap_sid_to_uid(const DOM_SID *sid, uid_t *uid, uint32 flags)
ret = idmap_get_id_from_sid(&id, &flags, sid);
if ( NT_STATUS_IS_OK(ret) ) {
- DEBUG(10,("idmap_sid_to_uid: uid = [%d]\n", id.uid));
+ DEBUG(10,("idmap_sid_to_uid: uid = [%lu]\n", (unsigned long)id.uid));
*uid = id.uid;
}
@@ -225,7 +225,7 @@ NTSTATUS idmap_sid_to_gid(const DOM_SID *sid, gid_t *gid, uint32 flags)
if ( NT_STATUS_IS_OK(ret) )
{
- DEBUG(10,("idmap_sid_to_gid: gid = [%d]\n", id.gid));
+ DEBUG(10,("idmap_sid_to_gid: gid = [%lu]\n", (unsigned long)id.gid));
*gid = id.gid;
}