Lines Matching defs:st

550 atf_fs_stat_init(atf_fs_stat_t *st, const atf_fs_path_t *p)
555 if (lstat(pstr, &st->m_sb) == -1) {
559 int type = st->m_sb.st_mode & S_IFMT;
562 case S_IFBLK: st->m_type = atf_fs_stat_blk_type; break;
563 case S_IFCHR: st->m_type = atf_fs_stat_chr_type; break;
564 case S_IFDIR: st->m_type = atf_fs_stat_dir_type; break;
565 case S_IFIFO: st->m_type = atf_fs_stat_fifo_type; break;
566 case S_IFLNK: st->m_type = atf_fs_stat_lnk_type; break;
567 case S_IFREG: st->m_type = atf_fs_stat_reg_type; break;
568 case S_IFSOCK: st->m_type = atf_fs_stat_sock_type; break;
570 case S_IFWHT: st->m_type = atf_fs_stat_wht_type; break;
588 atf_fs_stat_fini(atf_fs_stat_t *st ATF_DEFS_ATTRIBUTE_UNUSED)
597 atf_fs_stat_get_device(const atf_fs_stat_t *st)
599 return st->m_sb.st_dev;
603 atf_fs_stat_get_inode(const atf_fs_stat_t *st)
605 return st->m_sb.st_ino;
609 atf_fs_stat_get_mode(const atf_fs_stat_t *st)
611 return st->m_sb.st_mode & ~S_IFMT;
615 atf_fs_stat_get_size(const atf_fs_stat_t *st)
617 return st->m_sb.st_size;
621 atf_fs_stat_get_type(const atf_fs_stat_t *st)
623 return st->m_type;
627 atf_fs_stat_is_owner_readable(const atf_fs_stat_t *st)
629 return st->m_sb.st_mode & S_IRUSR;
633 atf_fs_stat_is_owner_writable(const atf_fs_stat_t *st)
635 return st->m_sb.st_mode & S_IWUSR;
639 atf_fs_stat_is_owner_executable(const atf_fs_stat_t *st)
641 return st->m_sb.st_mode & S_IXUSR;
645 atf_fs_stat_is_group_readable(const atf_fs_stat_t *st)
647 return st->m_sb.st_mode & S_IRGRP;
651 atf_fs_stat_is_group_writable(const atf_fs_stat_t *st)
653 return st->m_sb.st_mode & S_IWGRP;
657 atf_fs_stat_is_group_executable(const atf_fs_stat_t *st)
659 return st->m_sb.st_mode & S_IXGRP;
663 atf_fs_stat_is_other_readable(const atf_fs_stat_t *st)
665 return st->m_sb.st_mode & S_IROTH;
669 atf_fs_stat_is_other_writable(const atf_fs_stat_t *st)
671 return st->m_sb.st_mode & S_IWOTH;
675 atf_fs_stat_is_other_executable(const atf_fs_stat_t *st)
677 return st->m_sb.st_mode & S_IXOTH;
698 struct stat st;
704 if (lstat(atf_fs_path_cstring(p), &st) == -1) {
724 if (!ok && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) {
730 if (!ok && (atf_user_euid() == st.st_uid)) {
731 ok = ((mode & atf_fs_access_r) && (st.st_mode & S_IRUSR)) ||
732 ((mode & atf_fs_access_w) && (st.st_mode & S_IWUSR)) ||
733 ((mode & atf_fs_access_x) && (st.st_mode & S_IXUSR));
735 if (!ok && atf_user_is_member_of_group(st.st_gid)) {
736 ok = ((mode & atf_fs_access_r) && (st.st_mode & S_IRGRP)) ||
737 ((mode & atf_fs_access_w) && (st.st_mode & S_IWGRP)) ||
738 ((mode & atf_fs_access_x) && (st.st_mode & S_IXGRP));
740 if (!ok && ((atf_user_euid() != st.st_uid) &&
741 !atf_user_is_member_of_group(st.st_gid))) {
742 ok = ((mode & atf_fs_access_r) && (st.st_mode & S_IROTH)) ||
743 ((mode & atf_fs_access_w) && (st.st_mode & S_IWOTH)) ||
744 ((mode & atf_fs_access_x) && (st.st_mode & S_IXOTH));