View Single Post
  #10  
Old 8th February 2006, 20:06
st2xo st2xo is offline
Member
 
Join Date: Jan 2006
Location: Wiesloch [DE]
Posts: 47
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko
root is not ok. Then something's strange on your system...
Hi Falko

I found the "root" the code in
/root/ispconfig/scripts/lib/config.lib.php
in function
apache_user(), Line 1777
If I put in a hardcoded wwwrun all file permissions will be ok.

Code:
function apache_user(){
  global $mod;
  $httpd_conf = $mod->system->server_conf["dist_httpd_conf"];
  $includes = $mod->file->find_includes($httpd_conf);
  $anz_includes = sizeof($includes);
  for($i=0;$i<$anz_includes;$i++){
    $includes[$i] = $mod->file->unix_nl($mod->file->no_comments($includes[$i]));
    if($line = $mod->system->grep($includes[$i], "User", "w")){
      $lines = explode("\n", $line);
      $line = $lines[0];
      $line = trim($line);
      while(strstr($line, "  ")){
        $line = str_replace("  ", " ", $line);
      }
      list($f1, $apache_user) = explode(" ", $line);
      $apache_user = trim($apache_user);
      $i = $anz_includes;
    }
  }
  # st2xo: $apache_user is nowhere set in this function...
  if(isset($apache_user) && $mod->system->is_user($apache_user)){
    # ... so this never will be returned
    return $apache_user;
  } else {
    # ... and root will be returned in every case
    return "root";
  }
}
How will be the variable $apache_user set in the function apache_user()?
I think there is a global $apache_user or something like that missing.

Or IŽam completely wrong now?
__________________
regards,
Stefan.
Reply With Quote