Lines Matching refs:fn
46 safefile(fn, uid, gid, user, flags, mode, st)
47 char *fn;
65 fn, (int) uid, (int) gid, flags, mode);
67 if (sm_strlcpy(fbuf, fn, sizeof fbuf) >= sizeof fbuf)
73 fn = fbuf;
83 if ((bitset(SFF_NOSLINK, flags) ? lstat(fn, st)
84 : stat(fn, st)) < 0)
86 if (stat(fn, st) < 0)
126 p = strrchr(fn, '/');
135 ret = safedirpath(fn, uid, gid, user,
148 if (!bitset(SFF_NOSLINK, flags) && lstat(fn, st) < 0)
165 p = strrchr(fn, '/');
173 ret = safedirpath(fn, uid, gid, user, flags, 0, 0);
188 char *dir = fn;
394 safedirpath(fn, uid, gid, user, flags, level, offset) in safedirpath() argument
395 char *fn; in safedirpath()
416 if (level < 0 || offset < 0 || offset > strlen(fn))
420 if (*fn == '\0')
421 fn = "/";
425 fn, (long) uid, (long) gid, flags, level, offset);
431 if (sm_strlcpy(s, fn, sizeof s) >= sizeof s)
663 sm_dprintf("\t[dir %s] %s\n", fn,
681 safeopen(fn, omode, cmode, sff) in safeopen() argument
682 char *fn; in safeopen()
697 fn, omode, cmode, sff);
721 rval = safefile(fn, RunAsUid, RunAsGid, RunAsUserName,
724 rval = safefile(fn, RealUid, RealGid, RealUserName,
746 fd = dfopen(fn, omode, cmode, sff);
749 if (filechanged(fn, fd, &stb))
751 syserr("554 5.3.0 cannot open: file %s changed after open", fn);
765 fn);
788 safefopen(fn, omode, cmode, sff) in safefopen() argument
789 char *fn; in safefopen()
825 fd = safeopen(fn, omode, cmode, sff);
844 fn, fmode, omode, sff, sm_errstring(errno));
864 filechanged(fn, fd, stb) in filechanged() argument
865 char *fn; in filechanged()
875 if (lstat(fn, stb) < 0 || stb->st_nlink != 1)