tests/test-trusted.py.out
changeset 3552 9b52239dc740
parent 3551 3b07e223534b
child 8141 e40b629bedd1
equal deleted inserted replaced
3551:3b07e223534b 3552:9b52239dc740
     1 # same user, same group
     1 # same user, same group
     2     global = /some/path
     2 trusted
     3     local = /another/path
     3     global = /some/path
       
     4     interpolated = /some/path/another/path
       
     5     local = /another/path
       
     6 untrusted
       
     7 . . global = /some/path
       
     8 . . interpolated = /some/path/another/path
       
     9 . . local = /another/path
     4 
    10 
     5 # same user, different group
    11 # same user, different group
     6     global = /some/path
    12 trusted
     7     local = /another/path
    13     global = /some/path
       
    14     interpolated = /some/path/another/path
       
    15     local = /another/path
       
    16 untrusted
       
    17 . . global = /some/path
       
    18 . . interpolated = /some/path/another/path
       
    19 . . local = /another/path
     8 
    20 
     9 # different user, same group
    21 # different user, same group
    10 Not reading file .hg/hgrc from untrusted user abc, group bar
    22 Not trusting file .hg/hgrc from untrusted user abc, group bar
    11     global = /some/path
    23 trusted
       
    24     global = /some/path
       
    25 untrusted
       
    26 . . global = /some/path
       
    27 . . interpolated = /some/path/another/path
       
    28 . . local = /another/path
    12 
    29 
    13 # different user, same group, but we trust the group
    30 # different user, same group, but we trust the group
    14     global = /some/path
    31 trusted
    15     local = /another/path
    32     global = /some/path
    16 
    33     interpolated = /some/path/another/path
    17 # different user, different group
    34     local = /another/path
    18 Not reading file .hg/hgrc from untrusted user abc, group def
    35 untrusted
    19     global = /some/path
    36 . . global = /some/path
       
    37 . . interpolated = /some/path/another/path
       
    38 . . local = /another/path
       
    39 
       
    40 # different user, different group
       
    41 Not trusting file .hg/hgrc from untrusted user abc, group def
       
    42 trusted
       
    43     global = /some/path
       
    44 untrusted
       
    45 . . global = /some/path
       
    46 . . interpolated = /some/path/another/path
       
    47 . . local = /another/path
    20 
    48 
    21 # different user, different group, but we trust the user
    49 # different user, different group, but we trust the user
    22     global = /some/path
    50 trusted
    23     local = /another/path
    51     global = /some/path
       
    52     interpolated = /some/path/another/path
       
    53     local = /another/path
       
    54 untrusted
       
    55 . . global = /some/path
       
    56 . . interpolated = /some/path/another/path
       
    57 . . local = /another/path
    24 
    58 
    25 # different user, different group, but we trust the group
    59 # different user, different group, but we trust the group
    26     global = /some/path
    60 trusted
    27     local = /another/path
    61     global = /some/path
       
    62     interpolated = /some/path/another/path
       
    63     local = /another/path
       
    64 untrusted
       
    65 . . global = /some/path
       
    66 . . interpolated = /some/path/another/path
       
    67 . . local = /another/path
    28 
    68 
    29 # different user, different group, but we trust the user and the group
    69 # different user, different group, but we trust the user and the group
    30     global = /some/path
    70 trusted
    31     local = /another/path
    71     global = /some/path
       
    72     interpolated = /some/path/another/path
       
    73     local = /another/path
       
    74 untrusted
       
    75 . . global = /some/path
       
    76 . . interpolated = /some/path/another/path
       
    77 . . local = /another/path
    32 
    78 
    33 # we trust all users
    79 # we trust all users
    34 # different user, different group
    80 # different user, different group
    35     global = /some/path
    81 trusted
    36     local = /another/path
    82     global = /some/path
       
    83     interpolated = /some/path/another/path
       
    84     local = /another/path
       
    85 untrusted
       
    86 . . global = /some/path
       
    87 . . interpolated = /some/path/another/path
       
    88 . . local = /another/path
    37 
    89 
    38 # we trust all groups
    90 # we trust all groups
    39 # different user, different group
    91 # different user, different group
    40     global = /some/path
    92 trusted
    41     local = /another/path
    93     global = /some/path
       
    94     interpolated = /some/path/another/path
       
    95     local = /another/path
       
    96 untrusted
       
    97 . . global = /some/path
       
    98 . . interpolated = /some/path/another/path
       
    99 . . local = /another/path
    42 
   100 
    43 # we trust all users and groups
   101 # we trust all users and groups
    44 # different user, different group
   102 # different user, different group
    45     global = /some/path
   103 trusted
    46     local = /another/path
   104     global = /some/path
       
   105     interpolated = /some/path/another/path
       
   106     local = /another/path
       
   107 untrusted
       
   108 . . global = /some/path
       
   109 . . interpolated = /some/path/another/path
       
   110 . . local = /another/path
    47 
   111 
    48 # we don't get confused by users and groups with the same name
   112 # we don't get confused by users and groups with the same name
    49 # different user, different group
   113 # different user, different group
    50 Not reading file .hg/hgrc from untrusted user abc, group def
   114 Not trusting file .hg/hgrc from untrusted user abc, group def
    51     global = /some/path
   115 trusted
       
   116     global = /some/path
       
   117 untrusted
       
   118 . . global = /some/path
       
   119 . . interpolated = /some/path/another/path
       
   120 . . local = /another/path
    52 
   121 
    53 # list of user names
   122 # list of user names
    54 # different user, different group, but we trust the user
   123 # different user, different group, but we trust the user
    55     global = /some/path
   124 trusted
    56     local = /another/path
   125     global = /some/path
       
   126     interpolated = /some/path/another/path
       
   127     local = /another/path
       
   128 untrusted
       
   129 . . global = /some/path
       
   130 . . interpolated = /some/path/another/path
       
   131 . . local = /another/path
    57 
   132 
    58 # list of group names
   133 # list of group names
    59 # different user, different group, but we trust the group
   134 # different user, different group, but we trust the group
    60     global = /some/path
   135 trusted
    61     local = /another/path
   136     global = /some/path
       
   137     interpolated = /some/path/another/path
       
   138     local = /another/path
       
   139 untrusted
       
   140 . . global = /some/path
       
   141 . . interpolated = /some/path/another/path
       
   142 . . local = /another/path
    62 
   143 
    63 # Can't figure out the name of the user running this process
   144 # Can't figure out the name of the user running this process
    64 # different user, different group
   145 # different user, different group
    65     global = /some/path
   146 trusted
    66     local = /another/path
   147     global = /some/path
    67 
   148     interpolated = /some/path/another/path
       
   149     local = /another/path
       
   150 untrusted
       
   151 . . global = /some/path
       
   152 . . interpolated = /some/path/another/path
       
   153 . . local = /another/path
       
   154 
       
   155 # prints debug warnings
       
   156 # different user, different group
       
   157 Not trusting file .hg/hgrc from untrusted user abc, group def
       
   158 trusted
       
   159 Ignoring untrusted configuration option paths.interpolated = /some/path/another/path
       
   160 Ignoring untrusted configuration option paths.local = /another/path
       
   161     global = /some/path
       
   162 untrusted
       
   163 . . global = /some/path
       
   164 .Ignoring untrusted configuration option paths.interpolated = /some/path/another/path
       
   165  . interpolated = /some/path/another/path
       
   166 .Ignoring untrusted configuration option paths.local = /another/path
       
   167  . local = /another/path
       
   168 
       
   169 # ui.readsections
       
   170 quux
       
   171 
       
   172 # read trusted, untrusted, new ui, trusted
       
   173 Not trusting file foobar from untrusted user abc, group def
       
   174 trusted:
       
   175 Ignoring untrusted configuration option foobar.baz = quux
       
   176 None
       
   177 /some/path/another/path
       
   178 untrusted:
       
   179 quux
       
   180 /some/path/another/path
       
   181 
       
   182 # error handling
       
   183 # file doesn't exist
       
   184 # same user, same group
       
   185 # different user, different group
       
   186 
       
   187 # parse error
       
   188 # different user, different group
       
   189 Not trusting file .hg/hgrc from untrusted user abc, group def
       
   190 Ignored: Failed to parse .hg/hgrc
       
   191 File contains no section headers.
       
   192 file: .hg/hgrc, line: 1
       
   193 'foo = bar'
       
   194 # same user, same group
       
   195 raised Abort
       
   196 
       
   197 # interpolation error
       
   198 # same user, same group
       
   199 # regular config:
       
   200   trusted raised Abort
       
   201 untrusted raised Abort
       
   202 # different user, different group
       
   203 Not trusting file .hg/hgrc from untrusted user abc, group def
       
   204   trusted Ignored: Error in configuration section [foo] parameter 'bar':
       
   205 bad interpolation variable reference '%('
       
   206  None
       
   207 untrusted raised Abort
       
   208 # configitems:
       
   209   trusted Ignored: Error in configuration section [foo]:
       
   210 bad interpolation variable reference '%('
       
   211  []
       
   212 untrusted raised Abort