plp050452 / simplesamlphp

Automatically exported from code.google.com/p/simplesamlphp
Other
0 stars 0 forks source link

AttributeMap doesn't "duplicate" attributes - white screen of failure #574

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

A config specifying "more than one" duplication of an attribute back to its own 
name will cause an infinite loop:

'class'   => 'core:AttributeMap',
'cn' => array('cn', 'urn:oid:2.5.4.3'),
'eduPersonScopedAffiliation' => 
array('urn:oid:1.3.6.1.4.1.5923.1.1.1.9','eduPersonScopedAffiliation'),

What is the expected output? What do you see instead?

It should actually duplicate the attributes as described in the config.

What version of the product are you using? On what operating system?

Using HEAD (r3277). The either of the following patches fixes the problem:

* AttributeMap-duplicate-now-works.txt <-- fixes the problem
* AttributeMap-duplicate-power.txt         <-- adds a '%copy' config option to 
allow duplication from attributemap files.

Only 1 of these files needs to be added (the 2nd incorporates changes from the 
1st).

Existing behaviour for attributemap/ files are maintained.

Original issue reported on code.google.com by schofi...@terena.org on 11 Oct 2013 at 11:28

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks! I have committed the first patch as r3278. However, regarding the 
second patch I have a few requests :)

- Please decide whether the flag should be called "duplicate" or "copy", and 
use that term as both the variable name and the name of the flag. Having two 
names for the same thing only leads to confusion.

- Please use strict comparisons in general. I.e. add the strict flag to 
in_array, and use three equal signs when comparing ($newName === "%flag"). (In 
general, one should always use strict comparison unless one needs loose 
comparisons.)

Original comment by olavmrk@gmail.com on 14 Oct 2013 at 7:02

GoogleCodeExporter commented 8 years ago
Patch with strict comparison and flag now called '%duplicate' (reflected in 
documentation + variable name). Chosen because copy implies paste. Thanks.

Original comment by schofi...@terena.org on 14 Oct 2013 at 8:25

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks! Committed in r3280.

Original comment by olavmrk@gmail.com on 14 Oct 2013 at 8:53