system.inc.php is deprecated

Discussion in 'Developers' Forum' started by jwarnier, Aug 20, 2010.

  1. jwarnier

    jwarnier New Member

    I noticed server/lib/classes/system.inc.php is deprecated (not "required" from anywhere).
    While the features in it would benefit the overall code size.
    Would you mind if we reworked this file and used the features from the other scripts?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Some of the functions from system.inc.php are in use be plugins, so it is not deprecated. If I remember correctly, the apache plugin or one of the shell user plugins use functions from this file.

    I'am aware that a lot of functions in that file are not in use and I will remove them when I have a bit free time.
     
  3. jmontoya

    jmontoya New Member

    This is a list of functions I found that uses the $app->system calls that I didn't find before.

    The including file method is: $app->uses("system");
    I was looking for some "require_once" before.

    apache plugin and others:

    • is_group
    • is_user
    • add_user_to_group

    mail plugin

    • maildirmake

    shell user plugin

    • getuid


    I didn't find calls of chmod, chown, etc...
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, thats correct. As I mentioned above, just a few functions from this library are currently in use. So the file is not deprecated, it just needs a bit cleaning.
     
  5. jwarnier

    jwarnier New Member

    I my quest to remove as many calls to exec(), system(), etc... I feel the need (as a start) for smart (recursive) chown(), chgrp(), chmod(), which could be there (and replace the not-so-smart current ones).
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, that would be a good improvement. For all other calls were we dont have a generic function I wanted to replace all exec() and system() calls by calls to (new) functions $app->system->exec() and $app->system->system() so we can add some logging code and maybe additional security checks.

    One function that might be good for security too is to write our own recursive rm function where we can set the owner of the files that shall be deleted as parameter, so this function deletes only files of a specific owner.
     

Share This Page