summaryrefslogtreecommitdiff
path: root/source3/groupdb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-18 17:40:25 -0700
committerJeremy Allison <jra@samba.org>2007-10-18 17:40:25 -0700
commit30191d1a5704ad2b158386b511558972d539ce47 (patch)
tree4f46e5c4f28f672ab661aa18f45745860970a88c /source3/groupdb
parent789856f63ff73fec66298e95c91c60db7bdaf14e (diff)
downloadsamba-30191d1a5704ad2b158386b511558972d539ce47.tar.gz
samba-30191d1a5704ad2b158386b511558972d539ce47.tar.bz2
samba-30191d1a5704ad2b158386b511558972d539ce47.zip
RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
Diffstat (limited to 'source3/groupdb')
-rw-r--r--source3/groupdb/mapping.c18
-rw-r--r--source3/groupdb/mapping.h16
-rw-r--r--source3/groupdb/mapping_ldb.c24
-rw-r--r--source3/groupdb/mapping_tdb.c26
4 files changed, 42 insertions, 42 deletions
diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c
index 8ba436cfc2..bd0d775fc5 100644
--- a/source3/groupdb/mapping.c
+++ b/source3/groupdb/mapping.c
@@ -28,7 +28,7 @@ static const struct mapping_backend *backend;
/*
initialise a group mapping backend
*/
-static BOOL init_group_mapping(void)
+static bool init_group_mapping(void)
{
if (backend != NULL) {
/* already initialised */
@@ -101,10 +101,10 @@ struct aliasmem_closure {
/* get a domain group from it's SID */
-BOOL get_domain_group_from_sid(DOM_SID sid, GROUP_MAP *map)
+bool get_domain_group_from_sid(DOM_SID sid, GROUP_MAP *map)
{
struct group *grp;
- BOOL ret;
+ bool ret;
if(!init_group_mapping()) {
DEBUG(0,("failed to initialize group mapping\n"));
@@ -387,7 +387,7 @@ NTSTATUS pdb_default_delete_group_mapping_entry(struct pdb_methods *methods,
NTSTATUS pdb_default_enum_group_mapping(struct pdb_methods *methods,
const DOM_SID *sid, enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap, size_t *p_num_entries,
- BOOL unix_only)
+ bool unix_only)
{
if (!init_group_mapping()) {
DEBUG(0,("failed to initialize group mapping\n"));
@@ -404,7 +404,7 @@ NTSTATUS pdb_default_create_alias(struct pdb_methods *methods,
enum lsa_SidType type;
uint32 new_rid;
gid_t gid;
- BOOL exists;
+ bool exists;
GROUP_MAP map;
TALLOC_CTX *mem_ctx;
NTSTATUS status;
@@ -626,7 +626,7 @@ NTSTATUS pdb_nop_delete_group_mapping_entry(struct pdb_methods *methods,
NTSTATUS pdb_nop_enum_group_mapping(struct pdb_methods *methods,
enum lsa_SidType sid_name_use,
GROUP_MAP **rmap, size_t *num_entries,
- BOOL unix_only)
+ bool unix_only)
{
return NT_STATUS_UNSUCCESSFUL;
}
@@ -634,10 +634,10 @@ NTSTATUS pdb_nop_enum_group_mapping(struct pdb_methods *methods,
/****************************************************************************
These need to be redirected through pdb_interface.c
****************************************************************************/
-BOOL pdb_get_dom_grp_info(const DOM_SID *sid, struct acct_info *info)
+bool pdb_get_dom_grp_info(const DOM_SID *sid, struct acct_info *info)
{
GROUP_MAP map;
- BOOL res;
+ bool res;
become_root();
res = get_domain_group_from_sid(*sid, &map);
@@ -652,7 +652,7 @@ BOOL pdb_get_dom_grp_info(const DOM_SID *sid, struct acct_info *info)
return True;
}
-BOOL pdb_set_dom_grp_info(const DOM_SID *sid, const struct acct_info *info)
+bool pdb_set_dom_grp_info(const DOM_SID *sid, const struct acct_info *info)
{
GROUP_MAP map;
diff --git a/source3/groupdb/mapping.h b/source3/groupdb/mapping.h
index 29e8ad5ffa..4af38314f8 100644
--- a/source3/groupdb/mapping.h
+++ b/source3/groupdb/mapping.h
@@ -14,15 +14,15 @@
groupdb mapping backend abstraction
*/
struct mapping_backend {
- BOOL (*init_group_mapping)(void);
- BOOL (*add_mapping_entry)(GROUP_MAP *map, int flag);
- BOOL (*get_group_map_from_sid)(DOM_SID sid, GROUP_MAP *map);
- BOOL (*get_group_map_from_gid)(gid_t gid, GROUP_MAP *map);
- BOOL (*get_group_map_from_ntname)(const char *name, GROUP_MAP *map);
- BOOL (*group_map_remove)(const DOM_SID *sid);
- BOOL (*enum_group_mapping)(const DOM_SID *domsid, enum lsa_SidType sid_name_use,
+ bool (*init_group_mapping)(void);
+ bool (*add_mapping_entry)(GROUP_MAP *map, int flag);
+ bool (*get_group_map_from_sid)(DOM_SID sid, GROUP_MAP *map);
+ bool (*get_group_map_from_gid)(gid_t gid, GROUP_MAP *map);
+ bool (*get_group_map_from_ntname)(const char *name, GROUP_MAP *map);
+ bool (*group_map_remove)(const DOM_SID *sid);
+ bool (*enum_group_mapping)(const DOM_SID *domsid, enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap,
- size_t *p_num_entries, BOOL unix_only);
+ size_t *p_num_entries, bool unix_only);
NTSTATUS (*one_alias_membership)(const DOM_SID *member,
DOM_SID **sids, size_t *num);
NTSTATUS (*add_aliasmem)(const DOM_SID *alias, const DOM_SID *member);
diff --git a/source3/groupdb/mapping_ldb.c b/source3/groupdb/mapping_ldb.c
index cfa717057c..c0b2e82a29 100644
--- a/source3/groupdb/mapping_ldb.c
+++ b/source3/groupdb/mapping_ldb.c
@@ -28,14 +28,14 @@
static struct ldb_context *ldb;
-static BOOL mapping_upgrade(const char *tdb_path);
+static bool mapping_upgrade(const char *tdb_path);
/*
connect to the group mapping ldb
*/
-static BOOL init_group_mapping(void)
+static bool init_group_mapping(void)
{
- BOOL existed;
+ bool existed;
const char *init_ldif[] =
{ "dn: @ATTRIBUTES\n" \
"ntName: CASE_INSENSITIVE\n" \
@@ -131,7 +131,7 @@ static struct ldb_dn *mapping_dn(TALLOC_CTX *mem_ctx, const DOM_SID *sid)
/*
add a group mapping entry
*/
-static BOOL add_mapping_entry(GROUP_MAP *map, int flag)
+static bool add_mapping_entry(GROUP_MAP *map, int flag)
{
struct ldb_message *msg;
int ret, i;
@@ -180,7 +180,7 @@ failed:
/*
unpack a ldb message into a GROUP_MAP structure
*/
-static BOOL msg_to_group_map(struct ldb_message *msg, GROUP_MAP *map)
+static bool msg_to_group_map(struct ldb_message *msg, GROUP_MAP *map)
{
const char *sidstr;
@@ -203,7 +203,7 @@ static BOOL msg_to_group_map(struct ldb_message *msg, GROUP_MAP *map)
/*
return a group map entry for a given sid
*/
-static BOOL get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map)
+static bool get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map)
{
int ret;
struct ldb_dn *dn;
@@ -231,7 +231,7 @@ failed:
/*
return a group map entry for a given gid
*/
-static BOOL get_group_map_from_gid(gid_t gid, GROUP_MAP *map)
+static bool get_group_map_from_gid(gid_t gid, GROUP_MAP *map)
{
int ret;
char *expr;
@@ -258,7 +258,7 @@ failed:
/*
Return the sid and the type of the unix group.
*/
-static BOOL get_group_map_from_ntname(const char *name, GROUP_MAP *map)
+static bool get_group_map_from_ntname(const char *name, GROUP_MAP *map)
{
int ret;
char *expr;
@@ -284,7 +284,7 @@ failed:
/*
Remove a group mapping entry.
*/
-static BOOL group_map_remove(const DOM_SID *sid)
+static bool group_map_remove(const DOM_SID *sid)
{
struct ldb_dn *dn;
int ret;
@@ -303,9 +303,9 @@ static BOOL group_map_remove(const DOM_SID *sid)
/*
Enumerate the group mappings for a domain
*/
-static BOOL enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_use,
+static bool enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap,
- size_t *p_num_entries, BOOL unix_only)
+ size_t *p_num_entries, bool unix_only)
{
int i, ret;
char *expr;
@@ -614,7 +614,7 @@ static int upgrade_alias_record(TDB_CONTEXT *tdb_ctx, TDB_DATA key,
/*
upgrade from a old style tdb
*/
-static BOOL mapping_upgrade(const char *tdb_path)
+static bool mapping_upgrade(const char *tdb_path)
{
static TDB_CONTEXT *tdb;
int ret, status=0;
diff --git a/source3/groupdb/mapping_tdb.c b/source3/groupdb/mapping_tdb.c
index eac28754e1..5bfe96622d 100644
--- a/source3/groupdb/mapping_tdb.c
+++ b/source3/groupdb/mapping_tdb.c
@@ -25,14 +25,14 @@
static TDB_CONTEXT *tdb; /* used for driver files */
-static BOOL enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap,
- size_t *p_num_entries, BOOL unix_only);
-static BOOL group_map_remove(const DOM_SID *sid);
+static bool enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap,
+ size_t *p_num_entries, bool unix_only);
+static bool group_map_remove(const DOM_SID *sid);
/****************************************************************************
Open the group mapping tdb.
****************************************************************************/
-static BOOL init_group_mapping(void)
+static bool init_group_mapping(void)
{
const char *vstring = "INFO/version";
int32 vers_id;
@@ -88,7 +88,7 @@ static BOOL init_group_mapping(void)
/****************************************************************************
****************************************************************************/
-static BOOL add_mapping_entry(GROUP_MAP *map, int flag)
+static bool add_mapping_entry(GROUP_MAP *map, int flag)
{
TDB_DATA dbuf;
pstring key, buf;
@@ -117,7 +117,7 @@ static BOOL add_mapping_entry(GROUP_MAP *map, int flag)
Return the sid and the type of the unix group.
****************************************************************************/
-static BOOL get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map)
+static bool get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map)
{
TDB_DATA dbuf;
pstring key;
@@ -152,7 +152,7 @@ static BOOL get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map)
Return the sid and the type of the unix group.
****************************************************************************/
-static BOOL get_group_map_from_gid(gid_t gid, GROUP_MAP *map)
+static bool get_group_map_from_gid(gid_t gid, GROUP_MAP *map)
{
TDB_DATA kbuf, dbuf, newkey;
fstring string_sid;
@@ -197,7 +197,7 @@ static BOOL get_group_map_from_gid(gid_t gid, GROUP_MAP *map)
Return the sid and the type of the unix group.
****************************************************************************/
-static BOOL get_group_map_from_ntname(const char *name, GROUP_MAP *map)
+static bool get_group_map_from_ntname(const char *name, GROUP_MAP *map)
{
TDB_DATA kbuf, dbuf, newkey;
fstring string_sid;
@@ -242,7 +242,7 @@ static BOOL get_group_map_from_ntname(const char *name, GROUP_MAP *map)
Remove a group mapping entry.
****************************************************************************/
-static BOOL group_map_remove(const DOM_SID *sid)
+static bool group_map_remove(const DOM_SID *sid)
{
TDB_DATA dbuf;
pstring key;
@@ -269,8 +269,8 @@ static BOOL group_map_remove(const DOM_SID *sid)
Enumerate the group mapping.
****************************************************************************/
-static BOOL enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap,
- size_t *p_num_entries, BOOL unix_only)
+static bool enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap,
+ size_t *p_num_entries, bool unix_only)
{
TDB_DATA kbuf, dbuf, newkey;
fstring string_sid;
@@ -411,7 +411,7 @@ static NTSTATUS alias_memberships(const DOM_SID *members, size_t num_members,
return NT_STATUS_OK;
}
-static BOOL is_aliasmem(const DOM_SID *alias, const DOM_SID *member)
+static bool is_aliasmem(const DOM_SID *alias, const DOM_SID *member)
{
DOM_SID *sids;
size_t i, num;
@@ -561,7 +561,7 @@ static NTSTATUS del_aliasmem(const DOM_SID *alias, const DOM_SID *member)
NTSTATUS result;
DOM_SID *sids;
size_t i, num;
- BOOL found = False;
+ bool found = False;
char *member_string;
TDB_DATA dbuf;
pstring key;