/openbsd/usr.bin/biff/ |
H A D | biff.c | 71 sb.st_mode &= ACCESSPERMS; in main() 74 (void)printf("is %s\n", sb.st_mode & S_IXUSR ? "y" : "n"); in main() 75 exit(sb.st_mode & S_IXUSR ? 0 : 1); in main() 80 if (chmod(name, sb.st_mode & ~S_IXUSR) == -1) in main() 84 if (chmod(name, sb.st_mode | S_IXUSR) == -1) in main() 90 exit(sb.st_mode & S_IXUSR ? 0 : 1); in main()
|
/openbsd/usr.sbin/mtree/ |
H A D | compare.c | 84 if (!S_ISBLK(p->fts_statp->st_mode)) in compare() 88 if (!S_ISCHR(p->fts_statp->st_mode)) in compare() 92 if (!S_ISDIR(p->fts_statp->st_mode)) in compare() 96 if (!S_ISFIFO(p->fts_statp->st_mode)) in compare() 100 if (!S_ISREG(p->fts_statp->st_mode)) in compare() 104 if (!S_ISLNK(p->fts_statp->st_mode)) in compare() 108 if (!S_ISSOCK(p->fts_statp->st_mode)) { in compare() 145 s->st_mode != (p->fts_statp->st_mode & MBITS)) { in compare() 149 tmode = s->st_mode; in compare() 150 mode = p->fts_statp->st_mode & MBITS; in compare() [all …]
|
H A D | create.c | 143 if (iflag || S_ISDIR(p->fts_statp->st_mode)) in statf() 155 if (!S_ISREG(p->fts_statp->st_mode) && !dflag) in statf() 187 if (keys & F_SIZE && S_ISREG(p->fts_statp->st_mode)) in statf() 194 if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { in statf() 201 if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { in statf() 210 if (keys & F_RMD160 && S_ISREG(p->fts_statp->st_mode)) { in statf() 219 if (keys & F_SHA1 && S_ISREG(p->fts_statp->st_mode)) { in statf() 299 smode = p->fts_statp->st_mode & MBITS; in statd() 360 if (S_ISDIR((*a)->fts_statp->st_mode)) { in dsort() 361 if (!S_ISDIR((*b)->fts_statp->st_mode)) in dsort() [all …]
|
/openbsd/usr.bin/diff/ |
H A D | diffdir.c | 192 stb2.st_mode = stb1.st_mode; in diffit() 194 if (stb1.st_mode == 0) in diffit() 195 stb1.st_mode = stb2.st_mode; in diffit() 197 if (S_ISDIR(stb1.st_mode) && S_ISDIR(stb2.st_mode)) { in diffit() 205 if (!S_ISREG(stb1.st_mode) && !S_ISDIR(stb1.st_mode)) in diffit() 207 else if (!S_ISREG(stb2.st_mode) && !S_ISDIR(stb2.st_mode)) in diffit()
|
/openbsd/bin/mv/ |
H A D | cp.c | 153 if (r == -1 || !S_ISDIR(to_stat.st_mode)) { in cpmain() 169 if (S_ISDIR(tmp_stat.st_mode)) in cpmain() 310 if (!S_ISDIR(to_stat.st_mode)) in copy() 322 curr->fts_statp->st_mode); in copy() 330 if (S_ISDIR(curr->fts_statp->st_mode)) in copy() 334 if (!S_ISDIR(curr->fts_statp->st_mode) && in copy() 335 S_ISDIR(to_stat.st_mode)) { in copy() 343 switch (curr->fts_statp->st_mode & S_IFMT) { in copy() 361 } else if (!S_ISDIR(to_stat.st_mode)) in copy() 602 if (mkfifo(to.p_path, from_stat->st_mode)) { in copy_fifo() [all …]
|
H A D | mv.c | 102 if (stat(argv[argc - 1], &sb) || !S_ISDIR(sb.st_mode)) { in main() 185 strmode(sb.st_mode, modep); in do_move() 226 if (S_ISDIR(fsb.st_mode)) { in do_move() 247 if ((S_ISDIR(sb.st_mode)) ? rmdir(to) : unlink(to)) { in do_move() 257 return (S_ISREG(fsb.st_mode) ? in do_move() 293 (void) fchmod(to_fd, sbp->st_mode & ~(S_ISUID|S_ISGID)); in fastcopy() 311 if ((sbp->st_mode & (S_ISUID|S_ISGID))) { in fastcopy() 315 sbp->st_mode &= ~(S_ISUID|S_ISGID); in fastcopy() 319 if (fchmod(to_fd, sbp->st_mode)) in fastcopy()
|
/openbsd/gnu/usr.sbin/mkhybrid/src/diag/ |
H A D | isoinfo.c | 310 if(S_ISREG(fstat_buf.st_mode)) in dump_stat() 328 if( fstat_buf.st_mode & S_IRUSR ) in dump_stat() 330 if( fstat_buf.st_mode & S_IWUSR ) in dump_stat() 332 if( fstat_buf.st_mode & S_IXUSR ) in dump_stat() 335 if( fstat_buf.st_mode & S_IRGRP ) in dump_stat() 337 if( fstat_buf.st_mode & S_IWGRP ) in dump_stat() 339 if( fstat_buf.st_mode & S_IXGRP ) in dump_stat() 342 if( fstat_buf.st_mode & S_IROTH ) in dump_stat() 344 if( fstat_buf.st_mode & S_IWOTH ) in dump_stat() 415 fstat_buf.st_mode |= S_IFDIR; in parse_dir() [all …]
|
/openbsd/gnu/usr.bin/cvs/src/ |
H A D | filesubr.c | 58 mknod (to, sb.st_mode, sb.st_rdev); 130 return (S_ISDIR (sb.st_mode)); 145 return (S_ISLNK (sb.st_mode)); 164 if (S_ISBLK (sb.st_mode)) 168 if (S_ISCHR (sb.st_mode)) 255 return (sb.st_mode & umask) == umask; 370 mode = sb.st_mode | (~oumask 465 else if (S_ISDIR (sb.st_mode)) 608 if ((sb1.st_mode & S_IFMT) != (sb2.st_mode & S_IFMT)) 613 if (S_ISLNK (sb1.st_mode) && S_ISLNK (sb2.st_mode)) [all …]
|
/openbsd/gnu/usr.sbin/mkhybrid/src/ |
H A D | tree.c | 129 st->st_mode |= 0444; in FDECL1() 133 st->st_mode |= 0111; in FDECL1() 1084 statbuf.st_mode = (statbuf.st_mode & ~S_IFMT) | S_IFREG; 1127 statbuf.st_mode = (statbuf.st_mode & ~S_IFMT) | S_IFREG; 1196 if (!S_ISCHR(lstatbuf.st_mode) && !S_ISBLK(lstatbuf.st_mode) && 1197 !S_ISFIFO(lstatbuf.st_mode) && !S_ISSOCK(lstatbuf.st_mode) 1198 && !S_ISLNK(lstatbuf.st_mode) && !S_ISREG(lstatbuf.st_mode) && 1258 lstatbuf.st_mode = (lstatbuf.st_mode & ~S_IFMT) | S_IFREG; 1434 if (S_ISCHR(lstatbuf.st_mode) || S_ISBLK(lstatbuf.st_mode) || 1435 S_ISFIFO(lstatbuf.st_mode) || S_ISSOCK(lstatbuf.st_mode) [all …]
|
/openbsd/bin/cp/ |
H A D | utils.c | 106 fs->st_mode & ~(S_ISTXT | S_ISUID | S_ISGID)); in copy_file() 145 if (!fstat(to_fd, &tosb) && S_ISREG(tosb.st_mode)) in copy_file() 181 fs->st_mode & (S_ISUID | S_ISGID) && fs->st_uid == myuid) { in copy_file() 186 fchmod(to_fd, fs->st_mode & RETAINBITS & ~myumask)) { in copy_file() 232 if (mkfifo(to.p_path, from_stat->st_mode)) { in copy_fifo() 248 if (mknod(to.p_path, from_stat->st_mode, from_stat->st_rdev)) { in copy_special() 281 fs->st_mode &= S_ISTXT | S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO; in setfile() 302 fs->st_mode &= ~(S_ISTXT | S_ISUID | S_ISGID); in setfile() 304 if (fd >= 0 ? fchmod(fd, fs->st_mode) : in setfile() 305 fchmodat(AT_FDCWD, to.p_path, fs->st_mode, AT_SYMLINK_NOFOLLOW)) { in setfile()
|
H A D | cp.c | 209 if (r == -1 || !S_ISDIR(to_stat.st_mode)) { in main() 228 if (S_ISDIR(tmp_stat.st_mode) && (Rflag || rflag)) in main() 369 if (!S_ISDIR(to_stat.st_mode)) in copy() 381 curr->fts_statp->st_mode); in copy() 389 if (S_ISDIR(curr->fts_statp->st_mode)) in copy() 393 if (!S_ISDIR(curr->fts_statp->st_mode) && in copy() 394 S_ISDIR(to_stat.st_mode)) { in copy() 402 switch (curr->fts_statp->st_mode & S_IFMT) { in copy() 428 curr->fts_statp->st_mode | S_IRWXU) == -1) in copy() 433 } else if (!S_ISDIR(to_stat.st_mode)) in copy()
|
/openbsd/sys/arch/octeon/stand/rdboot/ |
H A D | cmd.c | 127 if (sb.st_uid || (sb.st_mode & 2)) { in read_conf() 379 if ((sb.st_mode & S_IFMT) != S_IFDIR) in Xls() 424 putchar("-fc-d-b---l-s-w-"[(sb->st_mode & S_IFMT) >> 12]); in ls() 425 lsrwx(sb->st_mode >> 6, (sb->st_mode & S_ISUID? "sS" : "x-")); in ls() 426 lsrwx(sb->st_mode >> 3, (sb->st_mode & S_ISGID? "sS" : "x-")); in ls() 427 lsrwx(sb->st_mode , (sb->st_mode & S_ISTXT? "tT" : "x-")); in ls() 502 if (stat(path, &sb) == 0 && S_ISREG(sb.st_mode)) in upgrade() 504 if ((sb.st_mode & S_IXUSR) == 0) { in upgrade()
|
/openbsd/sys/arch/powerpc64/stand/rdboot/ |
H A D | cmd.c | 127 if (sb.st_uid || (sb.st_mode & 2)) { in read_conf() 379 if ((sb.st_mode & S_IFMT) != S_IFDIR) in Xls() 424 putchar("-fc-d-b---l-s-w-"[(sb->st_mode & S_IFMT) >> 12]); in ls() 425 lsrwx(sb->st_mode >> 6, (sb->st_mode & S_ISUID? "sS" : "x-")); in ls() 426 lsrwx(sb->st_mode >> 3, (sb->st_mode & S_ISGID? "sS" : "x-")); in ls() 427 lsrwx(sb->st_mode , (sb->st_mode & S_ISTXT? "tT" : "x-")); in ls() 502 if (stat(path, &sb) == 0 && S_ISREG(sb.st_mode)) in upgrade() 504 if ((sb.st_mode & S_IXUSR) == 0) { in upgrade()
|
H A D | rdboot.c | 135 if (sb.st_mode & S_ISTXT) { in loadrandom() 141 fchmod(fd, sb.st_mode | S_ISTXT); in loadrandom() 184 if (!S_ISREG(sb.st_mode) || sb.st_size == 0) { in kexec() 191 sb.st_mode &= ~(S_IXUSR|S_IXGRP|S_IXOTH); in kexec() 192 if (fchmod(fd, sb.st_mode) == -1) in kexec()
|
/openbsd/bin/pax/ |
H A D | file_subs.c | 87 file_mode = arcn->sb.st_mode & FILEBITS; in file_creat() 149 arcn->sb.st_mode &= ~(SETBITS); in file_close() 184 if (S_ISDIR(sb.st_mode)) { in lnk_creat() 300 if (S_ISDIR(sb.st_mode)) { in mk_link() 367 file_mode = arcn->sb.st_mode & FILEBITS; in node_creat() 379 S_ISLNK(sb.st_mode)) { in node_creat() 430 arcn->sb.st_mode); in node_creat() 486 arcn->sb.st_mode &= ~(SETBITS); in node_creat() 488 set_pmode(nm, arcn->sb.st_mode); in node_creat() 513 arcn->sb.st_mode = sb.st_mode; in node_creat() [all …]
|
/openbsd/usr.bin/mesg/ |
H A D | mesg.c | 74 sb.st_mode &= ACCESSPERMS; in main() 77 if (sb.st_mode & S_IWGRP) { in main() 87 if (chmod(tty, sb.st_mode | S_IWGRP) == -1) in main() 91 if (chmod(tty, sb.st_mode & ~S_IWGRP) == -1) in main()
|
/openbsd/usr.bin/find/ |
H A D | ls.c | 63 (void)strmode(sb->st_mode, modep); in printlong() 68 if (S_ISCHR(sb->st_mode) || S_ISBLK(sb->st_mode)) in printlong() 75 if (S_ISLNK(sb->st_mode)) in printlong()
|
/openbsd/sys/stand/boot/ |
H A D | cmd.c | 127 if (sb.st_uid || (sb.st_mode & 2)) { in read_conf() 450 if ((sb.st_mode & S_IFMT) != S_IFDIR) in Xls() 485 putchar("-fc-d-b---l-s-w-"[(sb->st_mode & S_IFMT) >> 12]); in ls() 486 lsrwx(sb->st_mode >> 6, (sb->st_mode & S_ISUID? "sS" : "x-")); in ls() 487 lsrwx(sb->st_mode >> 3, (sb->st_mode & S_ISGID? "sS" : "x-")); in ls() 488 lsrwx(sb->st_mode , (sb->st_mode & S_ISTXT? "tT" : "x-")); in ls() 560 if ((sb.st_mode & S_IXUSR) == 0) { in upgrade()
|
/openbsd/bin/ksh/ |
H A D | c_test.c | 241 return stat(opnd1, &b1) == 0 && S_ISREG(b1.st_mode); in test_eval() 243 return stat(opnd1, &b1) == 0 && S_ISDIR(b1.st_mode); in test_eval() 245 return stat(opnd1, &b1) == 0 && S_ISCHR(b1.st_mode); in test_eval() 247 return stat(opnd1, &b1) == 0 && S_ISBLK(b1.st_mode); in test_eval() 249 return stat(opnd1, &b1) == 0 && S_ISFIFO(b1.st_mode); in test_eval() 251 return lstat(opnd1, &b1) == 0 && S_ISLNK(b1.st_mode); in test_eval() 258 (b1.st_mode & S_ISUID) == S_ISUID; in test_eval() 261 (b1.st_mode & S_ISGID) == S_ISGID; in test_eval() 264 (b1.st_mode & S_ISVTX) == S_ISVTX; in test_eval() 367 else if (S_ISDIR(statb.st_mode)) in test_eaccess() [all …]
|
/openbsd/gnu/usr.bin/cvs/windows-NT/ |
H A D | filesubr.c | 58 (int) sb.st_mode & 07777)) < 0) 117 return (S_ISDIR (sb.st_mode)); 132 return (S_ISLNK (sb.st_mode)); 194 return sb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH); 219 return (sb.st_mode & umask) == umask; 221 return (sb.st_mode & gmask) == gmask; 223 return (sb.st_mode & omask) == omask; 339 mode = sb.st_mode | ~oumask & (((sb.st_mode & S_IRUSR) ? S_IWUSR : 0) | 340 ((sb.st_mode & S_IRGRP) ? S_IWGRP : 0) | 341 ((sb.st_mode & S_IROTH) ? S_IWOTH : 0)); [all …]
|
/openbsd/usr.sbin/lpr/lpc/ |
H A D | cmds.c | 133 stbuf.st_mode |= S_IXUSR; in abortpr() 134 if (chmod(line, stbuf.st_mode & 0777) < 0) in abortpr() 424 stbuf.st_mode &= ~S_IXGRP; in enablepr() 425 if (chmod(line, stbuf.st_mode & 0777) < 0) in enablepr() 492 stbuf.st_mode |= S_IXGRP; in disablepr() 573 stbuf.st_mode |= (S_IXGRP|S_IXUSR); in putmsg() 737 stbuf.st_mode &= ~(S_IXUSR|S_IXGRP); in startpr() 739 stbuf.st_mode &= ~S_IXUSR; in startpr() 926 stbuf.st_mode |= S_IXUSR; in stoppr() 1015 stbuf.st_mode |= S_IXOTH; in topq() [all …]
|
/openbsd/gnu/usr.bin/perl/t/op/ |
H A D | syscall_emulator.t | 53 my $st_mode; 79 $st_mode = unpack "L", $sb; 81 ok( ($st_mode & 0777) == ($perms & 0777), 83 $filename, $st_mode & 0777
|
/openbsd/gnu/usr.bin/cvs/vms/ |
H A D | filesubr.c | 63 if ((fdout = creat (to, (int) sb.st_mode & 07777)) < 0) 122 return (S_ISDIR (sb.st_mode)); 137 return (S_ISLNK (sb.st_mode)); 199 return sb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH); 224 return (sb.st_mode & umask) == umask; 226 return (sb.st_mode & gmask) == gmask; 228 return (sb.st_mode & omask) == omask; 347 mode = sb.st_mode | (~oumask 348 & (((sb.st_mode & S_IRUSR) ? S_IWUSR : 0) 349 | ((sb.st_mode & S_IRGRP) ? S_IWGRP : 0) [all …]
|
/openbsd/gnu/usr.bin/cvs/diff/ |
H A D | diff.c | 879 if (S_ISREG (st->st_mode)) 889 if (S_ISDIR (st->st_mode)) return "directory"; 893 if (S_ISBLK (st->st_mode)) return "block special file"; 899 if (S_ISFIFO (st->st_mode)) return "fifo"; 916 if (S_ISSOCK (st->st_mode)) return "socket"; 1023 inf[1 - i].stat.st_mode = inf[i].stat.st_mode; 1051 inf[dir_arg].dir_p = S_ISDIR (inf[dir_arg].stat.st_mode); 1094 && (! S_ISREG (inf[0].stat.st_mode) 1095 || ! S_ISREG (inf[1].stat.st_mode)))) 1130 && (inf[0].desc == -1 || S_ISREG (inf[0].stat.st_mode)) [all …]
|
/openbsd/bin/ls/ |
H A D | print.c | 104 (void)strmode(sp->st_mode, buf); in printlong() 112 if (S_ISCHR(sp->st_mode) || S_ISBLK(sp->st_mode)) in printlong() 125 if (f_type || (f_typedir && S_ISDIR(sp->st_mode))) in printlong() 126 (void)printtype(sp->st_mode); in printlong() 127 if (S_ISLNK(sp->st_mode)) in printlong() 235 if (f_type || (f_typedir && S_ISDIR(sp->st_mode))) in printaname() 236 chcnt += printtype(sp->st_mode); in printaname()
|