From ca342870639f8720b1becb9b6a5587feafbeec11 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 3 Jul 2008 23:29:49 +0200 Subject: Make use of ADD_TO_ARRAY (This used to be commit 81f334bd6da601a040f754c46705cfa2fd4f8c45) --- source3/winbindd/idmap_util.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) (limited to 'source3/winbindd/idmap_util.c') diff --git a/source3/winbindd/idmap_util.c b/source3/winbindd/idmap_util.c index 78f4d13ec1..9819fe15f0 100644 --- a/source3/winbindd/idmap_util.c +++ b/source3/winbindd/idmap_util.c @@ -31,18 +31,16 @@ NTSTATUS idmap_uid_to_sid(DOM_SID *sid, uid_t uid) { NTSTATUS ret; struct id_map map; - struct id_map *maps[2]; + struct id_map *maps; DEBUG(10,("uid = [%lu]\n", (unsigned long)uid)); map.sid = sid; map.xid.type = ID_TYPE_UID; map.xid.id = uid; + maps = ↦ - maps[0] = ↦ - maps[1] = NULL; - - ret = idmap_unixids_to_sids(maps); + ret = idmap_unixids_to_sids(&maps, 1); if ( ! NT_STATUS_IS_OK(ret)) { DEBUG(10, ("error mapping uid [%lu]\n", (unsigned long)uid)); return ret; @@ -65,18 +63,16 @@ NTSTATUS idmap_gid_to_sid(DOM_SID *sid, gid_t gid) { NTSTATUS ret; struct id_map map; - struct id_map *maps[2]; + struct id_map *maps; DEBUG(10,("gid = [%lu]\n", (unsigned long)gid)); map.sid = sid; map.xid.type = ID_TYPE_GID; map.xid.id = gid; + maps = ↦ - maps[0] = ↦ - maps[1] = NULL; - - ret = idmap_unixids_to_sids(maps); + ret = idmap_unixids_to_sids(&maps, 1); if ( ! NT_STATUS_IS_OK(ret)) { DEBUG(10, ("error mapping gid [%lu]\n", (unsigned long)gid)); return ret; @@ -99,17 +95,15 @@ NTSTATUS idmap_sid_to_uid(DOM_SID *sid, uid_t *uid) { NTSTATUS ret; struct id_map map; - struct id_map *maps[2]; + struct id_map *maps; DEBUG(10,("idmap_sid_to_uid: sid = [%s]\n", sid_string_dbg(sid))); map.sid = sid; - map.xid.type = ID_TYPE_UID; - - maps[0] = ↦ - maps[1] = NULL; + map.xid.type = ID_TYPE_UID; + maps = ↦ - ret = idmap_sids_to_unixids(maps); + ret = idmap_sids_to_unixids(&maps, 1); if ( ! NT_STATUS_IS_OK(ret)) { DEBUG(10, ("error mapping sid [%s] to uid\n", sid_string_dbg(sid))); @@ -139,17 +133,15 @@ NTSTATUS idmap_sid_to_gid(DOM_SID *sid, gid_t *gid) { NTSTATUS ret; struct id_map map; - struct id_map *maps[2]; + struct id_map *maps; DEBUG(10,("idmap_sid_to_gid: sid = [%s]\n", sid_string_dbg(sid))); map.sid = sid; map.xid.type = ID_TYPE_GID; + maps = ↦ - maps[0] = ↦ - maps[1] = NULL; - - ret = idmap_sids_to_unixids(maps); + ret = idmap_sids_to_unixids(&maps, 1); if ( ! NT_STATUS_IS_OK(ret)) { DEBUG(10, ("error mapping sid [%s] to gid\n", sid_string_dbg(sid))); -- cgit