/netbsd/external/bsd/libarchive/dist/libarchive/test/ |
H A D | test_write_disk_perms.c | 170 assert((st.st_mode & 07777) != 0144); in DEFINE_TEST() 193 assertEqualInt(st.st_mode & 0777, 0744); in DEFINE_TEST() 204 assertEqualInt(st.st_mode & 0777, 0744); in DEFINE_TEST() 407 assertEqualInt(st.st_mode & 07777, 0755); in DEFINE_TEST() 411 assertEqualInt(st.st_mode & 07777, 0144); in DEFINE_TEST() 415 assertEqualInt(st.st_mode & 07777, 0514); in DEFINE_TEST() 419 assertEqualInt(st.st_mode & 0777, 0744); in DEFINE_TEST() 423 assertEqualInt(st.st_mode & 07777, 0755); in DEFINE_TEST() 427 assertEqualInt(st.st_mode & 07777, 0777); in DEFINE_TEST() 437 assertEqualInt(st.st_mode & 07777, 0742); in DEFINE_TEST() [all …]
|
H A D | test_write_disk_secure.c | 191 assert(S_ISLNK(st.st_mode)); in DEFINE_TEST() 213 assert(S_ISDIR(st.st_mode)); in DEFINE_TEST() 241 assert(S_ISDIR(st.st_mode)); in DEFINE_TEST() 273 assert((st.st_mode & 0777) == 0755); in DEFINE_TEST() 277 assert(S_ISLNK(st.st_mode)); in DEFINE_TEST() 281 assert((st.st_mode & 07777) == 0755); in DEFINE_TEST() 286 assert((st.st_mode & 07777) == 0755); in DEFINE_TEST() 293 assert(S_ISDIR(st.st_mode)); in DEFINE_TEST() 295 assert((st.st_mode & 0777) == 0755); in DEFINE_TEST() 298 assert(S_ISREG(st.st_mode)); in DEFINE_TEST() [all …]
|
/netbsd/external/mit/libuv/dist/test/ |
H A D | test-pipe-set-fchmod.c | 52 ASSERT(stat_buf.st_mode & S_IRUSR); in TEST_IMPL() 53 ASSERT(stat_buf.st_mode & S_IRGRP); in TEST_IMPL() 54 ASSERT(stat_buf.st_mode & S_IROTH); in TEST_IMPL() 61 ASSERT(stat_buf.st_mode & S_IWUSR); in TEST_IMPL() 62 ASSERT(stat_buf.st_mode & S_IWGRP); in TEST_IMPL() 63 ASSERT(stat_buf.st_mode & S_IWOTH); in TEST_IMPL() 70 ASSERT(stat_buf.st_mode & S_IRUSR); in TEST_IMPL() 71 ASSERT(stat_buf.st_mode & S_IRGRP); in TEST_IMPL() 72 ASSERT(stat_buf.st_mode & S_IROTH); in TEST_IMPL() 73 ASSERT(stat_buf.st_mode & S_IWUSR); in TEST_IMPL() [all …]
|
/netbsd/external/gpl2/xcvs/dist/src/ |
H A D | filesubr.c | 34 #define IS_DEVICE(sbp) (S_ISBLK((sbp)->st_mode) || S_ISCHR((sbp)->st_mode)) 66 mknod (to, sb.st_mode, sb.st_rdev); in copy_file() 134 return S_ISDIR (sb.st_mode); in isdir() 156 if (S_ISLNK (sbp->st_mode)) in islink() 294 if ((sb.st_mode & mask) == mask) in isaccessible() 392 mode = sb.st_mode | (~oumask in xchmod() 394 | ((sb.st_mode & S_IRGRP) ? S_IWGRP : 0) in xchmod() 477 else if (S_ISDIR (sb.st_mode)) in unlink_file_dir() 617 if ((sb1.st_mode & S_IFMT) != (sb2.st_mode & S_IFMT)) in xcmp() 623 if (S_ISLNK (sb1.st_mode) && S_ISLNK (sb2.st_mode)) in xcmp() [all …]
|
/netbsd/libexec/ftpd/ |
H A D | cmds.c | 243 if (! S_ISDIR(pdirstat.st_mode)) { in mlsd() 606 rok = ((fe->stat->st_mode & S_IRUSR) != 0); in fact_perm() 607 wok = ((fe->stat->st_mode & S_IWUSR) != 0); in fact_perm() 608 xok = ((fe->stat->st_mode & S_IXUSR) != 0); in fact_perm() 610 rok = ((fe->stat->st_mode & S_IRGRP) != 0); in fact_perm() 633 if (S_ISDIR(fe->stat->st_mode)) in fact_perm() 672 if (S_ISDIR(fe->stat->st_mode)) { in fact_perm() 694 if (xok && S_ISDIR(fe->stat->st_mode)) in fact_perm() 714 if (rok && S_ISREG(fe->stat->st_mode)) in fact_perm() 728 if (S_ISREG(fe->stat->st_mode)) in fact_size() [all …]
|
/netbsd/external/bsd/atf/dist/tools/ |
H A D | fs.cpp | 428 int type = m_sb.st_mode & S_IFMT; in file_info() 466 return m_sb.st_mode & ~S_IFMT; in get_mode() 487 return m_sb.st_mode & S_IRUSR; in is_owner_readable() 494 return m_sb.st_mode & S_IWUSR; in is_owner_writable() 501 return m_sb.st_mode & S_IXUSR; in is_owner_executable() 508 return m_sb.st_mode & S_IRGRP; in is_group_readable() 515 return m_sb.st_mode & S_IWGRP; in is_group_writable() 522 return m_sb.st_mode & S_IXGRP; in is_group_executable() 529 return m_sb.st_mode & S_IROTH; in is_other_readable() 536 return m_sb.st_mode & S_IWOTH; in is_other_writable() [all …]
|
/netbsd/external/gpl3/gdb/dist/gnulib/import/ |
H A D | rename.c | 99 if (errno != ENOENT || (!S_ISDIR (src_st.st_mode) && dst_slash)) in rpl_rename() 105 if (S_ISDIR (dst_st.st_mode) != S_ISDIR (src_st.st_mode)) in rpl_rename() 107 errno = S_ISDIR (dst_st.st_mode) ? EISDIR : ENOTDIR; in rpl_rename() 123 if (dst_exists && S_ISDIR (dst_st.st_mode)) in rpl_rename() 345 if (errno != ENOENT || (!S_ISDIR (src_st.st_mode) && dst_slash)) in rpl_rename() 351 if (S_ISDIR (dst_st.st_mode) != S_ISDIR (src_st.st_mode)) in rpl_rename() 353 errno = S_ISDIR (dst_st.st_mode) ? EISDIR : ENOTDIR; in rpl_rename() 400 if (S_ISLNK (src_st.st_mode)) in rpl_rename() 420 else if (S_ISLNK (dst_st.st_mode)) in rpl_rename() 434 if (dst_exists && S_ISDIR (dst_st.st_mode)) in rpl_rename()
|
/netbsd/external/gpl3/gdb.old/dist/gnulib/import/ |
H A D | rename.c | 99 if (errno != ENOENT || (!S_ISDIR (src_st.st_mode) && dst_slash)) in rpl_rename() 105 if (S_ISDIR (dst_st.st_mode) != S_ISDIR (src_st.st_mode)) in rpl_rename() 107 errno = S_ISDIR (dst_st.st_mode) ? EISDIR : ENOTDIR; in rpl_rename() 123 if (dst_exists && S_ISDIR (dst_st.st_mode)) in rpl_rename() 345 if (errno != ENOENT || (!S_ISDIR (src_st.st_mode) && dst_slash)) in rpl_rename() 351 if (S_ISDIR (dst_st.st_mode) != S_ISDIR (src_st.st_mode)) in rpl_rename() 353 errno = S_ISDIR (dst_st.st_mode) ? EISDIR : ENOTDIR; in rpl_rename() 400 if (S_ISLNK (src_st.st_mode)) in rpl_rename() 420 else if (S_ISLNK (dst_st.st_mode)) in rpl_rename() 434 if (dst_exists && S_ISDIR (dst_st.st_mode)) in rpl_rename()
|
/netbsd/external/bsd/atf/dist/atf-c/detail/ |
H A D | fs.c | 560 int type = st->m_sb.st_mode & S_IFMT; in atf_fs_stat_init() 612 return st->m_sb.st_mode & ~S_IFMT; in atf_fs_stat_get_mode() 630 return st->m_sb.st_mode & S_IRUSR; in atf_fs_stat_is_owner_readable() 636 return st->m_sb.st_mode & S_IWUSR; in atf_fs_stat_is_owner_writable() 642 return st->m_sb.st_mode & S_IXUSR; in atf_fs_stat_is_owner_executable() 648 return st->m_sb.st_mode & S_IRGRP; in atf_fs_stat_is_group_readable() 654 return st->m_sb.st_mode & S_IWGRP; in atf_fs_stat_is_group_writable() 660 return st->m_sb.st_mode & S_IXGRP; in atf_fs_stat_is_group_executable() 666 return st->m_sb.st_mode & S_IROTH; in atf_fs_stat_is_other_readable() 672 return st->m_sb.st_mode & S_IWOTH; in atf_fs_stat_is_other_writable() [all …]
|
/netbsd/bin/cp/ |
H A D | utils.c | 157 if (!(tolnk && S_ISLNK(sb.st_mode))) in copy_file() 161 fs->st_mode & ~(S_ISUID | S_ISGID)); in copy_file() 170 fs->st_mode & ~(S_ISUID | S_ISGID)); in copy_file() 185 bool need_copy = !S_ISREG(fs->st_mode) || fs->st_size > 0; in copy_file() 287 fchmod(to_fd, fs->st_mode & RETAINBITS & ~myumask)) { in copy_file() 332 if (mkfifo(to.p_path, from_stat->st_mode)) { in copy_fifo() 346 if (mknod(to.p_path, from_stat->st_mode, from_stat->st_rdev)) { in copy_special() 369 islink = S_ISLNK(fs->st_mode); in setfile() 384 fs->st_mode &= ~(S_ISUID | S_ISGID); in setfile() 386 if (fd ? fchmod(fd, fs->st_mode) : lchmod(to.p_path, fs->st_mode)) { in setfile() [all …]
|
/netbsd/usr.sbin/mtree/ |
H A D | compare.c | 151 if (!S_ISBLK(p->fts_statp->st_mode)) in compare() 155 if (!S_ISCHR(p->fts_statp->st_mode)) in compare() 159 if (!S_ISDIR(p->fts_statp->st_mode)) in compare() 163 if (!S_ISFIFO(p->fts_statp->st_mode)) in compare() 167 if (!S_ISREG(p->fts_statp->st_mode)) in compare() 171 if (!S_ISLNK(p->fts_statp->st_mode)) in compare() 176 if (!S_ISSOCK(p->fts_statp->st_mode)) in compare() 269 (was_unlinked || s->st_mode != (p->fts_statp->st_mode & MBITS))) { in compare() 273 tmode = s->st_mode; in compare() 274 mode = p->fts_statp->st_mode & MBITS; in compare() [all …]
|
H A D | create.c | 246 inotype(p->fts_statp->st_mode)); in statf() 263 if (keys & F_MODE && (p->fts_statp->st_mode & MBITS) != mode) in statf() 265 p->fts_statp->st_mode & MBITS); in statf() 267 (S_ISBLK(p->fts_statp->st_mode) || S_ISCHR(p->fts_statp->st_mode))) in statf() 274 (flavor == F_FREEBSD9 || S_ISREG(p->fts_statp->st_mode))) in statf() 286 if (S_ISREG(p->fts_statp->st_mode)) { in statf() 372 (dflag && S_ISDIR(p->fts_statp->st_mode))) { in statd() 373 smode = p->fts_statp->st_mode & MBITS; in statd() 458 if (S_ISDIR((*a)->fts_statp->st_mode)) { in dcmp() 459 if (!S_ISDIR((*b)->fts_statp->st_mode)) in dcmp() [all …]
|
/netbsd/usr.bin/biff/ |
H A D | biff.c | 82 (void)printf("is %s\n", sb.st_mode&0100 ? "y" : "n"); in main() 83 exit(sb.st_mode & 0100 ? 0 : 1); in main() 88 if (chmod(name, sb.st_mode & ~0100) < 0) in main() 92 if (chmod(name, sb.st_mode | 0100) < 0) in main() 98 exit(sb.st_mode & 0100 ? 0 : 1); in main()
|
/netbsd/external/bsd/file/dist/src/ |
H A D | fsmagic.c | 149 sb->st_mode = S_IFBLK; in file_fsmagic() 154 sb->st_mode |= S_IFCHR; in file_fsmagic() 155 sb->st_mode &= ~S_IFREG; in file_fsmagic() 158 sb->st_mode |= S_IFIFO; in file_fsmagic() 159 sb->st_mode &= ~S_IFREG; in file_fsmagic() 181 if (sb->st_mode & S_ISUID) in file_fsmagic() 186 if (sb->st_mode & S_ISGID) in file_fsmagic() 191 if (sb->st_mode & S_ISVTX) in file_fsmagic() 197 switch (sb->st_mode & S_IFMT) { in file_fsmagic() 425 file_error(ms, 0, "invalid mode 0%o", sb->st_mode); in file_fsmagic()
|
/netbsd/bin/getfacl/ |
H A D | getfacl.c | 121 if (sb->st_mode & S_IRUSR) in acl_from_stat() 124 if (sb->st_mode & S_IWUSR) in acl_from_stat() 127 if (sb->st_mode & S_IXUSR) in acl_from_stat() 145 if (sb->st_mode & S_IRGRP) in acl_from_stat() 148 if (sb->st_mode & S_IWGRP) in acl_from_stat() 151 if (sb->st_mode & S_IXGRP) in acl_from_stat() 169 if (sb->st_mode & S_IROTH) in acl_from_stat() 172 if (sb->st_mode & S_IWOTH) in acl_from_stat() 175 if (sb->st_mode & S_IXOTH) in acl_from_stat()
|
/netbsd/external/bsd/libarchive/dist/libarchive/ |
H A D | archive_read_open_filename.c | 77 mode_t st_mode; /* Mode bits for opened file. */ member 134 mine->st_mode = mine->use_lseek = 0; in archive_read_open_filenames() 314 if (S_ISREG(st.st_mode)) { in file_open() 322 else if (S_ISCHR(st.st_mode) && in file_open() 329 else if ((S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode)) && in file_open() 336 else if (S_ISCHR(st.st_mode) && in file_open() 343 else if (S_ISBLK(st.st_mode) && in file_open() 370 mine->st_mode = st.st_mode; in file_open() 553 if (!S_ISREG(mine->st_mode) in file_close2() 554 && !S_ISCHR(mine->st_mode) in file_close2() [all …]
|
/netbsd/bin/pax/ |
H A D | file_subs.c | 252 arcn->sb.st_mode &= ~SETBITS(0); in file_close() 254 set_pmode(tmp_name, arcn->sb.st_mode); in file_close() 257 apply_umask((arcn->sb.st_mode & FILEBITS(0)))); in file_close() 305 *payload = S_ISREG(arcn->sb.st_mode) && in lnk_creat() 417 if (S_ISDIR(sb.st_mode) && strcmp(from, ".") != 0) { in mk_link() 495 S_ISLNK(sb.st_mode)) { in node_creat() 601 set_pmode(arcn->name, arcn->sb.st_mode); in node_creat() 625 set_pmode(nm, ((sb.st_mode & in node_creat() 629 arcn->sb.st_mode = sb.st_mode; in node_creat() 677 if (S_ISDIR(sb.st_mode)) { in unlnk_exist() [all …]
|
/netbsd/crypto/dist/ipsec-tools/src/racoon/ |
H A D | safefile.c | 73 switch (s.st_mode & S_IFMT) { 79 (s.st_mode & S_IFMT)); 85 if ((s.st_mode & S_IRWXG) != 0 || (s.st_mode & S_IRWXO) != 0) {
|
/netbsd/bin/ksh/ |
H A D | c_test.c | 264 return test_stat(opnd1, &b1) == 0 && S_ISREG(b1.st_mode); 266 return test_stat(opnd1, &b1) == 0 && S_ISDIR(b1.st_mode); 269 return test_stat(opnd1, &b1) == 0 && S_ISCHR(b1.st_mode); 275 return test_stat(opnd1, &b1) == 0 && S_ISBLK(b1.st_mode); 287 return lstat(opnd1, &b1) == 0 && S_ISLNK(b1.st_mode); 313 return stat(p, &b1) == 0 && S_ISCDF(b1.st_mode); 321 && (b1.st_mode & S_ISUID) == S_ISUID; 328 && (b1.st_mode & S_ISGID) == S_ISGID; 334 && (b1.st_mode & S_ISVTX) == S_ISVTX; 454 else if (S_ISDIR(statb.st_mode)) [all …]
|
/netbsd/external/gpl2/lvm2/dist/lib/activate/ |
H A D | fs.c | 103 if (!S_ISBLK(buf.st_mode)) in _rm_blks() 116 if (!S_ISCHR(buf.st_mode)) in _rm_blks() 161 if (!S_ISLNK(buf.st_mode) && !S_ISCHR(buf.st_mode)) { in _mk_link() 207 if (!S_ISCHR(buf.st_mode)) { in _mk_link() 220 if (!S_ISLNK(buf.st_mode) && !S_ISBLK(buf.st_mode)) { in _mk_link() 283 if (lstat(raw_lv_path, &buf) || !S_ISLNK(buf.st_mode)) { in _rm_link() 309 if (!S_ISLNK(buf.st_mode)) { in _rm_link()
|
/netbsd/bin/rm/ |
H A D | rm.c | 291 sb.st_mode = S_IFWHT|S_IWUSR|S_IRUSR; in rm_file() 305 if (S_ISDIR(sb.st_mode) && !dflag) { in rm_file() 310 if (!fflag && !S_ISWHT(sb.st_mode) && !check(f, f, &sb)) in rm_file() 312 if (S_ISWHT(sb.st_mode)) in rm_file() 314 else if (S_ISDIR(sb.st_mode)) in rm_file() 399 if (!S_ISREG(sbp->st_mode)) in rm_overwrite() 411 !S_ISREG(sb2.st_mode)) { in rm_overwrite() 533 if (!stdin_ok || S_ISLNK(sp->st_mode) || in check() 536 strmode(sp->st_mode, modep); in check()
|
/netbsd/usr.bin/compress/ |
H A D | compress.c | 211 if (!force && exists && S_ISREG(sb.st_mode) && !permission(out)) in compress() 213 oreg = !exists || S_ISREG(sb.st_mode); in compress() 228 if (!S_ISREG(isb.st_mode)) in compress() 309 if (!force && exists && S_ISREG(sb.st_mode) && !permission(out)) in decompress() 311 oreg = !exists || S_ISREG(sb.st_mode); in decompress() 326 if (!S_ISREG(sb.st_mode)) in decompress() 391 fs->st_mode &= S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO; in setfile() 407 fs->st_mode &= ~(S_ISUID|S_ISGID); in setfile() 409 if (chmod(name, fs->st_mode)) in setfile()
|
/netbsd/bin/ln/ |
H A D | ln.c | 166 if (hflag && lstat(targetdir, &sb) == 0 && S_ISLNK(sb.st_mode)) { in main() 176 if (!S_ISDIR(sb.st_mode)) in main() 246 if (S_ISDIR(sb.st_mode)) { in linkit() 258 (lstat(target, &sb) == 0 && S_ISDIR(sb.st_mode)) || in linkit() 259 (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode))) { in linkit() 313 if (Fflag && S_ISDIR(sb.st_mode)) { in linkit() 334 if (Fflag && S_ISDIR(sb.st_mode)) { in linkit()
|
/netbsd/sbin/mount_umap/ |
H A D | mount_umap.c | 158 if (statbuf.st_mode & S_IWGRP || statbuf.st_mode & S_IWOTH) { in mount_umap() 159 strmode(statbuf.st_mode, buf); in mount_umap() 206 if (statbuf.st_mode & S_IWGRP || statbuf.st_mode & S_IWOTH) { in mount_umap() 207 strmode(statbuf.st_mode, buf); in mount_umap()
|
/netbsd/external/gpl2/xcvs/dist/diff/ |
H A D | diff.c | 887 if (S_ISREG (st->st_mode)) 897 if (S_ISDIR (st->st_mode)) return "directory"; 901 if (S_ISBLK (st->st_mode)) return "block special file"; 907 if (S_ISFIFO (st->st_mode)) return "fifo"; 924 if (S_ISSOCK (st->st_mode)) return "socket"; 1031 inf[1 - i].stat.st_mode = inf[i].stat.st_mode; 1059 inf[dir_arg].dir_p = S_ISDIR (inf[dir_arg].stat.st_mode); 1102 && (! S_ISREG (inf[0].stat.st_mode) 1103 || ! S_ISREG (inf[1].stat.st_mode)))) 1138 && (inf[0].desc == -1 || S_ISREG (inf[0].stat.st_mode)) [all …]
|