mescon / Muximux

A lightweight way to manage your HTPC
GNU General Public License v2.0
1.14k stars 82 forks source link

Muximux reports incorrect file owner when file permission error thrown. #88

Closed rmensing closed 7 years ago

rmensing commented 7 years ago

When the openFile() function is called in muximux.php and there is a file permission error thrown, it reports the correct file permissions but displays the incorrect file owner.
This occurs with the secret.txt problem in issues #41 and issue #50 and possibly others. This can cause additional difficulty and confusion when trying to correct the original issue.

muximux.php (lines 23-24) 23 printf("
Current permission mode of %s: %d", $file, decoct(fileperms($file) & 0777)); 24 printf("
Current owner of %s: %s", $file, posix_getpwuid(fileowner($filename))['name']);

Line 24 is calling the incorrect variable, $filename, it should ne the same variable as the line above, $file

mescon commented 7 years ago

Would you be willing to submit a fix?

rmensing commented 7 years ago

Yes, I can.
It may be a bit later tonight though.

I have only done my own projects on github and never submitted a fix before and my PHP is pretty rusty so those may slow me down a little. although it is a simple fix so my PHP shouldn;t be an issue I think.