~mdw
/
checkpath
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tmpdir: Ignore environment variables; use effective uid only.
[checkpath]
/
tmpdir.c
diff --git
a/tmpdir.c
b/tmpdir.c
index
0920341
..
b2881c8
100644
(file)
--- a/
tmpdir.c
+++ b/
tmpdir.c
@@
-205,16
+205,12
@@
static char *goodtmp(void)
/* --- Try making a directory in `/tmp' --- */
/* --- Try making a directory in `/tmp' --- */
- if (!(q = getenv("USER")) && !(q = getenv("LOGNAME")))
- q = pw->pw_name;
- if ((q = trytmp("/tmp", q)) != 0)
+ if ((q = trytmp("/tmp", pw->pw_name)) != 0)
return (q);
/* --- That failed: try a directory in the user's home --- */
return (q);
/* --- That failed: try a directory in the user's home --- */
- if (!(q = getenv("HOME")))
- q = pw->pw_dir;
- if ((q = trytmp(q, "tmp")) != 0)
+ if ((q = trytmp(pw->pw_dir, "tmp")) != 0)
return (q);
/* --- Still no joy: give up --- *
return (q);
/* --- Still no joy: give up --- *
@@
-294,7
+290,7
@@
int main(int argc, char *argv[])
/* --- Initialize variables --- */
ego(argv[0]);
/* --- Initialize variables --- */
ego(argv[0]);
- me = getuid();
+ me = get
e
uid();
cp.cp_what = CP_WRWORLD | CP_WRGRP | CP_WROTHUSR | CP_STICKYOK;
cp.cp_verbose = 0;
cp.cp_report = 0;
cp.cp_what = CP_WRWORLD | CP_WRGRP | CP_WROTHUSR | CP_STICKYOK;
cp.cp_verbose = 0;
cp.cp_report = 0;