RIP BOOL. Convert BOOL -> bool. I found a few interesting
[samba.git] / source3 / nsswitch / wb_client.c
index 3926a218e9e057a56c806a20033f9b173e115eaf..3e3c140fae85534e8eb72eabadb761ee91eee362 100644 (file)
@@ -32,7 +32,7 @@ NSS_STATUS winbindd_request_response(int req_type,
 
 /* Call winbindd to convert a name to a sid */
 
-BOOL winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid, 
+bool winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid, 
                          enum lsa_SidType *name_type)
 {
        struct winbindd_request request;
@@ -62,7 +62,7 @@ BOOL winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid,
 
 /* Call winbindd to convert sid to name */
 
-BOOL winbind_lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, 
+bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, 
                        const char **domain, const char **name,
                         enum lsa_SidType *name_type)
 {
@@ -111,7 +111,7 @@ BOOL winbind_lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
        return True;
 }
 
-BOOL winbind_lookup_rids(TALLOC_CTX *mem_ctx,
+bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
                         const DOM_SID *domain_sid,
                         int num_rids, uint32 *rids,
                         const char **domain_name,
@@ -145,7 +145,7 @@ BOOL winbind_lookup_rids(TALLOC_CTX *mem_ctx,
                               "%ld\n", rids[i]);
        }
 
-       if ((num_rids != 0) && (ridlist == NULL)) {
+       if (ridlist == NULL) {
                return False;
        }
 
@@ -163,16 +163,11 @@ BOOL winbind_lookup_rids(TALLOC_CTX *mem_ctx,
 
        *domain_name = talloc_strdup(mem_ctx, response.data.domain_name);
 
-       if (num_rids) {
-               *names = TALLOC_ARRAY(mem_ctx, const char *, num_rids);
-               *types = TALLOC_ARRAY(mem_ctx, enum lsa_SidType, num_rids);
+       *names = TALLOC_ARRAY(mem_ctx, const char *, num_rids);
+       *types = TALLOC_ARRAY(mem_ctx, enum lsa_SidType, num_rids);
 
-               if ((*names == NULL) || (*types == NULL)) {
-                       goto fail;
-               }
-       } else {
-               *names = NULL;
-               *types = NULL;
+       if ((*names == NULL) || (*types == NULL)) {
+               goto fail;
        }
 
        p = (char *)response.extra_data.data;
@@ -228,7 +223,7 @@ BOOL winbind_lookup_rids(TALLOC_CTX *mem_ctx,
 
 /* Call winbindd to convert SID to uid */
 
-BOOL winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid)
+bool winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid)
 {
        struct winbindd_request request;
        struct winbindd_response response;
@@ -261,7 +256,7 @@ BOOL winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid)
 
 /* Call winbindd to convert uid to sid */
 
-BOOL winbind_uid_to_sid(DOM_SID *sid, uid_t uid)
+bool winbind_uid_to_sid(DOM_SID *sid, uid_t uid)
 {
        struct winbindd_request request;
        struct winbindd_response response;
@@ -295,7 +290,7 @@ BOOL winbind_uid_to_sid(DOM_SID *sid, uid_t uid)
 
 /* Call winbindd to convert SID to gid */
 
-BOOL winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid)
+bool winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid)
 {
        struct winbindd_request request;
        struct winbindd_response response;
@@ -328,7 +323,7 @@ BOOL winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid)
 
 /* Call winbindd to convert gid to sid */
 
-BOOL winbind_gid_to_sid(DOM_SID *sid, gid_t gid)
+bool winbind_gid_to_sid(DOM_SID *sid, gid_t gid)
 {
        struct winbindd_request request;
        struct winbindd_response response;
@@ -362,7 +357,7 @@ BOOL winbind_gid_to_sid(DOM_SID *sid, gid_t gid)
 
 /* Call winbindd to convert SID to uid */
 
-BOOL winbind_sids_to_unixids(struct id_map *ids, int num_ids)
+bool winbind_sids_to_unixids(struct id_map *ids, int num_ids)
 {
        struct winbindd_request request;
        struct winbindd_response response;
@@ -410,7 +405,7 @@ BOOL winbind_sids_to_unixids(struct id_map *ids, int num_ids)
        return (result == NSS_STATUS_SUCCESS);
 }
 
-BOOL winbind_idmap_dump_maps(TALLOC_CTX *memctx, const char *file)
+bool winbind_idmap_dump_maps(TALLOC_CTX *memctx, const char *file)
 {
        struct winbindd_request request;
        struct winbindd_response response;
@@ -428,7 +423,7 @@ BOOL winbind_idmap_dump_maps(TALLOC_CTX *memctx, const char *file)
        return (result == NSS_STATUS_SUCCESS);
 }
 
-BOOL winbind_allocate_uid(uid_t *uid)
+bool winbind_allocate_uid(uid_t *uid)
 {
        struct winbindd_request request;
        struct winbindd_response response;
@@ -453,7 +448,7 @@ BOOL winbind_allocate_uid(uid_t *uid)
        return True;
 }
 
-BOOL winbind_allocate_gid(gid_t *gid)
+bool winbind_allocate_gid(gid_t *gid)
 {
        struct winbindd_request request;
        struct winbindd_response response;
@@ -478,7 +473,7 @@ BOOL winbind_allocate_gid(gid_t *gid)
        return True;
 }
 
-BOOL winbind_set_mapping(const struct id_map *map)
+bool winbind_set_mapping(const struct id_map *map)
 {
        struct winbindd_request request;
        struct winbindd_response response;
@@ -500,7 +495,7 @@ BOOL winbind_set_mapping(const struct id_map *map)
        return (result == NSS_STATUS_SUCCESS);
 }
 
-BOOL winbind_set_uid_hwm(unsigned long id)
+bool winbind_set_uid_hwm(unsigned long id)
 {
        struct winbindd_request request;
        struct winbindd_response response;
@@ -521,7 +516,7 @@ BOOL winbind_set_uid_hwm(unsigned long id)
        return (result == NSS_STATUS_SUCCESS);
 }
 
-BOOL winbind_set_gid_hwm(unsigned long id)
+bool winbind_set_gid_hwm(unsigned long id)
 {
        struct winbindd_request request;
        struct winbindd_response response;
@@ -546,7 +541,7 @@ BOOL winbind_set_gid_hwm(unsigned long id)
  simple wrapper function to see if winbindd is alive
 **********************************************************************/
 
-BOOL winbind_ping( void )
+bool winbind_ping( void )
 {
        NSS_STATUS result;