/freebsd/contrib/libarchive/libarchive/test/ |
H A D | test_write_disk_perms.c | 168 failure("file_overwrite_0144: st.st_mode=%o", st.st_mode); in DEFINE_TEST() 169 assert((st.st_mode & 07777) != 0144); in DEFINE_TEST() 191 failure("dir_overwrite_0744: st.st_mode=%o", st.st_mode); in DEFINE_TEST() 192 assertEqualInt(st.st_mode & 0777, 0744); in DEFINE_TEST() 202 failure("dir_overwrite_0744: st.st_mode=%o", st.st_mode); in DEFINE_TEST() 203 assertEqualInt(st.st_mode & 0777, 0744); in DEFINE_TEST() 405 failure("file_0755: st.st_mode 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() 251 failure("dir: st.st_mode=%o", st.st_mode); in DEFINE_TEST() 252 assert((st.st_mode & 0777) == 0755); in DEFINE_TEST() 255 failure("link_to_dir: st.st_mode=%o", st.st_mode); in DEFINE_TEST() 256 assert(S_ISLNK(st.st_mode)); in DEFINE_TEST() 280 failure("link_to_dir: st.st_mode in DEFINE_TEST() [all...] |
/freebsd/usr.bin/diff/ |
H A D | diffdir.c | 204 stb2.st_mode = stb1.st_mode; in diffit() 206 if (stb1.st_mode == 0) in diffit() 207 stb1.st_mode = stb2.st_mode; in diffit() 208 if (S_ISLNK(stb1.st_mode) || S_ISLNK(stb2.st_mode)) { in diffit() 209 if (S_ISLNK(stb1.st_mode) && S_ISLNK(stb2.st_mode)) { in diffit() 235 path1, S_ISLNK(stb1.st_mode) in diffit() [all...] |
H A D | diff.c | 438 stb2.st_mode = stb1.st_mode; in main() 447 if (stb1.st_mode == 0) in main() 448 stb1.st_mode = stb2.st_mode; in main() 450 if (gotstdin && (S_ISDIR(stb1.st_mode) || S_ISDIR(stb2.st_mode))) in main() 453 if (S_ISDIR(stb1.st_mode) && S_ISDIR(stb2.st_mode)) { in main() 458 if (S_ISDIR(stb1.st_mode)) { in main() [all...] |
/freebsd/contrib/sendmail/libsmutil/ |
H A D | safefile.c | 91 !bitset(S_IXUSR|S_IXGRP|S_IXOTH, st->st_mode) && 92 S_ISREG(st->st_mode)) 101 if (bitset(S_ISUID, st->st_mode)) 103 if (bitset(S_ISUID, st->st_mode) && st->st_uid != 0 && 111 if (bitset(S_ISGID, st->st_mode)) 113 if (bitset(S_ISGID, st->st_mode) && st->st_gid != 0) 239 if ((stbuf.st_mode & md) != md) 247 (unsigned long) stbuf.st_mode, 251 st->st_mode = ST_MODE_NOFILE; 256 if (bitset(SFF_NOSLINK, flags) && S_ISLNK(st->st_mode)) [all …]
|
/freebsd/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/usr.bin/biff/ |
H A D | biff.c | 68 sb.st_mode & S_IXUSR ? "y" : in main() 69 sb.st_mode & S_IXGRP ? "b" : "n"); in main() 70 return (sb.st_mode & (S_IXUSR | S_IXGRP) ? 0 : 1); in main() 76 if (chmod(name, sb.st_mode & ~(S_IXUSR | S_IXGRP)) < 0) in main() 80 if (chmod(name, (sb.st_mode & ~(S_IXUSR | S_IXGRP)) | S_IXUSR) in main() 85 if (chmod(name, (sb.st_mode & ~(S_IXUSR | S_IXGRP)) | S_IXGRP) in main() 92 return (sb.st_mode & (S_IXUSR | S_IXGRP) ? 0 : 1); in main()
|
/freebsd/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/contrib/mtree/ |
H A D | create.c | 194 S_ISDIR(p->fts_statp->st_mode) ? "" : " ", vispath(p->fts_name)); in statf() 202 if (!S_ISREG(p->fts_statp->st_mode) && (flavor == F_NETBSD6 || !dflag)) in statf() 204 inotype(p->fts_statp->st_mode)); in statf() 221 if (keys & F_MODE && (p->fts_statp->st_mode & MBITS) != 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() 232 (flavor == F_FREEBSD9 || S_ISREG(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() 261 if (keys & F_RMD160 && S_ISREG(p->fts_statp->st_mode)) { in statf() [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() 181 nodetype(s->type), inotype(p->fts_statp->st_mode)); in compare() 210 s->st_mode | nodetoino(s->type), in compare() 261 s->st_mode != (p->fts_statp->st_mode & MBITS)) { in compare() [all …]
|
/freebsd/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/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/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/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() 167 else if(S_ISREG(st->st_mode)) { in make_fileinfo() 169 if(st->st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) in make_fileinfo() 172 else if(S_ISFIFO(st->st_mode)) { in make_fileinfo() 176 else if(S_ISLNK(st->st_mode)) { in make_fileinfo() 180 else if(S_ISSOCK(st->st_mode)) { in make_fileinfo() 185 else if(S_ISWHT(st->st_mode)) { in make_fileinfo() 195 strcpy(file->mode + 1, x[(st->st_mode & S_IRWXU) >> 6]); in make_fileinfo() [all …]
|
/freebsd/bin/pax/ |
H A D | file_subs.c | 86 file_mode = arcn->sb.st_mode & FILEBITS; in file_creat() 150 arcn->sb.st_mode &= ~(SETBITS); in file_close() 152 set_pmode(arcn->name, arcn->sb.st_mode); in file_close() 180 if (S_ISDIR(sb.st_mode)) { in lnk_creat() 286 if (S_ISDIR(sb.st_mode)) { in mk_link() 349 file_mode = arcn->sb.st_mode & FILEBITS; in node_creat() 431 arcn->sb.st_mode &= ~(SETBITS); in node_creat() 433 set_pmode(arcn->name, arcn->sb.st_mode); in node_creat() 458 ((sb.st_mode & FILEBITS) | S_IRWXU)); in node_creat() 460 arcn->sb.st_mode = sb.st_mode; in node_creat() [all …]
|
/freebsd/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/bin/chmod/ |
H A D | chmod.c | 182 newmode = getmode(set, p->fts_statp->st_mode); in main() 189 (newmode & ALLPERMS) == (p->fts_statp->st_mode & ALLPERMS)) in main() 201 strmode(p->fts_statp->st_mode, m1); in main() 202 strmode((p->fts_statp->st_mode & in main() 205 p->fts_statp->st_mode, m1, in main() 206 (p->fts_statp->st_mode & S_IFMT) | in main()
|
/freebsd/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/bin/ln/ |
H A D | ln.c | 152 if (hflag && lstat(targetdir, &sb) == 0 && S_ISLNK(sb.st_mode)) { in main() 162 if (!S_ISDIR(sb.st_mode)) in main() 233 if (S_ISDIR(sb.st_mode)) { in linkit() 245 (lstat(target, &sb) == 0 && S_ISDIR(sb.st_mode)) || in linkit() 246 (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode)))) { in linkit() 300 if (Fflag && S_ISDIR(sb.st_mode)) { in linkit() 321 if (Fflag && S_ISDIR(sb.st_mode)) { in linkit()
|
/freebsd/usr.bin/compress/ |
H A D | compress.c | 192 if (!force && exists && S_ISREG(sb.st_mode) && !permission(out)) in compress() 194 isreg = oreg = !exists || S_ISREG(sb.st_mode); in compress() 205 if (!S_ISREG(isb.st_mode)) in compress() 282 if (!force && exists && S_ISREG(sb.st_mode) && !permission(out)) in decompress() 284 isreg = oreg = !exists || S_ISREG(sb.st_mode); in decompress() 295 if (!S_ISREG(sb.st_mode)) in decompress() 355 fs->st_mode &= S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO; in setfile() 371 fs->st_mode &= ~(S_ISUID|S_ISGID); in setfile() 373 if (chmod(name, fs->st_mode) && errno != EOPNOTSUPP) in setfile()
|
/freebsd/bin/mv/ |
H A D | mv.c | 108 if (stat(argv[argc - 1], &sb) || !S_ISDIR(sb.st_mode)) { in main() 121 if (lstat(argv[1], &sb) == 0 && S_ISLNK(sb.st_mode)) in main() 188 strmode(sb.st_mode, modep); in do_move() 225 if (!S_ISLNK(sb.st_mode)) { in do_move() 251 return (S_ISREG(sb.st_mode) ? in do_move() 297 oldmode = sbp->st_mode & ALLPERMS; in fastcopy() 305 sbp->st_mode &= ~(S_ISUID | S_ISGID); in fastcopy() 308 if (fchmod(to_fd, sbp->st_mode)) in fastcopy() 365 if (S_ISDIR(sb.st_mode)) { in copy()
|
/freebsd/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/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()
|
/freebsd/usr.bin/find/ |
H A D | ls.c | 60 (void)strmode(sb->st_mode, modep); in printlong() 66 if (S_ISCHR(sb->st_mode) || S_ISBLK(sb->st_mode)) in printlong() 72 if (S_ISLNK(sb->st_mode)) in printlong()
|
/freebsd/bin/rm/ |
H A D | rm.c | 339 sb.st_mode = S_IFWHT|S_IWUSR|S_IRUSR; in rm_file() 353 if (S_ISDIR(sb.st_mode) && !dflag) { in rm_file() 358 if (!fflag && !S_ISWHT(sb.st_mode) && !check(f, f, &sb)) in rm_file() 361 if (!uid && !S_ISWHT(sb.st_mode) && in rm_file() 366 if (S_ISWHT(sb.st_mode)) in rm_file() 368 else if (S_ISDIR(sb.st_mode)) in rm_file() 402 if (!stdin_ok || S_ISLNK(sp->st_mode) || in check() 407 strmode(sp->st_mode, modep); in check() 460 if (S_ISDIR(st.st_mode)) { in check2()
|