aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-02-02 11:09:50 +0100
committerBjörn Gustavsson <[email protected]>2011-02-14 11:49:47 +0100
commiteb6d08af973484e37e3efb0f159cf732cc618e2a (patch)
tree21db93b77d326f374687518852da26b0fc95a3d8 /lib/kernel/src
parent62dad961329a603110ce0e1d3f62554cc5228152 (diff)
downloadotp-eb6d08af973484e37e3efb0f159cf732cc618e2a.tar.gz
otp-eb6d08af973484e37e3efb0f159cf732cc618e2a.tar.bz2
otp-eb6d08af973484e37e3efb0f159cf732cc618e2a.zip
Never allow os:find_executable/1 to return the path of directories
Diffstat (limited to 'lib/kernel/src')
-rw-r--r--lib/kernel/src/os.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/kernel/src/os.erl b/lib/kernel/src/os.erl
index 75a11a8afd..ce8c581e08 100644
--- a/lib/kernel/src/os.erl
+++ b/lib/kernel/src/os.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -82,8 +82,9 @@ verify_executable(Name0, [Ext|Rest], OrigExtensions) ->
end;
_ ->
case file:read_file_info(Name1) of
- {ok, #file_info{mode=Mode}} when Mode band 8#111 =/= 0 ->
- %% XXX This test for execution permission is not full-proof
+ {ok, #file_info{type=regular,mode=Mode}}
+ when Mode band 8#111 =/= 0 ->
+ %% XXX This test for execution permission is not fool-proof
%% on Unix, since we test if any execution bit is set.
{ok, Name1};
_ ->