Some attached files with owner and group - nobody
Moderator: mkoch227
Some attached files with owner and group - nobody
I have 777 and hesk user for attachments directory, but I recieve attaches with rights "nobody", and I can't download it.. Only when I make 777 again and set group and permissions recursively I can get them. How can I solve it?
Re: Some attached files with owner and group - nobody
This all boils down to how your server is setup. Your PHP probably runs under user "Nobody" hence all the files it generates are under user "Nobody".
To fix the issue your server would need to be configured to run PHP under your account username (for example using SuPHP).
To fix the issue your server would need to be configured to run PHP under your account username (for example using SuPHP).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Re: Some attached files with owner and group - nobody
Thank you!
But my hoster told that I have to configure the script with umask, which "making" this files
But my hoster told that I have to configure the script with umask, which "making" this files

Re: Some attached files with owner and group - nobody
Wait, you mean you can't download files when you click from within the "View ticket" page, or when you try downloading directly over FTP?
Do you have email piping/pop3 fetching enabled?
Do you have email piping/pop3 fetching enabled?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Re: Some attached files with owner and group - nobody
yesKlemen wrote:Wait, you mean you can't download files when you click from within the "View ticket" page
this tooor when you try downloading directly over FTP?
piping enabledDo you have email piping/pop3 fetching enabled?
Re: Some attached files with owner and group - nobody
Then this is definitely permissions problem because the PHP pipe is running under a different user.
You can try setting chmod and see if that helps:
1. open file inc/attachments.inc.php
2. inside find3. just ABOVE that add
3. save, upload and test to see if it works on new tickets
Not sure if your host allows it, but you could also try to change the owner instead in step 2 above:
(replace USER with the username PHP runs under, either as "username" or numerical value (again check with your host to confirm under what user your scripts execute via browser, not pipe).
You can try setting chmod and see if that helps:
1. open file inc/attachments.inc.php
2. inside find
Code: Select all
$info = array
Code: Select all
@chmod(dirname(dirname(__FILE__)).'/'.$hesk_settings['attach_dir'].'/'.$file_name, 0644);
Not sure if your host allows it, but you could also try to change the owner instead in step 2 above:
Code: Select all
@chown(dirname(dirname(__FILE__)).'/'.$hesk_settings['attach_dir'].'/'.$file_name, USER);
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Re: Some attached files with owner and group - nobody
Thank you!
The problem was that MTA Postfix making pipe commands from "nobody" by default. I made in default_privs real user and it works correct now.
Another problem that all files still have 0600. This is not a big problem, but
The problem was that MTA Postfix making pipe commands from "nobody" by default. I made in default_privs real user and it works correct now.
Another problem that all files still have 0600. This is not a big problem, but
this did not solve the problem((@chmod(dirname(dirname(__FILE__)).'/'.$hesk_settings['attach_dir'].'/'.$file_name, 0644);
Re: Some attached files with owner and group - nobody
help me please 

Re: Some attached files with owner and group - nobody
If the chmod doesn't work then it's either disabled in PHP or user running PHP doesn't have permissions to modify it?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Re: Some attached files with owner and group - nobody
I made a test file with this code:Klemen wrote:If the chmod doesn't work then it's either disabled in PHP or user running PHP doesn't have permissions to modify it?
Code: Select all
$text = "Test text";
$fp = fopen("file.txt", "w");
fwrite($fp, $text);
fclose($fp);
I don't know why
Code: Select all
@chmod(dirname(dirname(__FILE__)).'/'.$hesk_settings['attach_dir'].'/'.$file_name, 0644);

Re: Some attached files with owner and group - nobody
Because on your server piped script is running under a different username than the script you open via browser.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools