Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#4099 Saving php.ini through wizards requires local write access

1.580
closed-works-for-me
Jamie Cameron
5
2012-06-19
2012-06-18
Beuc
No

Hi,

When editing php.ini through (e.g.) the "Error Logging", saving fails with a "Bad descriptor" error.

Looking at the source code, phpini/save_errors.cgi calls "&flush_file_lines_as_user" which requires write access on php.ini on the filesystem by the current user.
It seems to me that "&can_php_config" already does the job of checking whether the user has the privileges to edit the file, so the script could call "flush_file_lines" (without _as_user) instead.

WDYT?

Discussion

  • Jamie Cameron
    Jamie Cameron
    2012-06-19

    Which php.ini were you editing in this case? Also, are you logged into Webmin as root, or as a Virtualmin domain owner?

     
  • Beuc
    Beuc
    2012-06-19

    Hi,

    I'm logged in as a specific, non-root "admin" user.
    The phpini module offers me to edit the default PHP configuration in /etc/php5/apache2/php.ini (I do not specify it, it's automatically detected).

    This is plain webmin (not virtualmin) :)

    Note that it is possible to edit this php.ini manually, but not through the wizards such as "Error Logging".

     
  • Jamie Cameron
    Jamie Cameron
    2012-06-19

    Do you have the PHP Configuration module setup to write to php.ini as a different Unix user for that Webmin user? This can be seen at Webmin -> Webmin Users -> your admin user -> PHP Configuration.

     
  • Beuc
    Beuc
    2012-06-19

    Indeed I have.
    I cleared the field in Webmin -> Webmin Users -> your admin user -> PHP Configuration and now I don't get the "Bas descriptor" error anymore.
    Sorry :)

     
  • Jamie Cameron
    Jamie Cameron
    2012-06-19

    Great!

     
  • Jamie Cameron
    Jamie Cameron
    2012-06-19

    • status: open --> closed-works-for-me