summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2013-12-01 17:16:47 -0600
committerCraig A. Berry <craigberry@mac.com>2013-12-02 22:45:36 -0600
commitf0d85c30acfcf77bee20b9f00a787e5b796dff9c (patch)
treea1a38c601d1b5119a6849b8666539b16add2a7dd /doio.c
parent1dcae8b8dd1e2aa373ab045fee3d4f95d34f0b3c (diff)
downloadperl-f0d85c30acfcf77bee20b9f00a787e5b796dff9c.tar.gz
Check unlink on directory for all users, not just root.
For cross-platform consistency, it makes more sense to reject unlink attempts on directories in the same way for all users rather than only for root. geteuid() always returns zero on Windows, never returns zero on VMS, and is a poor indicator of privilege on modern unixen, so the code really hasn't been working as intended on all platforms anyway.
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/doio.c b/doio.c
index 56d33b2c62..b80460aa54 100644
--- a/doio.c
+++ b/doio.c
@@ -1816,7 +1816,7 @@ nothing in the core.
if (!IS_SAFE_PATHNAME(s, len, "unlink")) {
tot--;
}
- else if (PerlProc_geteuid() || PL_unsafe) {
+ else if (PL_unsafe) {
if (UNLINK(s))
tot--;
}