aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-03-19 13:18:08 +0100
committerJohn Högberg <[email protected]>2018-03-19 14:02:22 +0100
commitf14a5306622994a6b49b25c63ec882a1551398ef (patch)
treef2e1c57288f586296138e9a2c305248c98434cd7 /erts/preloaded/src
parentd171399bb5a0e9f4c6029564ece4fbf89f3c76f8 (diff)
downloadotp-f14a5306622994a6b49b25c63ec882a1551398ef.tar.gz
otp-f14a5306622994a6b49b25c63ec882a1551398ef.tar.bz2
otp-f14a5306622994a6b49b25c63ec882a1551398ef.zip
Fix file:change_group/change_owner
It wasn't possible to change group/owner separately, and our test suite lacked coverage for that. ERL-589
Diffstat (limited to 'erts/preloaded/src')
-rw-r--r--erts/preloaded/src/prim_file.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/erts/preloaded/src/prim_file.erl b/erts/preloaded/src/prim_file.erl
index 35042a7c72..432a8c15cd 100644
--- a/erts/preloaded/src/prim_file.erl
+++ b/erts/preloaded/src/prim_file.erl
@@ -618,8 +618,10 @@ write_file_info_1(Filename, Info, TimeType) ->
error:_ -> {error, badarg}
end.
-set_owner(_EncodedName, undefined, undefined) ->
- ok;
+set_owner(EncodedName, Uid, undefined) ->
+ set_owner(EncodedName, Uid, -1);
+set_owner(EncodedName, undefined, Gid) ->
+ set_owner(EncodedName, -1, Gid);
set_owner(EncodedName, Uid, Gid) ->
set_owner_nif(EncodedName, Uid, Gid).
set_owner_nif(_Path, _Uid, _Gid) ->