Author: jelmer
Date: 2007-10-06 21:42:58 +0000 (Sat, 06 Oct 2007)
New Revision: 25548

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25548

Log:
Convert to standard bool type.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/kdc/kdc.c
   branches/SAMBA_4_0/source/kdc/kpasswdd.c
   branches/SAMBA_4_0/source/ldap_server/ldap_server.c
   branches/SAMBA_4_0/source/lib/ldb-samba/ldif_handlers.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/kdc/kdc.c
===================================================================
--- branches/SAMBA_4_0/source/kdc/kdc.c 2007-10-06 21:39:52 UTC (rev 25547)
+++ branches/SAMBA_4_0/source/kdc/kdc.c 2007-10-06 21:42:58 UTC (rev 25548)
@@ -51,7 +51,7 @@
        DATA_BLOB packet;
 };
 
-typedef BOOL (*kdc_process_fn_t)(struct kdc_server *kdc,
+typedef bool (*kdc_process_fn_t)(struct kdc_server *kdc,
                                 TALLOC_CTX *mem_ctx, 
                                 DATA_BLOB *input, 
                                 DATA_BLOB *reply,
@@ -311,7 +311,7 @@
    calling conventions
 */
 
-static BOOL kdc_process(struct kdc_server *kdc,
+static bool kdc_process(struct kdc_server *kdc,
                        TALLOC_CTX *mem_ctx, 
                        DATA_BLOB *input, 
                        DATA_BLOB *reply,
@@ -337,7 +337,7 @@
                                            datagram_reply);
        if (ret == -1) {
                *reply = data_blob(NULL, 0);
-               return False;
+               return false;
        }
        if (k5_reply.length) {
                *reply = data_blob_talloc(mem_ctx, k5_reply.data, 
k5_reply.length);
@@ -345,7 +345,7 @@
        } else {
                *reply = data_blob(NULL, 0);    
        }
-       return True;
+       return true;
 }
 
 /*

Modified: branches/SAMBA_4_0/source/kdc/kpasswdd.c
===================================================================
--- branches/SAMBA_4_0/source/kdc/kpasswdd.c    2007-10-06 21:39:52 UTC (rev 
25547)
+++ branches/SAMBA_4_0/source/kdc/kpasswdd.c    2007-10-06 21:42:58 UTC (rev 
25548)
@@ -51,7 +51,7 @@
 };
 
 /* Return true if there is a valid error packet formed in the error_blob */
-static BOOL kpasswdd_make_error_reply(struct kdc_server *kdc, 
+static bool kpasswdd_make_error_reply(struct kdc_server *kdc, 
                                     TALLOC_CTX *mem_ctx, 
                                     uint16_t result_code, 
                                     const char *error_string, 
@@ -64,33 +64,33 @@
 
        len = push_utf8_talloc(mem_ctx, &error_string_utf8, error_string);
        if (len == -1) {
-               return False;
+               return false;
        }
 
        *error_blob = data_blob_talloc(mem_ctx, NULL, 2 + len + 1);
        if (!error_blob->data) {
-               return False;
+               return false;
        }
        RSSVAL(error_blob->data, 0, result_code);
        memcpy(error_blob->data + 2, error_string_utf8, len + 1);
-       return True;
+       return true;
 }
 
 /* Return true if there is a valid error packet formed in the error_blob */
-static BOOL kpasswdd_make_unauth_error_reply(struct kdc_server *kdc, 
+static bool kpasswdd_make_unauth_error_reply(struct kdc_server *kdc, 
                                            TALLOC_CTX *mem_ctx, 
                                            uint16_t result_code, 
                                            const char *error_string, 
                                            DATA_BLOB *error_blob) 
 {
-       BOOL ret;
+       bool ret;
        int kret;
        DATA_BLOB error_bytes;
        krb5_data k5_error_bytes, k5_error_blob;
        ret = kpasswdd_make_error_reply(kdc, mem_ctx, result_code, 
error_string, 
                                       &error_bytes);
        if (!ret) {
-               return False;
+               return false;
        }
        k5_error_bytes.data = error_bytes.data;
        k5_error_bytes.length = error_bytes.length;
@@ -98,17 +98,17 @@
                             result_code, NULL, &k5_error_bytes, 
                             NULL, NULL, NULL, NULL, &k5_error_blob);
        if (kret) {
-               return False;
+               return false;
        }
        *error_blob = data_blob_talloc(mem_ctx, k5_error_blob.data, 
k5_error_blob.length);
        krb5_data_free(&k5_error_blob);
        if (!error_blob->data) {
-               return False;
+               return false;
        }
-       return True;
+       return true;
 }
 
-static BOOL kpasswd_make_pwchange_reply(struct kdc_server *kdc, 
+static bool kpasswd_make_pwchange_reply(struct kdc_server *kdc, 
                                        TALLOC_CTX *mem_ctx, 
                                        NTSTATUS status, 
                                        enum samr_RejectReason reject_reason,
@@ -169,7 +169,7 @@
    Return true if there is a valid error packet (or sucess) formed in
    the error_blob
 */
-static BOOL kpasswdd_change_password(struct kdc_server *kdc,
+static bool kpasswdd_change_password(struct kdc_server *kdc,
                                     TALLOC_CTX *mem_ctx, 
                                     struct auth_session_info *session_info,
                                     const char *password,
@@ -197,7 +197,7 @@
        status = samdb_set_password_sid(samdb, mem_ctx, 
                                        session_info->security_token->user_sid,
                                        password, NULL, NULL, 
-                                       True, /* this is a user password change 
*/
+                                       true, /* this is a user password change 
*/
                                        &reject_reason,
                                        &dominfo);
        return kpasswd_make_pwchange_reply(kdc, mem_ctx, 
@@ -208,7 +208,7 @@
 
 }
 
-static BOOL kpasswd_process_request(struct kdc_server *kdc,
+static bool kpasswd_process_request(struct kdc_server *kdc,
                                    TALLOC_CTX *mem_ctx, 
                                    struct gensec_security *gensec_security,
                                    uint16_t version,
@@ -229,7 +229,7 @@
        {
                char *password = talloc_strndup(mem_ctx, (const char 
*)input->data, input->length);
                if (!password) {
-                       return False;
+                       return false;
                }
                return kpasswdd_change_password(kdc, mem_ctx, session_info, 
                                                password, reply);
@@ -256,7 +256,7 @@
 
                msg = ldb_msg_new(mem_ctx);
                if (!msg) {
-                       return False;
+                       return false;
                }
 
                ret = decode_ChangePasswdDataMS(input->data, input->length,
@@ -273,7 +273,7 @@
                                          chpw.newpasswd.length);
                if (!password) {
                        free_ChangePasswdDataMS(&chpw);
-                       return False;
+                       return false;
                }
                if ((chpw.targname && !chpw.targrealm) 
                    || (!chpw.targname && chpw.targrealm)) {
@@ -362,7 +362,7 @@
                        status = samdb_set_password(samdb, mem_ctx,
                                                    set_password_on_dn, NULL,
                                                    msg, password, NULL, NULL, 
-                                                   False, /* this is not a 
user password change */
+                                                   false, /* this is not a 
user password change */
                                                    &reject_reason, &dominfo);
                }
 
@@ -401,10 +401,10 @@
                                                                 version),
                                                 reply);
        }
-       return True;
+       return true;
 }
 
-BOOL kpasswdd_process(struct kdc_server *kdc,
+bool kpasswdd_process(struct kdc_server *kdc,
                      TALLOC_CTX *mem_ctx, 
                      DATA_BLOB *input, 
                      DATA_BLOB *reply,
@@ -412,7 +412,7 @@
                      struct socket_address *my_addr,
                      int datagram_reply)
 {
-       BOOL ret;
+       bool ret;
        const uint16_t header_len = 6;
        uint16_t len;
        uint16_t ap_req_len;
@@ -428,20 +428,20 @@
        TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
        
        if (!tmp_ctx) {
-               return False;
+               return false;
        }
 
        /* Be parinoid.  We need to ensure we don't just let the
         * caller lead us into a buffer overflow */
        if (input->length <= header_len) {
                talloc_free(tmp_ctx);
-               return False;
+               return false;
        }
 
        len = RSVAL(input->data, 0);
        if (input->length != len) {
                talloc_free(tmp_ctx);
-               return False;
+               return false;
        }
 
        /* There are two different versions of this protocol so far,
@@ -451,7 +451,7 @@
        ap_req_len = RSVAL(input->data, 4);
        if ((ap_req_len >= len) || (ap_req_len + header_len) >= len) {
                talloc_free(tmp_ctx);
-               return False;
+               return false;
        }
        
        krb_priv_len = len - ap_req_len;
@@ -461,13 +461,13 @@
        nt_status = gensec_server_start(tmp_ctx, kdc->task->event_ctx, 
kdc->task->msg_ctx, &gensec_security);
        if (!NT_STATUS_IS_OK(nt_status)) {
                talloc_free(tmp_ctx);
-               return False;
+               return false;
        }
 
        server_credentials = cli_credentials_init(tmp_ctx);
        if (!server_credentials) {
                DEBUG(1, ("Failed to init server credentials\n"));
-               return False;
+               return false;
        }
 
        /* We want the credentials subsystem to use the krb5 context
@@ -493,7 +493,7 @@
        nt_status = gensec_set_credentials(gensec_security, server_credentials);
        if (!NT_STATUS_IS_OK(nt_status)) {
                talloc_free(tmp_ctx);
-               return False;
+               return false;
        }
 
        /* The kerberos PRIV packets include these addresses.  MIT
@@ -501,12 +501,12 @@
        nt_status = gensec_set_peer_addr(gensec_security, peer_addr);
        if (!NT_STATUS_IS_OK(nt_status)) {
                talloc_free(tmp_ctx);
-               return False;
+               return false;
        }
        nt_status = gensec_set_my_addr(gensec_security, my_addr);
        if (!NT_STATUS_IS_OK(nt_status)) {
                talloc_free(tmp_ctx);
-               return False;
+               return false;
        }
 
        /* We want the GENSEC wrap calls to generate PRIV tokens */
@@ -515,7 +515,7 @@
        nt_status = gensec_start_mech_by_name(gensec_security, "krb5");
        if (!NT_STATUS_IS_OK(nt_status)) {
                talloc_free(tmp_ctx);
-               return False;
+               return false;
        }
 
        /* Accept the AP-REQ and generate teh AP-REP we need for the reply */
@@ -560,7 +560,7 @@
                                      &kpasswd_req, &kpasswd_rep); 
        if (!ret) {
                /* Argh! */
-               return False;
+               return false;
        }
 
        /* And wrap up the reply: This ensures that the error message
@@ -585,7 +585,7 @@
 reply:
        *reply = data_blob_talloc(mem_ctx, NULL, krb_priv_rep.length + 
ap_rep.length + header_len);
        if (!reply->data) {
-               return False;
+               return false;
        }
 
        RSSVAL(reply->data, 0, reply->length);

Modified: branches/SAMBA_4_0/source/ldap_server/ldap_server.c
===================================================================
--- branches/SAMBA_4_0/source/ldap_server/ldap_server.c 2007-10-06 21:39:52 UTC 
(rev 25547)
+++ branches/SAMBA_4_0/source/ldap_server/ldap_server.c 2007-10-06 21:42:58 UTC 
(rev 25548)
@@ -369,7 +369,7 @@
                conn->sockets.tls = tls_socket;
 
        } else if (port == 3268) /* Global catalog */ {
-               conn->global_catalog = True;
+               conn->global_catalog = true;
        }
        conn->packet = packet_init(conn);
        if (conn->packet == NULL) {

Modified: branches/SAMBA_4_0/source/lib/ldb-samba/ldif_handlers.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb-samba/ldif_handlers.c     2007-10-06 
21:39:52 UTC (rev 25547)
+++ branches/SAMBA_4_0/source/lib/ldb-samba/ldif_handlers.c     2007-10-06 
21:42:58 UTC (rev 25548)
@@ -81,10 +81,10 @@
 static bool ldb_comparision_objectSid_isString(const struct ldb_val *v)
 {
        if (v->length < 3) {
-               return False;
+               return false;
        }
 
-       if (strncmp("S-", (const char *)v->data, 2) != 0) return False;
+       if (strncmp("S-", (const char *)v->data, 2) != 0) return false;
        
        return true;
 }
@@ -181,14 +181,14 @@
        struct GUID guid;
        NTSTATUS status;
 
-       if (v->length < 33) return False;
+       if (v->length < 33) return false;
 
        /* see if the input if null-terninated (safety check for the below) */
-       if (v->data[v->length] != '\0') return False;
+       if (v->data[v->length] != '\0') return false;
 
        status = GUID_from_string((const char *)v->data, &guid);
        if (!NT_STATUS_IS_OK(status)) {
-               return False;
+               return false;
        }
 
        return true;

Reply via email to