Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/riak_core_security.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1085,15 +1085,15 @@ match_source([{UserName, {IP,Mask}, Source, Options}|Tail], User, PeerIP) ->

sort_sources(Sources) ->
%% sort sources first by userlist, so that 'all' matches come last
%% and then by CIDR, so that most sprcific masks come first
%% and then by CIDR, so that most specific masks come first
Sources1 = lists:sort(fun({UserA, _, _, _}, {UserB, _, _, _}) ->
case {UserA, UserB} of
{all, all} ->
true;
{all, _} ->
%% anything is greater than 'all'
true;
{_, all} ->
%% anything should come before 'all'
true;
{all, _} ->
false;
{_, _} ->
true
Expand Down Expand Up @@ -1129,10 +1129,10 @@ group_sources(Sources) ->
case {UserA, UserB} of
{[all], [all]} ->
true;
{[all], _} ->
%% anything is greater than 'all'
true;
{_, [all]} ->
%% anything should come before 'all'
true;
{[all], _} ->
false;
{_, _} ->
true
Expand Down
Loading