Home
last modified time | relevance | path

Searched refs:st_mode (Results 1 – 25 of 561) sorted by relevance

12345678910>>...23

/NextBSD/contrib/libarchive/libarchive/test/
HDtest_write_disk_perms.c167 failure("file_overwrite_0144: st.st_mode=%o", st.st_mode); in DEFINE_TEST()
168 assert((st.st_mode & 07777) != 0144); in DEFINE_TEST()
190 failure("dir_overwrite_0744: st.st_mode=%o", st.st_mode); in DEFINE_TEST()
191 assert((st.st_mode & 0777) == 0744); in DEFINE_TEST()
201 failure("dir_overwrite_0744: st.st_mode=%o", st.st_mode); in DEFINE_TEST()
202 assert((st.st_mode & 0777) == 0744); in DEFINE_TEST()
373 failure("file_0755: st.st_mode=%o", st.st_mode); in DEFINE_TEST()
374 assert((st.st_mode & 07777) == 0755); in DEFINE_TEST()
377 failure("file_overwrite_0144: st.st_mode=%o", st.st_mode); in DEFINE_TEST()
378 assert((st.st_mode & 07777) == 0144); in DEFINE_TEST()
[all …]
HDtest_write_disk_secure.c128 assert(S_ISLNK(st.st_mode)); in DEFINE_TEST()
150 assert(S_ISDIR(st.st_mode)); in DEFINE_TEST()
178 assert(S_ISDIR(st.st_mode)); in DEFINE_TEST()
185 failure("dir: st.st_mode=%o", st.st_mode); in DEFINE_TEST()
186 assert((st.st_mode & 0777) == 0755); in DEFINE_TEST()
189 failure("link_to_dir: st.st_mode=%o", st.st_mode); in DEFINE_TEST()
190 assert(S_ISLNK(st.st_mode)); in DEFINE_TEST()
193 failure("link_to_dir: st.st_mode=%o", st.st_mode); in DEFINE_TEST()
194 assert((st.st_mode & 07777) == 0755); in DEFINE_TEST()
198 failure("dir/filea: st.st_mode=%o", st.st_mode); in DEFINE_TEST()
[all …]
/NextBSD/contrib/diff/lib/
HDfile-type.c41 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()
/NextBSD/usr.bin/biff/
HDbiff.c81 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()
/NextBSD/usr.sbin/fmtree/
HDcompare.c88 if (!S_ISBLK(p->fts_statp->st_mode)) in compare()
92 if (!S_ISCHR(p->fts_statp->st_mode)) in compare()
96 if (!S_ISDIR(p->fts_statp->st_mode)) in compare()
100 if (!S_ISFIFO(p->fts_statp->st_mode)) in compare()
104 if (!S_ISREG(p->fts_statp->st_mode)) in compare()
108 if (!S_ISLNK(p->fts_statp->st_mode)) in compare()
112 if (!S_ISSOCK(p->fts_statp->st_mode)) { in compare()
115 ftype(s->type), inotype(p->fts_statp->st_mode)); in compare()
150 !S_ISLNK(p->fts_statp->st_mode) && in compare()
151 s->st_mode != (p->fts_statp->st_mode & MBITS)) { in compare()
[all …]
HDcreate.c161 if (iflag || S_ISDIR(p->fts_statp->st_mode)) in statf()
173 if (!S_ISREG(p->fts_statp->st_mode) && !dflag) in statf()
174 output(indent, &offset, "type=%s", inotype(p->fts_statp->st_mode)); in statf()
207 if (keys & F_MODE && (p->fts_statp->st_mode & MBITS) != mode) in statf()
208 output(indent, &offset, "mode=%#o", p->fts_statp->st_mode & MBITS); in statf()
211 if (keys & F_SIZE && S_ISREG(p->fts_statp->st_mode)) in statf()
218 if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { in statf()
226 if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { in statf()
236 if (keys & F_SHA1 && S_ISREG(p->fts_statp->st_mode)) { in statf()
246 if (keys & F_RMD160 && S_ISREG(p->fts_statp->st_mode)) { in statf()
[all …]
/NextBSD/contrib/mtree/
HDcreate.c192 S_ISDIR(p->fts_statp->st_mode) ? "" : " ", vispath(p->fts_name)); in statf()
200 if (!S_ISREG(p->fts_statp->st_mode) && (flavor == F_NETBSD6 || !dflag)) in statf()
202 inotype(p->fts_statp->st_mode)); in statf()
219 if (keys & F_MODE && (p->fts_statp->st_mode & MBITS) != mode) in statf()
221 p->fts_statp->st_mode & MBITS); in statf()
223 (S_ISBLK(p->fts_statp->st_mode) || S_ISCHR(p->fts_statp->st_mode))) in statf()
229 (flavor == F_FREEBSD9 || S_ISREG(p->fts_statp->st_mode))) in statf()
241 if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { in statf()
249 if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { in statf()
258 if (keys & F_RMD160 && S_ISREG(p->fts_statp->st_mode)) { in statf()
[all …]
HDcompare.c149 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 …]
/NextBSD/contrib/atf/atf-c/detail/
HDfs.c555 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 …]
/NextBSD/contrib/opie/libopie/
HDlock.c128 if (!S_ISDIR(statbuf[0].st_mode)) {
135 if ((statbuf[0].st_mode & 0777) != 00700) {
148 if (!S_ISREG(statbuf[0].st_mode))
156 if (statbuf[0].st_mode != statbuf[1].st_mode)
202 …if (!S_ISREG(statbuf[0].st_mode) || (statbuf[0].st_mode != statbuf[1].st_mode) || (statbuf[0].st_i…
/NextBSD/bin/ls/
HDprint.c257 strmode(sp->st_mode, buf); in printlong()
260 xo_attr("value", "%03o", (int) sp->st_mode & ALLPERMS); in printlong()
263 buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, in printlong()
267 buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, in printlong()
270 if (S_ISBLK(sp->st_mode)) in printlong()
272 if (S_ISCHR(sp->st_mode)) in printlong()
274 if (S_ISDIR(sp->st_mode)) in printlong()
276 if (S_ISFIFO(sp->st_mode)) in printlong()
278 if (S_ISLNK(sp->st_mode)) in printlong()
280 if (S_ISREG(sp->st_mode)) in printlong()
[all …]
/NextBSD/bin/cp/
HDutils.c136 fs->st_mode & ~(S_ISUID | S_ISGID)); in copy_file()
144 fs->st_mode & ~(S_ISUID | S_ISGID)); in copy_file()
164 if (S_ISREG(fs->st_mode) && fs->st_size > 0 && in copy_file()
317 if (mkfifo(to.p_path, from_stat->st_mode)) { in copy_fifo()
337 if (mknod(to.p_path, from_stat->st_mode, from_stat->st_rdev)) { in copy_special()
353 islink = !fdval && S_ISLNK(fs->st_mode); in setfile()
354 fs->st_mode &= S_ISUID | S_ISGID | S_ISVTX | in setfile()
369 ts.st_mode &= S_ISUID | S_ISGID | S_ISVTX | in setfile()
386 fs->st_mode &= ~(S_ISUID | S_ISGID); in setfile()
389 if (!gotstat || fs->st_mode != ts.st_mode) in setfile()
[all …]
HDcp.c220 if (r == -1 || !S_ISDIR(to_stat.st_mode)) { in main()
240 if (S_ISDIR(tmp_stat.st_mode) && Rflag) in main()
379 mode = curr->fts_statp->st_mode; in copy()
400 if (S_ISDIR(curr->fts_statp->st_mode)) in copy()
404 if (!S_ISDIR(curr->fts_statp->st_mode) && in copy()
405 S_ISDIR(to_stat.st_mode)) { in copy()
415 switch (curr->fts_statp->st_mode & S_IFMT) { in copy()
446 curr->fts_statp->st_mode | S_IRWXU) < 0) in copy()
448 } else if (!S_ISDIR(to_stat.st_mode)) { in copy()
/NextBSD/contrib/file/src/
HDfsmagic.c141 sb->st_mode = S_IFBLK; in file_fsmagic()
146 sb->st_mode |= S_IFCHR; in file_fsmagic()
147 sb->st_mode &= ~S_IFREG; in file_fsmagic()
150 sb->st_mode |= S_IFIFO; in file_fsmagic()
151 sb->st_mode &= ~S_IFREG; in file_fsmagic()
173 if (sb->st_mode & S_ISUID) in file_fsmagic()
178 if (sb->st_mode & S_ISGID) in file_fsmagic()
183 if (sb->st_mode & S_ISVTX) in file_fsmagic()
189 switch (sb->st_mode & S_IFMT) { in file_fsmagic()
397 file_error(ms, 0, "invalid mode 0%o", sb->st_mode); in file_fsmagic()
/NextBSD/usr.sbin/fifolog/lib/
HDfifolog_create.c69 if (!S_ISBLK(st.st_mode) && in fifolog_create()
70 !S_ISCHR(st.st_mode) && in fifolog_create()
71 !S_ISREG(st.st_mode)) { in fifolog_create()
76 if(!created && S_ISREG(st.st_mode)) { in fifolog_create()
91 if (size == 0 && S_ISREG(st.st_mode)) in fifolog_create()
97 if (S_ISREG(st.st_mode) && ftruncate(fd, size) < 0) in fifolog_create()
/NextBSD/crypto/heimdal/appl/ftp/ftpd/
HDls.c159 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 …]
/NextBSD/bin/getfacl/
HDgetfacl.c114 if (sb.st_mode & S_IRUSR) in acl_from_stat()
117 if (sb.st_mode & S_IWUSR) in acl_from_stat()
120 if (sb.st_mode & S_IXUSR) in acl_from_stat()
138 if (sb.st_mode & S_IRGRP) in acl_from_stat()
141 if (sb.st_mode & S_IWGRP) in acl_from_stat()
144 if (sb.st_mode & S_IXGRP) in acl_from_stat()
162 if (sb.st_mode & S_IROTH) in acl_from_stat()
165 if (sb.st_mode & S_IWOTH) in acl_from_stat()
168 if (sb.st_mode & S_IXOTH) in acl_from_stat()
/NextBSD/bin/pax/
HDfile_subs.c92 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 …]
/NextBSD/contrib/libarchive/libarchive/
HDarchive_read_open_filename.c77 mode_t st_mode; /* Mode bits for opened file. */ member
132 mine->st_mode = mine->use_lseek = 0; in archive_read_open_filenames()
308 if (S_ISREG(st.st_mode)) { in file_open()
316 else if (S_ISCHR(st.st_mode) && in file_open()
323 else if ((S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode)) && in file_open()
330 else if (S_ISCHR(st.st_mode) && in file_open()
337 else if (S_ISBLK(st.st_mode) && in file_open()
366 mine->st_mode = st.st_mode; in file_open()
541 if (!S_ISREG(mine->st_mode) in file_close2()
542 && !S_ISCHR(mine->st_mode) in file_close2()
[all …]
/NextBSD/bin/test/
HDtest.c383 if (S_ISDIR(s.st_mode) || geteuid() != 0) in filstat()
385 return (s.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0; in filstat()
389 return S_ISREG(s.st_mode); in filstat()
391 return S_ISDIR(s.st_mode); in filstat()
393 return S_ISCHR(s.st_mode); in filstat()
395 return S_ISBLK(s.st_mode); in filstat()
397 return S_ISFIFO(s.st_mode); in filstat()
399 return S_ISSOCK(s.st_mode); in filstat()
401 return S_ISLNK(s.st_mode); in filstat()
403 return (s.st_mode & S_ISUID) != 0; in filstat()
[all …]
/NextBSD/bin/chmod/
HDchmod.c183 newmode = getmode(set, p->fts_statp->st_mode); in main()
190 (newmode & ALLPERMS) == (p->fts_statp->st_mode & ALLPERMS)) in main()
202 strmode(p->fts_statp->st_mode, m1); in main()
203 strmode((p->fts_statp->st_mode & in main()
206 p->fts_statp->st_mode, m1, in main()
207 (p->fts_statp->st_mode & S_IFMT) | in main()
/NextBSD/bin/ln/
HDln.c159 if (hflag && lstat(targetdir, &sb) == 0 && S_ISLNK(sb.st_mode)) { in main()
169 if (!S_ISDIR(sb.st_mode)) in main()
239 if (S_ISDIR(sb.st_mode)) { in linkit()
251 (lstat(target, &sb) == 0 && S_ISDIR(sb.st_mode)) || in linkit()
252 (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode))) { in linkit()
306 if (Fflag && S_ISDIR(sb.st_mode)) { in linkit()
327 if (Fflag && S_ISDIR(sb.st_mode)) { in linkit()
/NextBSD/usr.sbin/pw/
HDcpdir.c85 if (S_ISDIR(st.st_mode)) { in copymkdir()
87 st.st_mode & _DEF_DIRMODE, uid, gid, st.st_flags); in copymkdir()
91 if (S_ISLNK(st.st_mode) && in copymkdir()
100 if (!S_ISREG(st.st_mode)) in copymkdir()
106 st.st_mode); in copymkdir()
/NextBSD/bin/mv/
HDmv.c123 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()
313 oldmode = sbp->st_mode & ALLPERMS; in fastcopy()
321 sbp->st_mode &= ~(S_ISUID | S_ISGID); in fastcopy()
324 if (fchmod(to_fd, sbp->st_mode)) in fastcopy()
380 if (S_ISDIR(sb.st_mode)) { in copy()
/NextBSD/usr.bin/compress/
HDcompress.c205 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()
366 fs->st_mode &= S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO; in setfile()
382 fs->st_mode &= ~(S_ISUID|S_ISGID); in setfile()
384 if (chmod(name, fs->st_mode) && errno != EOPNOTSUPP) in setfile()

12345678910>>...23