Commit 93f8fb1
committed
uuid: Use posix_geteuid() if it exists, instead of getmyuid()
We're trying to construct a filename which will be writable by other
requests that use the same filename. getmyuid() is not correct since it
just gives the owner of the script being executed -- requests by
different users will use the same name and thus will conflict with each
other.
posix_geteuid() is the UID used for permission checks when creating
files, so it is the correct function to call in the hypothetical
scenario where the real and effective UIDs differ.
Bug: T358768
Change-Id: Idd85308e59fcd3a96ab8ba4cdb686f1affdf774c1 parent c4e9ec2 commit 93f8fb1
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
102 | 108 | | |
103 | 109 | | |
104 | 110 | | |
| |||
0 commit comments