diff options
author | Sverker Eriksson <[email protected]> | 2014-03-12 17:07:16 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2014-03-24 21:09:49 +0100 |
commit | 2d2ce325546bc93178d1343e2a53911b890cc259 (patch) | |
tree | 9ade83ec1d0b459ac2c6f45d5979fe8248528433 /lib | |
parent | cb748a7989ed79cdac9454fe25a6b93b3b6f8393 (diff) | |
download | otp-2d2ce325546bc93178d1343e2a53911b890cc259.tar.gz otp-2d2ce325546bc93178d1343e2a53911b890cc259.tar.bz2 otp-2d2ce325546bc93178d1343e2a53911b890cc259.zip |
erts: Make file:make_symlink/2 return {error,eperm} on Windows
if the user has not the privilege SE_CREATE_SYMBOLIC_LINK_NAME
Diffstat (limited to 'lib')
-rw-r--r-- | lib/kernel/doc/src/file.xml | 7 | ||||
-rw-r--r-- | lib/kernel/test/file_SUITE.erl | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml index 7b8d2940c1..6437855f94 100644 --- a/lib/kernel/doc/src/file.xml +++ b/lib/kernel/doc/src/file.xml @@ -4,7 +4,7 @@ <erlref> <header> <copyright> - <year>1996</year><year>2013</year> + <year>1996</year><year>2014</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -642,6 +642,11 @@ <item> <p>Symbolic links are not supported on this platform.</p> </item> + <tag><c>eperm</c></tag> + <item> + <p>User does not have privileges to create symbolic links + (<c>SeCreateSymbolicLinkPrivilege</c> on Windows).</p> + </item> </taglist> </desc> </func> diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index a6e4e639f4..e4eca4b756 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -2670,6 +2670,9 @@ symlinks(Config) when is_list(Config) -> case ?FILE_MODULE:make_symlink(Name, Alias) of {error, enotsup} -> {skipped, "Links not supported on this platform"}; + {error, eperm} -> + {win32,_} = os:type(), + {skipped, "Windows user not privileged to create symlinks"}; ok -> ?line {ok, Info1} = ?FILE_MODULE:read_file_info(Name), ?line {ok, Info1} = ?FILE_MODULE:read_file_info(Alias), @@ -3596,7 +3599,11 @@ otp_10852(Config) when is_list(Config) -> ok = rpc_call(Node, list_dir_all, [B]), ok = rpc_call(Node, read_file, [B]), ok = rpc_call(Node, make_link, [B,B]), - ok = rpc_call(Node, make_symlink, [B,B]), + case rpc_call(Node, make_symlink, [B,B]) of + ok -> ok; + {error, E} when (E =:= enotsup) or (E =:= eperm) -> + {win32,_} = os:type() + end, ok = rpc_call(Node, delete, [B]), ok = rpc_call(Node, make_dir, [B]), ok = rpc_call(Node, del_dir, [B]), |