Lines Matching defs:sd
60 smb_sd_init(smb_sd_t *sd, uint8_t revision)
62 bzero(sd, sizeof (smb_sd_t));
63 sd->sd_revision = revision;
69 * Free non-NULL members of 'sd' which has to be in
73 smb_sd_term(smb_sd_t *sd)
75 assert(sd);
76 assert((LE_IN16(&sd->sd_control) & SE_SELF_RELATIVE) == 0);
78 smb_sid_free(sd->sd_owner);
79 smb_sid_free(sd->sd_group);
80 smb_acl_free(sd->sd_dacl);
81 smb_acl_free(sd->sd_sacl);
83 bzero(sd, sizeof (smb_sd_t));
87 smb_sd_len(smb_sd_t *sd, uint32_t secinfo)
92 length += smb_sid_len(sd->sd_owner);
95 length += smb_sid_len(sd->sd_group);
98 length += smb_acl_len(sd->sd_dacl);
101 length += smb_acl_len(sd->sd_sacl);
113 smb_sd_get_secinfo(smb_sd_t *sd)
117 if (sd == NULL)
120 if (sd->sd_owner)
123 if (sd->sd_group)
126 if (sd->sd_dacl)
129 if (sd->sd_sacl)
199 smb_sd_read(smb_share_t *si, smb_sd_t *sd, uint32_t secinfo)
215 status = smb_sd_fromfs(&fs_sd, sd);
255 smb_sd_write(smb_share_t *si, smb_sd_t *sd, uint32_t secinfo)
265 error = smb_sd_tofs(sd, &fs_sd);
284 smb_sd_tofs(smb_sd_t *sd, smb_fssd_t *fs_sd)
293 sd_control = sd->sd_control;
311 sid = sd->sd_owner;
324 sid = sd->sd_group;
337 if (sd->sd_control & SE_DACL_PRESENT) {
338 status = smb_acl_to_zfs(sd->sd_dacl, flags,
349 if (sd->sd_control & SE_SACL_PRESENT) {
350 status = smb_acl_to_zfs(sd->sd_sacl, flags,
369 * Should call smb_sd_term() for the returned sd to free allocated
373 smb_sd_fromfs(smb_fssd_t *fs_sd, smb_sd_t *sd)
381 assert(sd);
383 smb_sd_init(sd, SECURITY_DESCRIPTOR_REVISION);
391 smb_sd_term(sd);
395 sd->sd_owner = sid;
404 smb_sd_term(sd);
408 sd->sd_group = sid;
416 smb_sd_term(sd);
426 smb_sd_set_dacl(sd, acl, B_TRUE,
429 smb_sd_set_dacl(sd, NULL, B_FALSE, 0);
438 smb_sd_term(sd);
442 smb_sd_set_sacl(sd, acl, B_TRUE,
445 smb_sd_set_sacl(sd, NULL, B_FALSE, 0);
453 smb_sd_set_dacl(smb_sd_t *sd, smb_acl_t *acl, boolean_t present, int flags)
455 assert((sd->sd_control & SE_SELF_RELATIVE) == 0);
457 sd->sd_dacl = acl;
460 sd->sd_control |= SE_DACL_DEFAULTED;
462 sd->sd_control |= SE_DACL_AUTO_INHERITED;
464 sd->sd_control |= SE_DACL_PROTECTED;
467 sd->sd_control |= SE_DACL_PRESENT;
471 smb_sd_set_sacl(smb_sd_t *sd, smb_acl_t *acl, boolean_t present, int flags)
473 assert((sd->sd_control & SE_SELF_RELATIVE) == 0);
475 sd->sd_sacl = acl;
478 sd->sd_control |= SE_SACL_DEFAULTED;
480 sd->sd_control |= SE_SACL_AUTO_INHERITED;
482 sd->sd_control |= SE_SACL_PROTECTED;
485 sd->sd_control |= SE_SACL_PRESENT;