Changeset 148 for trunk/lib/winsec.c
- Timestamp:
- 02/22/09 18:22:59 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/winsec.c
r147 r148 55 55 if (buf == NULL || buf_len < WINSEC_DESC_HEADER_SIZE) 56 56 return NULL; 57 /* 58 if((ret_val = (WINSEC_DESC*)zalloc(sizeof(WINSEC_DESC))) == NULL) 59 return NULL; 60 */ 57 61 58 if((ret_val = talloc(talloc_ctx, WINSEC_DESC)) == NULL) 62 59 return NULL; … … 86 83 } 87 84 88 if(ret_val->off_owner_sid != 0) 85 if(ret_val->off_owner_sid == 0) 86 ret_val->owner_sid = NULL; 87 else 89 88 { 90 89 ret_val->owner_sid = winsec_parse_dom_sid(ret_val, … … 98 97 } 99 98 100 if (ret_val->off_grp_sid != 0) 99 if(ret_val->off_grp_sid == 0) 100 ret_val->grp_sid = NULL; 101 else 101 102 { 102 103 ret_val->grp_sid = winsec_parse_dom_sid(ret_val, buf + ret_val->off_grp_sid, … … 109 110 } 110 111 111 if 112 if((ret_val->control & WINSEC_DESC_SACL_PRESENT) && ret_val->off_sacl) 112 113 { 113 114 ret_val->sacl = winsec_parse_acl(ret_val, buf + ret_val->off_sacl, … … 119 120 } 120 121 } 121 122 if ((ret_val->control & WINSEC_DESC_DACL_PRESENT) && ret_val->off_dacl != 0) 122 else 123 ret_val->sacl = NULL; 124 125 if((ret_val->control & WINSEC_DESC_DACL_PRESENT) && ret_val->off_dacl != 0) 123 126 { 124 127 ret_val->dacl = winsec_parse_acl(ret_val, buf + ret_val->off_dacl, … … 130 133 } 131 134 } 135 else 136 ret_val->dacl = NULL; 132 137 133 138 return ret_val; … … 150 155 if (buf == NULL || buf_len < 8) 151 156 return NULL; 152 /* 153 if((ret_val = (WINSEC_ACL*)zalloc(sizeof(WINSEC_ACL))) == NULL) 154 return NULL; 155 */ 157 156 158 if((ret_val = talloc(talloc_ctx, WINSEC_ACL)) == NULL) 157 159 return NULL; … … 175 177 * (allow no access). 176 178 */ 177 /* if((ret_val->aces = (WINSEC_ACE**)zcalloc(sizeof(WINSEC_ACE*),178 ret_val->num_aces+1)) == NULL)179 */180 179 if((ret_val->aces = talloc_array(ret_val, WINSEC_ACE*, 181 180 ret_val->num_aces+1)) == NULL) … … 203 202 } 204 203 } 204 ret_val->aces[ret_val->num_aces] = NULL; 205 205 206 206 return ret_val; … … 219 219 if(buf == NULL || buf_len < WINSEC_ACE_MIN_SIZE) 220 220 return NULL; 221 222 /* if((ret_val = (WINSEC_ACE*)zalloc(sizeof(WINSEC_ACE))) == NULL)*/223 221 224 222 if((ret_val = talloc(talloc_ctx, WINSEC_ACE)) == NULL) … … 249 247 offset += sizeof(WINSEC_UUID); 250 248 } 249 else 250 ret_val->obj_guid = NULL; 251 251 252 252 if(ret_val->obj_flags & WINSEC_ACE_OBJECT_INHERITED_PRESENT) … … 261 261 offset += sizeof(WINSEC_UUID); 262 262 } 263 else 264 ret_val->inh_guid = NULL; 263 265 } 264 266 … … 322 324 return false; 323 325 324 /* if((ret_val = (WINSEC_UUID*)zalloc(sizeof(WINSEC_UUID))) == NULL)*/325 326 if((ret_val = talloc(talloc_ctx, WINSEC_UUID)) == NULL) 326 327 return NULL;
Note: See TracChangeset
for help on using the changeset viewer.