Zen Cart Logo
Forums / General Questions / Image file permissions

Image file permissions

Locked

Views: 2,402

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
15 Sep 2010, 12:42 PM
#1
robsnowden avatar

robsnowden

Zen Follower

Join Date:
Apr 2004
Location:
Up t'north, UK
Posts:
264
Plugin Contributions:
0

Image file permissions

Quick question please.

I am having a strange problem with the file permissions on my site. My server file permission are set to 755 for folders and 644 for files but still I am seeing files and folders at 777 when I view in file manager. I keep resetting these but all images being added, for example, sre showing at 777. What could be happening here please?

Rob

15 Sep 2010, 3:18 PM
#2
muzz avatar

muzz

Totally Zenned

Join Date:
Mar 2009
Location:
Australia
Posts:
604
Plugin Contributions:
0

Re: Image file permissions

It sounds like a permission issue on the files folders etc..

It may be that when zencart was installed it was on server level admin.

Ask your webhost to check permissions are editable for your admin level.

At worst and ask him to set permissions for you.

https://www.zen-cart.com/tutorials/index.php?article=9

15 Sep 2010, 4:02 PM
#3
robsnowden avatar

robsnowden

Zen Follower

Join Date:
Apr 2004
Location:
Up t'north, UK
Posts:
264
Plugin Contributions:
0

Re: Image file permissions

Thanks for your reply.

I have used zencart for many years and have hosted several dozen sites for nearly ten years, having root level admin on my dedicated server. So setting file permissions is the least of my daily worries but this problem is one I have not seen before - image files are being uploaded 777, even though the server is using suphp and standard file settings are 644. Even the server tech guys have passsed this problem up the line. I just wondered if anybody else had experienced this issue and if it pointed to a script problem rather than a server problem.

I appreciate your reply though

Rob

15 Sep 2010, 7:31 PM
#4
robsnowden avatar

robsnowden

Zen Follower

Join Date:
Apr 2004
Location:
Up t'north, UK
Posts:
264
Plugin Contributions:
0

Re: Image file permissions

BUMP

Anybody else go an idea:

I got this response from hosting company:

"Hi,

I've gone through everything in your code which sets either umask or chmod but I can't get the files to upload with the correct permissions. There must be a setting in the DB which controls this. I've googled for this as well and I'm unable to find credible information.

I can tell you that it is something in the code which is doing this."

Please if anybody can tell me why omages are uploading to server and being forced to chmod 777 I would be grateful for the input. My hosting company are unhappy to contimue to host this site if I cannot resolve this matter.

Rob

15 Sep 2010, 7:40 PM
#5
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Image file permissions

It happens to me to.

If i use zen to upload images their permission is set to 777, but it should be 644

15 Sep 2010, 7:50 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Image file permissions

Zen Cart version?

15 Sep 2010, 8:00 PM
#7
robsnowden avatar

robsnowden

Zen Follower

Join Date:
Apr 2004
Location:
Up t'north, UK
Posts:
264
Plugin Contributions:
0

Re: Image file permissions

Dr Byte

ZenCart 1.3.8a

Rob

15 Sep 2010, 8:26 PM
#8
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Image file permissions

1.38a through to 1.39f

15 Sep 2010, 8:57 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Image file permissions

Up to v1.3.8a, Zen Cart was coded to set 777 on uploaded files. This was required for most server configurations else access to those files would be lost since the files were owned by other than the web account.
With the advent of more and more hosting companies adopting suPHP and running as CGI, many hosts now dislike 777, and require a max of 755. In those particular hosting environments, even 644 will work fine, since the ownership problem doesn't exist. As of v1.3.9a uploaded files are set to 644.
The downside to that is that anyone on older hosting that does allow the more conventional 777 usage but also runs apache as another user, those uploaded files won't be accessible via FTP. Such is the problem with uploading anything via the browser. It's quite complex when the filesystem permissions get involved.

15 Sep 2010, 9:04 PM
#10
robsnowden avatar

robsnowden

Zen Follower

Join Date:
Apr 2004
Location:
Up t'north, UK
Posts:
264
Plugin Contributions:
0

Re: Image file permissions

Thanks Dr Byte

Is there anything that can be done to 'force' image uploads at 644? I am particularly worried about the chances of hacking if any 777 files/folders are allowed.

Cheers

Rob

15 Sep 2010, 9:06 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Image file permissions

The chances of hacking are far greater just by running the old 1.3.8 code than they are by having 777 folders, let alone files.

Simple answer: upgrade.

15 Sep 2010, 9:06 PM
#12
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Image file permissions

Thanks Drbyte,

Ill will go and find out what happens when i upload images the next time. The shop was upgraded to 1.39f only days ago.

15 Sep 2010, 9:10 PM
#13
robsnowden avatar

robsnowden

Zen Follower

Join Date:
Apr 2004
Location:
Up t'north, UK
Posts:
264
Plugin Contributions:
0

Re: Image file permissions

Upgrade?

My sites are so heavily modded the prospect of upgrading is a nightmare

Thanks

Rob