diff --git a/Limit.hs b/Limit.hs index 483336eb9f..5d00e2e688 100644 --- a/Limit.hs +++ b/Limit.hs @@ -163,6 +163,8 @@ addCopies = addLimit . limitCopies limitCopies :: MkLimit Annex limitCopies want = case splitc ':' want of + -- Note that in case of a group having the same name as a trust + -- level, it's parsed as a trust level, not as a group. [v, n] -> case parsetrustspec v of Just checker -> go n $ checktrust checker Nothing -> go n $ checkgroup v diff --git a/doc/bugs/Missing_sanity_check_of_group_names._Special_group_names_should_not_be_allowed./comment_1_b4ba41b6e0e611d90ddda92bbe991266._comment b/doc/bugs/Missing_sanity_check_of_group_names._Special_group_names_should_not_be_allowed./comment_1_b4ba41b6e0e611d90ddda92bbe991266._comment new file mode 100644 index 0000000000..4bd9247927 --- /dev/null +++ b/doc/bugs/Missing_sanity_check_of_group_names._Special_group_names_should_not_be_allowed./comment_1_b4ba41b6e0e611d90ddda92bbe991266._comment @@ -0,0 +1,22 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2018-06-04T16:06:57Z" + content=""" +Thanks for pointing out this ambiguity, which I don't remember having +ever considered. + +The code for this does look for the name of a trust level first, +and only a group name if it's not a trust level. So, adding a group +with a colliding name will never change the behavior of such a command +or preferred content expression. + +The only problem then would be that you couldn't match +on a group by that name. But if you run into that problem, +you can simply rename your group. + +So I don't think that git-annex needs a sanity check, really. + +(I have added a comment in the code to make clear that the order of +parsing this does matter.) +"""]]