ownership and permissions
ZAP <[email protected]>
| Newsgroups | gmane.comp.web.oscommerce.devel |
|---|---|
| Message-ID | <bfd98cee55234770c2346db455fcead8@osCommerce-Forums> |
This message was sent from: Development http://forums.oscommerce.com/viewtopic.php?p=175511#175511 ---------------------------------------------------------------- Actually, I'm not sure that the whole of this problem has been grasped and dealt with yet. I just had a fairly major meltdown due to my entire images directory changing ownership to someone else. I do not have root access, so I can't fix the problem. The images do not even show up on the website anymore, so that is a pretty serious bug. In the interest of trying to figure out just wtf is going on here, here's what I did tonight before this happened: * I installed osC (May 30th snapshot) to the root of an account on a ProHosting server. * I am sharing my "images" directory with an existing ecommerce site (that does not use osC and will be phased out soon). * I added exactly one image using the admin "Add Product" wizard from my local hard drive. * Then I realized that all I had to do was to type the image name in the Add Product page and it would use the existing image in the web images directory, so I added several more products that way. * I was having constant problems with (previously-existing) images becoming corrupted (0k file size) all through this. * So I was also using WS_FTP to re-upload the corrupted images after adding products. It didn't seem to be happening consistently, and - even stranger - images that had nothing to do with the product I was adding would also become corrupted all of a sudden. Sometimes I would have to re-upload an image 3 or more times to fix it, or sometimes I would have to delete it first (in WS_FTP) and then upload it again. * Since this was starting to freak me out, I began to check premissions of my images and other directories. My images directory was set to 777, so I tried changing it to 644. When that didn't help, I changed it back to 777. When that still didn't work and I realized that the individual images were mostly 644, I changed them all to 777 individually (all using WS_FTP - I have no shell access). * Suddenly I noticed that several image subdirectories (having nothing to do with osC at all) were missing. I tried to re-upload them and was given a "Permission denied" "File already exists" error. When I look at the images directory using my host's File Manager doohickey, I see that the folders are there, but they are assigned to a different user (there's not even a CHOWN command in WS_FTP). * While I'm navigating the site and trying to figure out what's going on, more and more things are disappearing. No one is using osC (it's not public), and I'm not doing anything at this point but looking. Then my images directory and all the images in it disappear (i.e. I can see the directory in my hosts' File Manager only, but I can't open it and the images no longer show up in my website). * If I try to open the images directory in osC's File Manager tool, I get a series of errors like this: Warning: filesize() [function.filesize]: Stat failed for /usr/home/web/users/a0002808/html/images/.. (errno=13 - Permission denied) in /usr/home/web/users/a0002808/html/admin/file_manager.php on line 178 So I'm at a loss to understand what happened. I was not uploading images using osC's Add Product or File Manager tools, and most of what disappeared had nothing to do with osC. All I can imagine is that on this server PHP runs as "root" or some other user and a bug in osC reset ownership/permissions to that user, but damned if I can figure out why it happened that broadly and in that strange a manner. After I get my host to re-CHMOD and CHOWN the images directory (who knows how long that will be?), I'll try the fix mentioned here, but I'm a little worried that there's more to this bug than just CHMODing osC-uploaded images.