#12 Slash proliferation in policy file

closed-fixed
None
5
2007-04-04
2007-03-22
No

When using Tahiti's interface to edit permissions, the number of slashes in the URL of the codeBase being saved increases at each saving.

Discussion

  • Thomas Herlea

    Thomas Herlea - 2007-04-03

    Logged In: YES
    user_id=509091
    Originator: YES

    Bug confirmed both on Linux and on Windows.

    Bug affects at least release 2.0.2.

     
  • Thomas Herlea

    Thomas Herlea - 2007-04-03
    • status: open --> open-accepted
     
  • Thomas Herlea

    Thomas Herlea - 2007-04-03

    Logged In: YES
    user_id=509091
    Originator: YES

    Steps to reproduce bug:

    1. Install from scratch the aglets server from the JAR provided on SourceForge. (If your current installation contains precious data, use a different account or back up your current setup.)
    2. Start Tahiti, this will create 'aglets.policy' as a copy of 'sample.policy'.
    3. View the contents of 'aglets.policy'. At the end there is a grant entry for codeBase "file:///-/" (remember that there are 3 slashes between ':' and '-').
    4. In Tahity go to menu "Options > Security Preference" and look at the "file" codebase.
    5. Number of slashes between ':' and '-': expected 3, obtained 5!
    6. View the current contents of 'aglets.policy' and look at the grant entry for codeBase "file:///-/".
    7. Number of slashes between ':' and '-': expected 3, obtained 3.
    8. Close the "Security Preference" dialog with OK.
    9. View the current contents of 'aglets.policy' and look at the grant entry for codeBase "file:///-/".
    10. Number of slashes between ':' and '-': expected 3, obtained 7!
    11. If you reboot the server in the shutdown dialog that appears next and return to step 4, you will obtain 9 slashes in the interface and 11 in the saved file, then 13 and 15 and so on.

    It seems that both the policy file parser and the saver add two slashes.

     
  • Thomas Herlea

    Thomas Herlea - 2007-04-04

    Logged In: YES
    user_id=509091
    Originator: YES

    Bug fixed with the attached patch. There is room for solving this more robustly.

    Bug mechanism: the src.com.ibm.awb.misc.URIPattern class was always adding two slashes (from "schema://host...") when converting a URL to a string, even though for the "file" schema it didn't consume two slashes when parsing.

    Fix mechanism: now the two slashes are only added when appropriate.

    The two new slashes in the GUI and the four new slashes in the policy file have their explanation in the parse-convert action pairs that occur when editing the policy:
    - once when strings from the policy file are parsed into grant objects, which are then converted to strings for displaying in the GUI (bug added '//')
    - again, when strings from the GUI are parsed into grant objects, which then are converted to strings for writing them to the policy file (bug added '//' again)

    File Added: bug1686403.patch

     
  • Thomas Herlea

    Thomas Herlea - 2007-04-04
    • status: open-accepted --> closed-fixed
     
  • Thomas Herlea

    Thomas Herlea - 2007-04-04

    Patch for bug 1686403

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks