s3-dom_sid Use C99 types in dom_sid handling
authorAndrew Bartlett <abartlet@samba.org>
Sat, 4 Sep 2010 04:04:55 +0000 (14:04 +1000)
committerJeremy Allison <jra@samba.org>
Tue, 14 Sep 2010 21:48:48 +0000 (14:48 -0700)
Andrew Bartlett

source3/lib/util_sid.c

index 4e0ddd2e491409eaf101d159ba6639e87f1a7f42..58df0f2a486175e43b9f9a93fac22d62050b990e 100644 (file)
@@ -203,7 +203,7 @@ bool string_to_sid(struct dom_sid *sidout, const char *sidstr)
        const char *p;
        char *q;
        /* BIG NOTE: this function only does SIDS where the identauth is not >= 2^32 */
-       uint32 conv;
+       uint32_t conv;
 
        if ((sidstr[0] != 'S' && sidstr[0] != 's') || sidstr[1] != '-') {
                goto format_error;
@@ -218,11 +218,11 @@ bool string_to_sid(struct dom_sid *sidout, const char *sidstr)
                goto format_error;
        }
 
-       conv = (uint32) strtoul(p, &q, 10);
+       conv = (uint32_t) strtoul(p, &q, 10);
        if (!q || (*q != '-')) {
                goto format_error;
        }
-       sidout->sid_rev_num = (uint8) conv;
+       sidout->sid_rev_num = (uint8_t) conv;
        q++;
 
        if (!isdigit(*q)) {
@@ -230,8 +230,8 @@ bool string_to_sid(struct dom_sid *sidout, const char *sidstr)
        }
 
        /* get identauth */
-       conv = (uint32) strtoul(q, &q, 10);
        if (!q || (*q != '-')) {
+       conv = (uint32_t) strtoul(q, &q, 10);
                goto format_error;
        }
        /* identauth in decimal should be <  2^32 */
@@ -283,13 +283,13 @@ format_error:
  Add a rid to the end of a sid
 *****************************************************************/  
 
-bool sid_append_rid(struct dom_sid *sid, uint32 rid)
+bool sid_append_rid(struct dom_sid *sid, uint32_t rid)
 {
        if (sid->num_auths < MAXSUBAUTHS) {
                sid->sub_auths[sid->num_auths++] = rid;
-               return True;
+               return true;
        }
-       return False;
+       return false;
 }
 
 bool sid_compose(struct dom_sid *dst, const struct dom_sid *domain_sid, uint32 rid)