Lines Matching defs:sid

218  * @sid:	[IN]  SID for which to determine the maximum string size
221 * store the standard textual representation of the SID pointed to by @sid.
227 int ntfs_sid_to_mbs_size(const SID *sid)
231 if (!ntfs_sid_is_valid(sid)) {
250 if (!sid->identifier_authority.high_part)
258 size += (1 + 10) * sid->sub_authority_count;
266 * @sid: [IN] SID to convert
270 * Convert the SID pointed to by @sid to its standard textual representation.
294 char *ntfs_sid_to_mbs(const SID *sid, char *sid_str, size_t sid_str_size)
302 * No need to check @sid if !@sid_str since ntfs_sid_to_mbs_size() will
303 * check @sid, too. 8 is the minimum SID string size.
305 if (sid_str && (sid_str_size < 8 || !ntfs_sid_is_valid(sid))) {
311 cnt = ntfs_sid_to_mbs_size(sid);
325 i = snprintf(s, cnt, "S-%hhu-", (unsigned char)sid->revision);
332 u += (u64)sid->identifier_authority.value[i] << j;
333 if (!sid->identifier_authority.high_part)
342 for (j = 0; j < sid->sub_authority_count; j++) {
343 leauth = sid->sub_authority[j];
3186 SID *sid;
3204 sid = (SID*)((u8*)sd + sizeof(SECURITY_DESCRIPTOR_ATTR));
3205 sid->revision = SID_REVISION;
3206 sid->sub_authority_count = 2;
3207 sid->sub_authority[0] = const_cpu_to_le32(SECURITY_BUILTIN_DOMAIN_RID);
3208 sid->sub_authority[1] = const_cpu_to_le32(DOMAIN_ALIAS_RID_ADMINS);
3209 sid->identifier_authority.value[5] = 5;
3210 sd->owner = cpu_to_le32((u8*)sid - (u8*)sd);
3212 sid = (SID*)((u8*)sid + sizeof(SID) + 4);
3213 sid->revision = SID_REVISION;
3214 sid->sub_authority_count = 2;
3215 sid->sub_authority[0] = const_cpu_to_le32(SECURITY_BUILTIN_DOMAIN_RID);
3216 sid->sub_authority[1] = const_cpu_to_le32(DOMAIN_ALIAS_RID_ADMINS);
3217 sid->identifier_authority.value[5] = 5;
3218 sd->group = cpu_to_le32((u8*)sid - (u8*)sd);
3220 acl = (ACL*)((u8*)sid + sizeof(SID) + 4);
3231 ace->sid.revision = SID_REVISION;
3232 ace->sid.sub_authority_count = 1;
3233 ace->sid.sub_authority[0] = const_cpu_to_le32(0);
3234 ace->sid.identifier_authority.value[5] = 1;
3477 /* or reuse old gid and sid for cacheing */
3597 /* or reuse old gid and sid for cacheing */
3903 SID *sid;
3909 sid = (SID*)ntfs_malloc(sidsz);
3910 if (sid) {
3911 memcpy(sid,usid,sidsz);
3916 usermapping->sid = sid;
3919 groupmapping->sid = sid;
3949 if (ntfs_same_sid(mapping1->sid,mapping2->sid)) {
3958 if (ntfs_same_sid(mapping1->sid,mapping2->sid)) {