| /freebsd-14.2/contrib/libarchive/libarchive/test/ |
| H A D | test_write_disk_perms.c | 169 assert((st.st_mode & 07777) != 0144); in DEFINE_TEST() 192 assertEqualInt(st.st_mode & 0777, 0744); in DEFINE_TEST() 203 assertEqualInt(st.st_mode & 0777, 0744); in DEFINE_TEST() 406 assertEqualInt(st.st_mode & 07777, 0755); in DEFINE_TEST() 410 assertEqualInt(st.st_mode & 07777, 0144); in DEFINE_TEST() 414 assertEqualInt(st.st_mode & 07777, 0514); in DEFINE_TEST() 418 assertEqualInt(st.st_mode & 0777, 0744); in DEFINE_TEST() 422 assertEqualInt(st.st_mode & 07777, 0755); in DEFINE_TEST() 426 assertEqualInt(st.st_mode & 07777, 0777); in DEFINE_TEST() 436 assertEqualInt(st.st_mode & 07777, 0742); in DEFINE_TEST() [all …]
|
| H A D | test_write_disk_secure.c | 171 assert(S_ISLNK(st.st_mode)); in DEFINE_TEST() 193 assert(S_ISDIR(st.st_mode)); in DEFINE_TEST() 221 assert(S_ISDIR(st.st_mode)); in DEFINE_TEST() 252 assert((st.st_mode & 0777) == 0755); in DEFINE_TEST() 256 assert(S_ISLNK(st.st_mode)); in DEFINE_TEST() 281 assert((st.st_mode & 07777) == 0755); in DEFINE_TEST() 287 assert((st.st_mode & 07777) == 0755); in DEFINE_TEST() 294 assert(S_ISDIR(st.st_mode)); in DEFINE_TEST() 296 assert((st.st_mode & 0777) == 0755); in DEFINE_TEST() 299 assert(S_ISREG(st.st_mode)); in DEFINE_TEST() [all …]
|
| /freebsd-14.2/usr.bin/diff/ |
| H A D | diffdir.c | 205 stb2.st_mode = stb1.st_mode; in diffit() 207 if (stb1.st_mode == 0) in diffit() 208 stb1.st_mode = stb2.st_mode; in diffit() 209 if (S_ISLNK(stb1.st_mode) || S_ISLNK(stb2.st_mode)) { in diffit() 210 if (S_ISLNK(stb1.st_mode) && S_ISLNK(stb2.st_mode)) { in diffit() 262 stb2.st_mode = stb1.st_mode; in diffit() 264 if (stb1.st_mode == 0) in diffit() 265 stb1.st_mode = stb2.st_mode; in diffit() 267 if (S_ISDIR(stb1.st_mode) && S_ISDIR(stb2.st_mode)) { in diffit() 275 if (!S_ISREG(stb1.st_mode) && !S_ISDIR(stb1.st_mode)) in diffit() [all …]
|
| /freebsd-14.2/contrib/sendmail/libsmutil/ |
| H A D | safefile.c | 92 S_ISREG(st->st_mode)) 101 if (bitset(S_ISUID, st->st_mode)) 251 st->st_mode = ST_MODE_NOFILE; 260 (unsigned long) st->st_mode); 268 (unsigned long) st->st_mode); 276 (unsigned long) st->st_mode); 284 (unsigned long) st->st_mode); 291 (unsigned long) st->st_mode); 298 (unsigned long) st->st_mode); 486 if (S_ISLNK(stbuf.st_mode)) [all …]
|
| /freebsd-14.2/contrib/diff/lib/ |
| H A D | file-type.c | 41 if (S_ISREG (st->st_mode)) in file_type() 44 if (S_ISDIR (st->st_mode)) in file_type() 47 if (S_ISBLK (st->st_mode)) in file_type() 50 if (S_ISCHR (st->st_mode)) in file_type() 53 if (S_ISFIFO (st->st_mode)) in file_type() 56 if (S_ISLNK (st->st_mode)) in file_type() 59 if (S_ISSOCK (st->st_mode)) in file_type()
|
| /freebsd-14.2/usr.bin/biff/ |
| H A D | biff.c | 81 sb.st_mode & S_IXUSR ? "y" : in main() 82 sb.st_mode & S_IXGRP ? "b" : "n"); in main() 83 return (sb.st_mode & (S_IXUSR | S_IXGRP) ? 0 : 1); in main() 89 if (chmod(name, sb.st_mode & ~(S_IXUSR | S_IXGRP)) < 0) in main() 93 if (chmod(name, (sb.st_mode & ~(S_IXUSR | S_IXGRP)) | S_IXUSR) in main() 98 if (chmod(name, (sb.st_mode & ~(S_IXUSR | S_IXGRP)) | S_IXGRP) in main() 105 return (sb.st_mode & (S_IXUSR | S_IXGRP) ? 0 : 1); in main()
|
| /freebsd-14.2/stand/common/ |
| H A D | ls.c | 91 if (stat(path, &sb) == 0 && !S_ISDIR(sb.st_mode)) { in command_ls() 94 typestr[sb.st_mode >> 12], in command_ls() 98 typestr[sb.st_mode >> 12], path); in command_ls() 117 sb.st_mode = 0; in command_ls() 124 sb.st_mode = 0; in command_ls() 131 typestr[d->d_type? d->d_type:sb.st_mode >> 12], in command_ls() 135 typestr[d->d_type? d->d_type:sb.st_mode >> 12], d->d_name); in command_ls() 194 if (!S_ISDIR(sb.st_mode)) { in ls_getdir()
|
| /freebsd-14.2/contrib/mtree/ |
| H A D | create.c | 204 inotype(p->fts_statp->st_mode)); in statf() 223 p->fts_statp->st_mode & MBITS); in statf() 225 (S_ISBLK(p->fts_statp->st_mode) || S_ISCHR(p->fts_statp->st_mode))) in statf() 244 if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { in statf() 252 if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { in statf() 270 if (keys & F_SHA1 && S_ISREG(p->fts_statp->st_mode)) { in statf() 370 (dflag && S_ISDIR(p->fts_statp->st_mode))) { in statd() 371 smode = p->fts_statp->st_mode & MBITS; in statd() 456 if (S_ISDIR((*a)->fts_statp->st_mode)) { in dcmp() 457 if (!S_ISDIR((*b)->fts_statp->st_mode)) in dcmp() [all …]
|
| H A D | compare.c | 149 if (!S_ISBLK(p->fts_statp->st_mode)) in compare() 153 if (!S_ISCHR(p->fts_statp->st_mode)) in compare() 157 if (!S_ISDIR(p->fts_statp->st_mode)) in compare() 161 if (!S_ISFIFO(p->fts_statp->st_mode)) in compare() 165 if (!S_ISREG(p->fts_statp->st_mode)) in compare() 169 if (!S_ISLNK(p->fts_statp->st_mode)) in compare() 174 if (!S_ISSOCK(p->fts_statp->st_mode)) in compare() 261 s->st_mode != (p->fts_statp->st_mode & MBITS)) { in compare() 265 tmode = s->st_mode; in compare() 266 mode = p->fts_statp->st_mode & MBITS; in compare() [all …]
|
| /freebsd-14.2/bin/cp/ |
| H A D | utils.c | 131 if ((sb.st_mode & S_IFMT) != (fs->st_mode & S_IFMT)) { in copy_file() 195 fs->st_mode & ~(S_ISUID | S_ISGID)); in copy_file() 291 if (mkfifo(to.p_path, from_stat->st_mode)) { in copy_fifo() 327 islink = !fdval && S_ISLNK(fs->st_mode); in setfile() 328 fs->st_mode &= S_ISUID | S_ISGID | S_ISVTX | in setfile() 343 ts.st_mode &= S_ISUID | S_ISGID | S_ISVTX | in setfile() 360 fs->st_mode &= ~(S_ISUID | S_ISGID); in setfile() 363 if (!gotstat || fs->st_mode != ts.st_mode) in setfile() 364 if (fdval ? fchmod(fd, fs->st_mode) : in setfile() 366 chmod(to.p_path, fs->st_mode))) { in setfile() [all …]
|
| /freebsd-14.2/contrib/atf/atf-c/detail/ |
| H A D | fs.c | 555 int type = st->m_sb.st_mode & S_IFMT; in atf_fs_stat_init() 607 return st->m_sb.st_mode & ~S_IFMT; in atf_fs_stat_get_mode() 625 return st->m_sb.st_mode & S_IRUSR; in atf_fs_stat_is_owner_readable() 631 return st->m_sb.st_mode & S_IWUSR; in atf_fs_stat_is_owner_writable() 637 return st->m_sb.st_mode & S_IXUSR; in atf_fs_stat_is_owner_executable() 643 return st->m_sb.st_mode & S_IRGRP; in atf_fs_stat_is_group_readable() 649 return st->m_sb.st_mode & S_IWGRP; in atf_fs_stat_is_group_writable() 655 return st->m_sb.st_mode & S_IXGRP; in atf_fs_stat_is_group_executable() 661 return st->m_sb.st_mode & S_IROTH; in atf_fs_stat_is_other_readable() 667 return st->m_sb.st_mode & S_IWOTH; in atf_fs_stat_is_other_writable() [all …]
|
| /freebsd-14.2/usr.sbin/fifolog/lib/ |
| H A D | fifolog_create.c | 70 if (!S_ISBLK(st.st_mode) && in fifolog_create() 71 !S_ISCHR(st.st_mode) && in fifolog_create() 72 !S_ISREG(st.st_mode)) { in fifolog_create() 77 if(!created && S_ISREG(st.st_mode)) { in fifolog_create() 93 if (size == 0 && S_ISREG(st.st_mode)) in fifolog_create() 99 if (S_ISREG(st.st_mode) && ftruncate(fd, size) < 0) in fifolog_create()
|
| /freebsd-14.2/contrib/file/src/ |
| H A D | fsmagic.c | 143 sb->st_mode = S_IFBLK; in file_fsmagic() 148 sb->st_mode |= S_IFCHR; in file_fsmagic() 149 sb->st_mode &= ~S_IFREG; in file_fsmagic() 152 sb->st_mode |= S_IFIFO; in file_fsmagic() 153 sb->st_mode &= ~S_IFREG; in file_fsmagic() 175 if (sb->st_mode & S_ISUID) in file_fsmagic() 180 if (sb->st_mode & S_ISGID) in file_fsmagic() 185 if (sb->st_mode & S_ISVTX) in file_fsmagic() 191 switch (sb->st_mode & S_IFMT) { in file_fsmagic() 419 file_error(ms, 0, "invalid mode 0%o", sb->st_mode); in file_fsmagic()
|
| /freebsd-14.2/crypto/heimdal/appl/ftp/ftpd/ |
| H A D | ls.c | 159 if(S_ISDIR(st->st_mode)) { in make_fileinfo() 163 else if(S_ISCHR(st->st_mode)) in make_fileinfo() 165 else if(S_ISBLK(st->st_mode)) in make_fileinfo() 198 if((st->st_mode & S_ISUID)) { in make_fileinfo() 199 if((st->st_mode & S_IXUSR)) in make_fileinfo() 204 if((st->st_mode & S_ISGID)) { in make_fileinfo() 205 if((st->st_mode & S_IXGRP)) in make_fileinfo() 210 if((st->st_mode & S_ISTXT)) { in make_fileinfo() 211 if((st->st_mode & S_IXOTH)) in make_fileinfo() 245 if(S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) { in make_fileinfo() [all …]
|
| /freebsd-14.2/contrib/libarchive/libarchive/ |
| H A D | archive_read_open_filename.c | 76 mode_t st_mode; /* Mode bits for opened file. */ member 133 mine->st_mode = mine->use_lseek = 0; in archive_read_open_filenames() 344 if (S_ISREG(st.st_mode)) { in file_open() 352 else if (S_ISCHR(st.st_mode) && in file_open() 359 else if ((S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode)) && in file_open() 366 else if (S_ISCHR(st.st_mode) && in file_open() 373 else if (S_ISBLK(st.st_mode) && in file_open() 400 mine->st_mode = st.st_mode; in file_open() 583 if (!S_ISREG(mine->st_mode) in file_close2() 584 && !S_ISCHR(mine->st_mode) in file_close2() [all …]
|
| /freebsd-14.2/bin/pax/ |
| H A D | file_subs.c | 92 file_mode = arcn->sb.st_mode & FILEBITS; in file_creat() 156 arcn->sb.st_mode &= ~(SETBITS); in file_close() 158 set_pmode(arcn->name, arcn->sb.st_mode); in file_close() 186 if (S_ISDIR(sb.st_mode)) { in lnk_creat() 292 if (S_ISDIR(sb.st_mode)) { in mk_link() 355 file_mode = arcn->sb.st_mode & FILEBITS; in node_creat() 437 arcn->sb.st_mode &= ~(SETBITS); in node_creat() 439 set_pmode(arcn->name, arcn->sb.st_mode); in node_creat() 464 ((sb.st_mode & FILEBITS) | S_IRWXU)); in node_creat() 466 arcn->sb.st_mode = sb.st_mode; in node_creat() [all …]
|
| H A D | tar.c | 415 arcn->sb.st_mode |= S_IFLNK; in tar_rd() 432 arcn->sb.st_mode |= S_IFREG; in tar_rd() 439 arcn->sb.st_mode |= S_IFDIR; in tar_rd() 453 arcn->sb.st_mode |= S_IFDIR; in tar_rd() 462 arcn->sb.st_mode |= S_IFREG; in tar_rd() 779 arcn->sb.st_mode |= S_IFIFO; in ustar_rd() 783 arcn->sb.st_mode |= S_IFDIR; in ustar_rd() 801 arcn->sb.st_mode |= S_IFBLK; in ustar_rd() 804 arcn->sb.st_mode |= S_IFCHR; in ustar_rd() 814 arcn->sb.st_mode |= S_IFLNK; in ustar_rd() [all …]
|
| /freebsd-14.2/bin/test/ |
| H A D | test.c | 381 if (S_ISDIR(s.st_mode) || geteuid() != 0) in filstat() 387 return S_ISREG(s.st_mode); in filstat() 389 return S_ISDIR(s.st_mode); in filstat() 391 return S_ISCHR(s.st_mode); in filstat() 393 return S_ISBLK(s.st_mode); in filstat() 395 return S_ISFIFO(s.st_mode); in filstat() 397 return S_ISSOCK(s.st_mode); in filstat() 399 return S_ISLNK(s.st_mode); in filstat() 401 return (s.st_mode & S_ISUID) != 0; in filstat() 403 return (s.st_mode & S_ISGID) != 0; in filstat() [all …]
|
| /freebsd-14.2/bin/chmod/ |
| H A D | chmod.c | 194 newmode = getmode(set, p->fts_statp->st_mode); in main() 201 (newmode & ALLPERMS) == (p->fts_statp->st_mode & ALLPERMS)) in main() 213 strmode(p->fts_statp->st_mode, m1); in main() 214 strmode((p->fts_statp->st_mode & in main() 217 p->fts_statp->st_mode, m1, in main() 218 (p->fts_statp->st_mode & S_IFMT) | in main()
|
| /freebsd-14.2/usr.sbin/pw/ |
| H A D | cpdir.c | 81 if (S_ISDIR(st.st_mode)) { in copymkdir() 83 st.st_mode & _DEF_DIRMODE, uid, gid, st.st_flags); in copymkdir() 87 if (S_ISLNK(st.st_mode) && in copymkdir() 96 if (!S_ISREG(st.st_mode)) in copymkdir() 102 st.st_mode); in copymkdir()
|
| /freebsd-14.2/bin/ln/ |
| H A D | ln.c | 164 if (hflag && lstat(targetdir, &sb) == 0 && S_ISLNK(sb.st_mode)) { in main() 174 if (!S_ISDIR(sb.st_mode)) in main() 245 if (S_ISDIR(sb.st_mode)) { in linkit() 257 (lstat(target, &sb) == 0 && S_ISDIR(sb.st_mode)) || in linkit() 258 (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode)))) { in linkit() 312 if (Fflag && S_ISDIR(sb.st_mode)) { in linkit() 333 if (Fflag && S_ISDIR(sb.st_mode)) { in linkit()
|
| /freebsd-14.2/usr.bin/compress/ |
| H A D | compress.c | 205 if (!force && exists && S_ISREG(sb.st_mode) && !permission(out)) in compress() 207 isreg = oreg = !exists || S_ISREG(sb.st_mode); in compress() 218 if (!S_ISREG(isb.st_mode)) in compress() 295 if (!force && exists && S_ISREG(sb.st_mode) && !permission(out)) in decompress() 297 isreg = oreg = !exists || S_ISREG(sb.st_mode); in decompress() 308 if (!S_ISREG(sb.st_mode)) in decompress() 368 fs->st_mode &= S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO; in setfile() 384 fs->st_mode &= ~(S_ISUID|S_ISGID); in setfile() 386 if (chmod(name, fs->st_mode) && errno != EOPNOTSUPP) in setfile()
|
| /freebsd-14.2/bin/mv/ |
| H A D | mv.c | 123 if (stat(argv[argc - 1], &sb) || !S_ISDIR(sb.st_mode)) { in main() 136 if (lstat(argv[1], &sb) == 0 && S_ISLNK(sb.st_mode)) in main() 203 strmode(sb.st_mode, modep); in do_move() 243 if (!S_ISLNK(sb.st_mode)) { in do_move() 269 return (S_ISREG(sb.st_mode) ? in do_move() 314 oldmode = sbp->st_mode & ALLPERMS; in fastcopy() 322 sbp->st_mode &= ~(S_ISUID | S_ISGID); in fastcopy() 325 if (fchmod(to_fd, sbp->st_mode)) in fastcopy() 382 if (S_ISDIR(sb.st_mode)) { in copy()
|
| /freebsd-14.2/contrib/diff/src/ |
| H A D | system.h | 277 (((S_ISBLK ((s)->st_mode) && S_ISBLK ((t)->st_mode)) \ 278 || (S_ISCHR ((s)->st_mode) && S_ISCHR ((t)->st_mode))) \ 319 ((s)->st_mode == (t)->st_mode \
|
| /freebsd-14.2/contrib/openpam/lib/libpam/ |
| H A D | openpam_check_owner_perms.c | 70 if (!S_ISREG(sb.st_mode)) { in openpam_check_desc_owner_perms() 77 (sb.st_mode & (S_IWGRP|S_IWOTH)) != 0) { in openpam_check_desc_owner_perms() 121 if (tip && !S_ISREG(sb.st_mode)) { in openpam_check_path_owner_perms() 128 (sb.st_mode & (S_IWGRP|S_IWOTH)) != 0) { in openpam_check_path_owner_perms()
|