#3750 chroot mode in API file_chooser_button

All
closed-works-for-me
nobody
None
5
2010-09-03
2010-09-03
Anonymous
No

When i'm using file_chooser_button with chroot set to "/opt" ,I expect to get /opt/test1 return ,instead "/test1" . This shoudn't be the normal behavior?
Anyway,I add a parameter to javascript filechosen in chooser.cgi to accomplish it.

BTW,in chroot mode,you also have to deal with the $rootdir to avoid getting values like "//opt/test1" .
In my way ,I check $rootdir eq "/" in line 84 and line 89 in chooser.cgi ,version 1.52

Discussion

  • Jamie Cameron
    Jamie Cameron
    2010-09-03

    • status: open --> closed-works-for-me
     
  • Jamie Cameron
    Jamie Cameron
    2010-09-03

    That is expected - in chroot mode, the user isn't supposed to be aware that other directories even exist.

    Since you are calling the function with a chroot path under your control, you should be able to prepend the chroot directory pretty easily when parsing the field.