Lines Matching refs:si

387 smb_shr_add(smb_share_t *si)
395 assert(si != NULL);
397 if (smb_name_validate_share(si->shr_name) != ERROR_SUCCESS)
403 cached_si = smb_shr_cache_findent(si->shr_name);
405 if (si->shr_flags & SMB_SHRF_AUTOHOME) {
415 if (STYPE_ISDSK(si->shr_type)) {
420 rc = stat(si->shr_path, &st);
427 if ((status = smb_shr_cache_addent(si)) != NERR_Success) {
435 if ((rc = smb_shr_encode(si, &shrlist)) == 0) {
441 smb_shr_publish(si->shr_name, si->shr_container);
444 smb_shr_zfs_add(si);
446 if ((si->shr_flags & SMB_SHRF_DFSROOT) != 0)
447 dfs_namespace_load(si->shr_name);
454 smb_shr_cache_delent(si->shr_name);
475 smb_share_t *si;
488 if ((si = smb_shr_cache_findent(sharename)) == NULL) {
493 if (STYPE_ISIPC(si->shr_type)) {
499 if (si->shr_flags & SMB_SHRF_AUTOHOME) {
500 if ((--si->shr_refcnt) > 0) {
510 smb_shr_zfs_remove(si);
511 (void) smb_shr_encode(si, &shrlist);
513 (void) strlcpy(container, si->shr_container, sizeof (container));
514 dfsroot = ((si->shr_flags & SMB_SHRF_DFSROOT) != 0);
609 smb_shr_get(char *sharename, smb_share_t *si)
616 if ((status = smb_shr_lookup(sharename, si)) == NERR_Success)
620 status = smb_shr_lookup(sharename, si);
636 smb_share_t *si;
647 if ((si = smb_shr_cache_findent(new_si->shr_name)) == NULL) {
652 if (STYPE_ISIPC(si->shr_type)) {
658 (void) strlcpy(si->shr_cmnt, new_si->shr_cmnt, sizeof (si->shr_cmnt));
660 adc_changed = (strcmp(new_si->shr_container, si->shr_container) != 0);
663 (void) strlcpy(old_container, si->shr_container,
665 (void) strlcpy(si->shr_container, new_si->shr_container,
666 sizeof (si->shr_container));
670 si->shr_flags &= ~SMB_SHRF_ABE;
671 si->shr_flags |= flag;
674 si->shr_flags &= ~SMB_SHRF_CATIA;
675 si->shr_flags |= flag;
678 si->shr_flags &= ~SMB_SHRF_GUEST_OK;
679 si->shr_flags |= flag;
682 si->shr_flags &= ~SMB_SHRF_DFSROOT;
683 si->shr_flags |= flag;
686 si->shr_flags &= ~SMB_SHRF_CSC_MASK;
687 si->shr_flags |= flag;
690 si->shr_flags &= ~SMB_SHRF_ACC_ALL;
691 si->shr_flags |= access;
694 (void) strlcpy(si->shr_access_none, new_si->shr_access_none,
695 sizeof (si->shr_access_none));
698 (void) strlcpy(si->shr_access_ro, new_si->shr_access_ro,
699 sizeof (si->shr_access_ro));
702 (void) strlcpy(si->shr_access_rw, new_si->shr_access_rw,
703 sizeof (si->shr_access_rw));
707 if (smb_shr_encode(si, &shrlist) == 0) {
993 smb_share_t *si;
999 while ((si = smb_shr_iterate(&iterator)) != NULL) {
1003 if ((si->shr_flags & SMB_SHRF_TRANS) &&
1004 (!STYPE_ISIPC(si->shr_type))) {
1005 bcopy(si, &list->sl_shares[n], sizeof (smb_share_t));
1026 smb_share_t si;
1028 if (smb_shr_get(subs->e_sharename, &si) != 0)
1093 if (smb_shr_expand_subs(cmd_tokens, &si, subs) != 0) {
1157 * the info in 'si'
1160 smb_shr_lookup(char *sharename, smb_share_t *si)
1170 bcopy(cached_si, si, sizeof (smb_share_t));
1379 smb_shr_cache_addent(smb_share_t *si)
1387 (void) smb_strlwr(si->shr_name);
1389 si->shr_type |= smb_shr_is_special(cache_ent->shr_name);
1392 si->shr_flags |= SMB_SHRF_ADMIN;
1394 bcopy(si, cache_ent, sizeof (smb_share_t));
1396 if (si->shr_flags & SMB_SHRF_AUTOHOME)
1534 smb_share_t si;
1548 if ((status = smb_shr_sa_get(share, resource, &si)) != NERR_Success) {
1550 si.shr_name, status);
1554 status = smb_shr_add(&si);
1557 si.shr_name, status);
1584 smb_shr_sa_get(sa_share_t share, sa_resource_t resource, smb_share_t *si)
1599 bzero(si, sizeof (smb_share_t));
1600 si->shr_flags = SMB_SHRF_PERM;
1602 (void) strlcpy(si->shr_path, path, sizeof (si->shr_path));
1603 (void) strlcpy(si->shr_name, rname, sizeof (si->shr_name));
1612 (void) strlcpy(si->shr_cmnt, val, sizeof (si->shr_cmnt));
1622 (void) strlcpy(si->shr_container, val,
1623 sizeof (si->shr_container));
1629 smb_shr_sa_setflag(val, si, SMB_SHRF_CATIA);
1635 smb_shr_sa_setflag(val, si, SMB_SHRF_ABE);
1641 smb_shr_sa_setflag(val, si, SMB_SHRF_GUEST_OK);
1647 smb_shr_sa_setflag(val, si, SMB_SHRF_DFSROOT);
1653 smb_shr_sa_csc_option(val, si);
1659 (void) strlcpy(si->shr_access_none, val,
1660 sizeof (si->shr_access_none));
1662 si->shr_flags |= SMB_SHRF_ACC_NONE;
1667 (void) strlcpy(si->shr_access_ro, val,
1668 sizeof (si->shr_access_ro));
1670 si->shr_flags |= SMB_SHRF_ACC_RO;
1675 (void) strlcpy(si->shr_access_rw, val,
1676 sizeof (si->shr_access_rw));
1678 si->shr_flags |= SMB_SHRF_ACC_RW;
1696 smb_shr_sa_csc_option(const char *value, smb_share_t *si)
1702 si->shr_flags |= cscopt[i].flag;
1707 switch (si->shr_flags & SMB_SHRF_CSC_MASK) {
1717 si->shr_flags & SMB_SHRF_CSC_MASK);
1727 smb_shr_sa_csc_name(const smb_share_t *si)
1732 if (si->shr_flags & cscopt[i].flag)
1744 smb_shr_sa_setflag(const char *value, smb_share_t *si, uint32_t flag)
1747 si->shr_flags |= flag;
1749 si->shr_flags &= ~flag;
2030 smb_shr_zfs_add(smb_share_t *si)
2037 if (smb_getdataset(si->shr_path, buf, MAXPATHLEN) != 0)
2049 ret = zfs_smb_acl_add(libhd, buf, si->shr_path, si->shr_name);
2052 si->shr_name, strerror(errno));
2070 smb_shr_zfs_remove(smb_share_t *si)
2077 if (smb_getdataset(si->shr_path, buf, MAXPATHLEN) != 0)
2089 ret = zfs_smb_acl_remove(libhd, buf, si->shr_path, si->shr_name);
2092 si->shr_name, strerror(errno));
2231 smb_shr_expand_subs(char **cmd_toks, smb_share_t *si, smb_shr_execinfo_t *subs)
2311 ptr = strdup(si->shr_name);
2314 ptr = strdup(si->shr_path);
2372 smb_shr_encode(smb_share_t *si, nvlist_t **nvlist)
2397 rc |= nvlist_add_string(share, "name", si->shr_name);
2398 rc |= nvlist_add_string(share, "path", si->shr_path);
2399 rc |= nvlist_add_string(share, "desc", si->shr_cmnt);
2402 rc = nvlist_add_string(smb, SHOPT_AD_CONTAINER, si->shr_container);
2403 if ((si->shr_flags & SMB_SHRF_ACC_NONE) != 0)
2404 rc |= nvlist_add_string(smb, SHOPT_NONE, si->shr_access_none);
2405 if ((si->shr_flags & SMB_SHRF_ACC_RO) != 0)
2406 rc |= nvlist_add_string(smb, SHOPT_RO, si->shr_access_ro);
2407 if ((si->shr_flags & SMB_SHRF_ACC_RW) != 0)
2408 rc |= nvlist_add_string(smb, SHOPT_RW, si->shr_access_rw);
2410 if ((si->shr_flags & SMB_SHRF_ABE) != 0)
2412 if ((si->shr_flags & SMB_SHRF_CATIA) != 0)
2414 if ((si->shr_flags & SMB_SHRF_GUEST_OK) != 0)
2416 if ((si->shr_flags & SMB_SHRF_DFSROOT) != 0)
2419 if ((si->shr_flags & SMB_SHRF_AUTOHOME) != 0) {
2421 rc |= nvlist_add_uint32(smb, "uid", si->shr_uid);
2422 rc |= nvlist_add_uint32(smb, "gid", si->shr_gid);
2425 if ((csc = smb_shr_sa_csc_name(si)) != NULL)
2428 rc |= nvlist_add_uint32(smb, "type", si->shr_type);
2431 rc |= nvlist_add_nvlist(list, si->shr_name, share);