Lines Matching defs:sid
45 * Returns the number of bytes required to hold the sid.
48 sid_len(sid_t *sid)
50 if (sid == NULL)
54 + (sid->sid_subauthcnt * sizeof (uint32_t)));
61 * binary sid.
64 sid_tostr(sid_t *sid, char *strsid)
69 if (sid == NULL || strsid == NULL)
72 (void) sprintf(p, "S-%d-", sid->sid_revision);
77 if (sid->sid_authority[i] != 0 || i == NT_SID_AUTH_MAX - 1) {
78 (void) sprintf(p, "%d", sid->sid_authority[i]);
84 for (i = 0; i < sid->sid_subauthcnt && i < NT_SID_SUBAUTH_MAX; ++i) {
85 (void) sprintf(p, "-%u", sid->sid_subauth[i]);
108 sid_t *sid;
121 if ((sid = malloc(size)) == NULL)
124 bzero(sid, size);
125 sid->sid_revision = NT_SID_REVISION;
126 sid->sid_authority[5] = atoi(&sidstr[4]);
133 free(sid);
137 sid->sid_subauth[i] = strtoul(p, NULL, 10);
143 sid->sid_subauthcnt = i;
144 return (sid);
148 sid_free(sid_t *sid)
151 if (sid == NULL)
154 kmem_free(sid, sid_len(sid));
156 free(sid);
161 sid_to_le(sid_t *sid)
165 for (i = 0; i < sid->sid_subauthcnt && i < NT_SID_SUBAUTH_MAX; ++i) {
166 uint32_t v = sid->sid_subauth[i];
167 uint8_t *p = (uint8_t *)&sid->sid_subauth[i];
177 sid_from_le(sid_t *sid)
181 for (i = 0; i < sid->sid_subauthcnt && i < NT_SID_SUBAUTH_MAX; ++i) {
183 uint8_t *p = (uint8_t *)&sid->sid_subauth[i];
187 sid->sid_subauth[i] = v;