Lines Matching defs:st

34 **		st -- if set, points to a stat structure that will
46 safefile(fn, uid, gid, user, flags, mode, st)
53 struct stat *st;
74 if (st == NULL)
75 st = &fstbuf;
83 if ((bitset(SFF_NOSLINK, flags) ? lstat(fn, st)
84 : stat(fn, st)) < 0)
86 if (stat(fn, st) < 0)
92 !bitset(S_IXUSR|S_IXGRP|S_IXOTH, st->st_mode) &&
93 S_ISREG(st->st_mode))
102 if (bitset(S_ISUID, st->st_mode))
104 if (bitset(S_ISUID, st->st_mode) && st->st_uid != 0 &&
105 st->st_uid != TrustedUid)
108 uid = st->st_uid;
112 if (bitset(S_ISGID, st->st_mode))
114 if (bitset(S_ISGID, st->st_mode) && st->st_gid != 0)
116 gid = st->st_gid;
148 if (!bitset(SFF_NOSLINK, flags) && lstat(fn, st) < 0)
252 st->st_mode = ST_MODE_NOFILE;
257 if (bitset(SFF_NOSLINK, flags) && S_ISLNK(st->st_mode))
261 (unsigned long) st->st_mode);
265 if (bitset(SFF_REGONLY, flags) && !S_ISREG(st->st_mode))
269 (unsigned long) st->st_mode);
273 bitset(S_IWGRP, st->st_mode))
277 (unsigned long) st->st_mode);
281 bitset(S_IWOTH, st->st_mode))
285 (unsigned long) st->st_mode);
288 if (bitset(SFF_NOGRFILES, flags) && bitset(S_IRGRP, st->st_mode))
292 (unsigned long) st->st_mode);
295 if (bitset(SFF_NOWRFILES, flags) && bitset(S_IROTH, st->st_mode))
299 (unsigned long) st->st_mode);
304 bitset(S_IXUSR|S_IXGRP|S_IXOTH, st->st_mode))
308 (unsigned long) st->st_mode);
311 if (bitset(SFF_NOHLINK, flags) && st->st_nlink != 1)
315 (int) st->st_nlink);
324 else if (st->st_uid == uid)
327 else if (uid == 0 && st->st_uid == TrustedUid)
333 if (st->st_gid == gid)
338 ((gr != NULL && gr->gr_gid == st->st_gid) ||
339 (gr = getgrgid(st->st_gid)) != NULL))
355 (int) st->st_uid, (int) st->st_nlink,
356 (unsigned long) st->st_mode, (unsigned long) mode);
357 if ((st->st_uid == uid || st->st_uid == 0 ||
358 st->st_uid == TrustedUid ||
360 (st->st_mode & mode) == mode)
935 struct stat st;
957 fstat(fd, &st) >= 0 &&
958 S_ISREG(st.st_mode))