Re: [PHP] Permissions set on php script question
If your web-server is setup to read files with .php extension through PHP engine (it is I guess) than no body from outside (using HTTP) can't read content of original PHP file only the output of that particular script. The only concern you may have is that somebody else on that server can read that file. Eg anybody who can login to server can read all your files with permission set to read on 'other' On May 12, 2008, at 11:37 PM, David Jourard wrote: Bojan Tesanovic wrote: Heh you are really new to Linux permissions on linux are set per user/group/other bases so for most secure set permissions to read only for web-server user so chown 'webserveruser' file.php chmod 400 file.php make sure you have root access at server so you can change that file or make a group for web-server as your group and set read permissions on group level chmod 440 file.php Thank-you But most web sites are virtually hosted and do not have root access to set this up. Most people just take the package and install with default masks. So again I ask: Are there are any security concerns when the read permission is set on other. ie Couldn't one write a program to remotely read the contents of the file. Wouldn't it be better if the read permission was set for user only and the php engine could run the program as user like one can do for cgi using suEXEC. Again thanks David J. Bojan Tesanovic http://www.carster.us/
Re: [PHP] Permissions set on php script question
Bojan Tesanovic wrote: Heh you are really new to Linux permissions on linux are set per user/group/other bases so for most secure set permissions to read only for web-server user so chown 'webserveruser' file.php chmod 400 file.php make sure you have root access at server so you can change that file or make a group for web-server as your group and set read permissions on group level chmod 440 file.php Thank-you But most web sites are virtually hosted and do not have root access to set this up. Most people just take the package and install with default masks. So again I ask: Are there are any security concerns when the read permission is set on other. ie Couldn't one write a program to remotely read the contents of the file. Wouldn't it be better if the read permission was set for user only and the php engine could run the program as user like one can do for cgi using suEXEC. Again thanks David J.
Re: [PHP] Permissions set on php script question
Heh you are really new to Linux permissions on linux are set per user/group/other bases so for most secure set permissions to read only for web-server user so chown 'webserveruser' file.php chmod 400 file.php make sure you have root access at server so you can change that file or make a group for web-server as your group and set read permissions on group level chmod 440 file.php On May 12, 2008, at 4:45 PM, David Jourard wrote: Hi, I'm very new to php. One thing I noticed in order to run the php program (on a linux server) I need to set the read permission for Other. In this program I'll have the MySQL credentials defined. Are there are any security concerns when the read permission is set like this. Wouldn't it be better if the permission was set for user only and the php engine could run the program as user like one can do for cgi using suEXEC. Couldn't one write a program to remotely read the contents of the file. Thank-you David J. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bojan Tesanovic http://www.carster.us/
Re: [PHP] permissions for include()
On Thu, August 9, 2007 8:15 pm, jekillen wrote: > > On Aug 8, 2007, at 9:34 PM, Richard Lynch wrote: > >> On Wed, August 8, 2007 7:52 pm, jekillen wrote: >> Apache runs as the "User" setting in httpd.conf >> >> If that "User" can rwx the files, then PHP can rwx the files. >> >> If not, not. >> >> It's that simple. > > Thanks, so if I make the directory and file outside of the document > root owner noboby with rwx for owner only, that will work? The directory should be 'x' for the user to be able to use it. The file itself has no need to be 'x' unless you plan to http://php.net/exec it. I cannot say if it will work if you use 'nobody' because I don't know if you have "User nobody" in your httpd.conf or not. If you do, it will. If you don't, it won't. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions for include()
On Aug 8, 2007, at 9:34 PM, Richard Lynch wrote: On Wed, August 8, 2007 7:52 pm, jekillen wrote: I have a question about including php files that are outside of the web server document root. What permission does Apache use to access files outside of the document root? Here is the situation: I want to store sensitive data such as login/pw data for registered users. I also want to make all the web content rwx for user nobody (FreeBSD) only. So no ftp access, no mortal user access, etc. Is it possible to do this in this situation? Would the Parent Apache process use its privileges to include a file of this type? I have texts and other data about storing data out side the document root, but none go into it in this detail? Apache runs as the "User" setting in httpd.conf If that "User" can rwx the files, then PHP can rwx the files. If not, not. It's that simple. Thanks, so if I make the directory and file outside of the document root owner noboby with rwx for owner only, that will work? Jeff K -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions for include()
On Wed, August 8, 2007 7:52 pm, jekillen wrote: > I have a question about including php files that are outside of > the web server document root. What permission does Apache > use to access files outside of the document root? > Here is the situation: > I want to store sensitive data such as login/pw data for > registered users. I also want to make all the web content > rwx for user nobody (FreeBSD) only. So no ftp access, > no mortal user access, etc. Is it possible to do this in > this situation? Would the Parent Apache process use > its privileges to include a file of this type? > I have texts and other data about storing data out side > the document root, but none go into it in this detail? Apache runs as the "User" setting in httpd.conf If that "User" can rwx the files, then PHP can rwx the files. If not, not. It's that simple. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions for include()
jekillen wrote: Hello again; I have a question about including php files that are outside of the web server document root. What permission does Apache use to access files outside of the document root? Same as inside the document root afaik. I want to store sensitive data such as login/pw data for registered users. Wouldn't that go into a database? I can understand the db config being outside the doc root though. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions issue on share
On 3/23/07, Jim Lucas <[EMAIL PROTECTED]> wrote: Rahul Sitaram Johari wrote: > Ave, > > I¹m not sure if anyone here is going to be able to help, but I¹ve run into a > permissions snag. > I have Apache Web Server running on Mac OS X with PHP. I have a folder on a > windows machine mounted on my Mac OS X as a share using the ³mount t smbfs > //[EMAIL PROTECTED]/ShareName Share². > The ³user² has full read-write permission and physically I¹m able to do > anything I want sitting on my Mac OS X in this share, like create, delete or > modify files. > > The problem is, I don¹t think Apache Web Server (or PHP) has write access on > this share. In PHP, I¹m able to read data from files on this share, but I¹m > not able to write data to any file on that share. I get access is denied. > > Is there anyway through PHP to give Apache or PHP write access to the files > on this share? > I don¹t see how I can provide Apache Web Server (installed on my Mac) Write > Access through the Windows System that has the original folder. Windows is > only able to provide the Mac User with Permissions, not Apache. > > Any help would be appreciated. > > Thanks > > > ~~~ > Rahul Sitaram Johari > CEO, Twenty Four Seventy Nine Inc. > > W: http://www.rahulsjohari.com > E: [EMAIL PROTECTED] > > ³I morti non sono piu soli ... The dead are no longer lonely² > > you could always change apache to run as the user/group that the mount is set to. Sorry you had to spend 6 hours hunting down a 2 second fix. Not sure why no one else suggested this. If it is a local copy of Apache and not used by anybody else, who cares about what permissions it runs as. Jim Running apache as root is quite hard... He was mounting his shares as root so then apache would need to run as root. And that probably requires recompiling of Apache. And i provided a quite secure way to fix, but Mac OS X didn't understand that. Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions issue on share
Rahul Sitaram Johari wrote: Ave, I¹m not sure if anyone here is going to be able to help, but I¹ve run into a permissions snag. I have Apache Web Server running on Mac OS X with PHP. I have a folder on a windows machine mounted on my Mac OS X as a share using the ³mount t smbfs //[EMAIL PROTECTED]/ShareName Share². The ³user² has full read-write permission and physically I¹m able to do anything I want sitting on my Mac OS X in this share, like create, delete or modify files. The problem is, I don¹t think Apache Web Server (or PHP) has write access on this share. In PHP, I¹m able to read data from files on this share, but I¹m not able to write data to any file on that share. I get access is denied. Is there anyway through PHP to give Apache or PHP write access to the files on this share? I don¹t see how I can provide Apache Web Server (installed on my Mac) Write Access through the Windows System that has the original folder. Windows is only able to provide the Mac User with Permissions, not Apache. Any help would be appreciated. Thanks ~~~ Rahul Sitaram Johari CEO, Twenty Four Seventy Nine Inc. W: http://www.rahulsjohari.com E: [EMAIL PROTECTED] ³I morti non sono piu soli ... The dead are no longer lonely² you could always change apache to run as the user/group that the mount is set to. Sorry you had to spend 6 hours hunting down a 2 second fix. Not sure why no one else suggested this. If it is a local copy of Apache and not used by anybody else, who cares about what permissions it runs as. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions issue on share - SOLVED!!
Ave, I can't believe I'm saying this, but SOLVED it! Took me about 6 hours, and this one website, with this one little snippet in one corner of a black & white page on the ENTIRE Internet gave me a solution with this guy who had the same problem - and he wrote "fixed it for me, hope it helps someone else" - Well, if he ever came to town, beer would be on the house :) Believe it or not, two simple little parameters to the mount_smbfs command did the trick. mount_smbfs -u 70 -g 70 //[EMAIL PROTECTED]/ShareName SharePoint Explanation: First & foremost, this does not work with the "mount" command (mount -t smbfs) which is what I was using. It only works with the "mount_smbfs" command. Basically you have to specify the uid & gid, that is, the UserID and the GroupID that you want to specify as Owner & Group of the mounted share. In my case, 70 is the uid & gid of Apache Web Server on Mac OS X. With the "-u 70 -g 70" specifying Apache Web Server, of the mounted share, Apache got read/write permissions to anything on the mounted share. Suddenly I was able to write to files using PHP/Apache on that share! Actually it's a useful command because once you determine UID & GID of a User/Group that you want to specify for a mounted share, you can tighten security and really take control of permission sets for a mounted share. snip: I used NetInfo Manager to find out uid & gid of Apache Web Server on my Mac OS X. Hope this helps someone else ;) ~~~ Rahul Sitaram Johari CEO, Twenty Four Seventy Nine Inc. W: http://www.rahulsjohari.com E: [EMAIL PROTECTED] ³I morti non sono piu soli ... The dead are no longer lonely² On 3/22/07 3:32 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> Ave, >> >>> But i think that when remounting the partitition, the permissions are reset >> too. >> >> Unfortunately you're absolutely right! The share is re-mounted on a daily >> basis (along with a reboot), and thus, even if the 'copy, delete from >> server, copy to server' process were to work, with every unmount & remount, >> it would go back to original permissions & ownership. >> >> Fmask, dmask and for that matter some other mount_smbfs options I found are >> an accurate solution to this problem - but unfortunately they don't work on >> Mac OS X, or the Samba that comes with mac os x, one or the other. >> >> I know this is gone completely out of PHP context, but I do appreciate you >> guys helping out. I'm just not finding any solution for this. I think I've >> gone through 100 websites googling different combinations. > > You could try to update to the latest version (maybe even from CVS), > i'm not sure if it helps, but if it is fixed, it is done in a later > version :) > > And if it doesn't, you could submit a bug ticket at samba. > > Tijnema >> >> >> >> On 3/22/07 3:14 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: >> >>> On 3/22/07, Al <[EMAIL PROTECTED]> wrote: Get a copy of WinSCP3 or FileZilla ftp utilities, both are free. They will show you who the owner is for the dirs and files. You can also use a SSH shell command; but, unless you are already familiar with Unix commands, using the utilities will be a lot easier and quicker. To change a file or dir when you do not own or have the proper permissions: Copy the files and dirs to your local HD Delete them on the server. Upload them from your HD to the server. Now the owner will be the ID of ftp login, that's you. Fix the permissions as needed. The files and dirs must have the "others", also called "world", W bit set to write and maybe the X bit also. >>> >>> So you would recommend a recursive chmod? >>> as long as there's no OS installed it wouldn't do a lot, but of course >>> this would remove a little bit security. (Not that there's a lot of >>> security with windows...:P) >>> But i think that when remounting the partitition, the permissions are >>> reset too. That's why there are options like fmask and dmask :) but >>> somehow they don't work on Mac OS X. >>> >>> Tijnema >>> Rahul Sitaram Johari wrote: Rahul Sitaram Johari wrote: > Ave, > > I¹m not sure if anyone here is going to be able to help, but I¹ve run into > a > permissions snag. > I have Apache Web Server running on Mac OS X with PHP. I have a folder on > a > windows machine mounted on my Mac OS X as a share using the ³mount t > smbfs > //[EMAIL PROTECTED]/ShareName Share². > The ³user² has full read-write permission and physically I¹m able to do > anything I want sitting on my Mac OS X in this share, like create, delete > or > modify files. > > The problem is, I don¹t think Apache Web Server (or PHP) has write access > on > this share. In PHP, I¹m able to read data from files on this share, but > I¹m > not able to write
Re: [PHP] Permissions issue on share
On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Ave, > But i think that when remounting the partitition, the permissions are reset too. Unfortunately you're absolutely right! The share is re-mounted on a daily basis (along with a reboot), and thus, even if the 'copy, delete from server, copy to server' process were to work, with every unmount & remount, it would go back to original permissions & ownership. Fmask, dmask and for that matter some other mount_smbfs options I found are an accurate solution to this problem - but unfortunately they don't work on Mac OS X, or the Samba that comes with mac os x, one or the other. I know this is gone completely out of PHP context, but I do appreciate you guys helping out. I'm just not finding any solution for this. I think I've gone through 100 websites googling different combinations. You could try to update to the latest version (maybe even from CVS), i'm not sure if it helps, but if it is fixed, it is done in a later version :) And if it doesn't, you could submit a bug ticket at samba. Tijnema On 3/22/07 3:14 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: > On 3/22/07, Al <[EMAIL PROTECTED]> wrote: >> Get a copy of WinSCP3 or FileZilla ftp utilities, both are free. They will >> show >> you who the owner is for the dirs and files. You can also use a SSH shell >> command; but, unless you are already familiar with Unix commands, using the >> utilities will be a lot easier and quicker. >> >> To change a file or dir when you do not own or have the proper permissions: >> Copy the files and dirs to your local HD >> Delete them on the server. >> Upload them from your HD to the server. Now the owner will be the ID of ftp >> login, that's you. >> Fix the permissions as needed. The files and dirs must have the "others", >> also >> called "world", W bit set to write and maybe the X bit also. > > So you would recommend a recursive chmod? > as long as there's no OS installed it wouldn't do a lot, but of course > this would remove a little bit security. (Not that there's a lot of > security with windows...:P) > But i think that when remounting the partitition, the permissions are > reset too. That's why there are options like fmask and dmask :) but > somehow they don't work on Mac OS X. > > Tijnema > >> >> Rahul Sitaram Johari wrote: >> >> >> Rahul Sitaram Johari wrote: >>> Ave, >>> >>> I¹m not sure if anyone here is going to be able to help, but I¹ve run into a >>> permissions snag. >>> I have Apache Web Server running on Mac OS X with PHP. I have a folder on a >>> windows machine mounted on my Mac OS X as a share using the ³mount t smbfs >>> //[EMAIL PROTECTED]/ShareName Share². >>> The ³user² has full read-write permission and physically I¹m able to do >>> anything I want sitting on my Mac OS X in this share, like create, delete or >>> modify files. >>> >>> The problem is, I don¹t think Apache Web Server (or PHP) has write access on >>> this share. In PHP, I¹m able to read data from files on this share, but I¹m >>> not able to write data to any file on that share. I get access is denied. >>> >>> Is there anyway through PHP to give Apache or PHP write access to the files >>> on this share? >>> I don¹t see how I can provide Apache Web Server (installed on my Mac) Write >>> Access through the Windows System that has the original folder. Windows is >>> only able to provide the Mac User with Permissions, not Apache. >>> >>> Any help would be appreciated. >>> >>> Thanks >>> >>> >>> ~~~ >>> Rahul Sitaram Johari >>> CEO, Twenty Four Seventy Nine Inc. >>> >>> W: http://www.rahulsjohari.com >>> E: [EMAIL PROTECTED] >>> >>> ³I morti non sono piu soli ... The dead are no longer lonely² >>> >>> >>> Ave, >>> >>> I¹m not sure if anyone here is going to be able to help, but I¹ve run into a >>> permissions snag. >>> I have Apache Web Server running on Mac OS X with PHP. I have a folder on a >>> windows machine mounted on my Mac OS X as a share using the ³mount t smbfs >>> //[EMAIL PROTECTED]/ShareName Share². >>> The ³user² has full read-write permission and physically I¹m able to do >>> anything I want sitting on my Mac OS X in this share, like create, delete or >>> modify files. >>> >>> The problem is, I don¹t think Apache Web Server (or PHP) has write access on >>> this share. In PHP, I¹m able to read data from files on this share, but I¹m >>> not able to write data to any file on that share. I get access is denied. >>> >>> Is there anyway through PHP to give Apache or PHP write access to the files >>> on this share? >>> I don¹t see how I can provide Apache Web Server (installed on my Mac) Write >>> Access through the Windows System that has the original folder. Windows is >>> only able to provide the Mac User with Permissions, not Apache. >>> >>> Any help would be appreciated. >>> >>> Thanks >>> >>> >>> ~~~ >>> Rahul Sitaram Johari >>> CEO, Twenty Four Seventy Nine Inc. >>> >>> W: http://
Re: [PHP] Permissions issue on share
Ave, > But i think that when remounting the partitition, the permissions are reset too. Unfortunately you're absolutely right! The share is re-mounted on a daily basis (along with a reboot), and thus, even if the 'copy, delete from server, copy to server' process were to work, with every unmount & remount, it would go back to original permissions & ownership. Fmask, dmask and for that matter some other mount_smbfs options I found are an accurate solution to this problem - but unfortunately they don't work on Mac OS X, or the Samba that comes with mac os x, one or the other. I know this is gone completely out of PHP context, but I do appreciate you guys helping out. I'm just not finding any solution for this. I think I've gone through 100 websites googling different combinations. On 3/22/07 3:14 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: > On 3/22/07, Al <[EMAIL PROTECTED]> wrote: >> Get a copy of WinSCP3 or FileZilla ftp utilities, both are free. They will >> show >> you who the owner is for the dirs and files. You can also use a SSH shell >> command; but, unless you are already familiar with Unix commands, using the >> utilities will be a lot easier and quicker. >> >> To change a file or dir when you do not own or have the proper permissions: >> Copy the files and dirs to your local HD >> Delete them on the server. >> Upload them from your HD to the server. Now the owner will be the ID of ftp >> login, that's you. >> Fix the permissions as needed. The files and dirs must have the "others", >> also >> called "world", W bit set to write and maybe the X bit also. > > So you would recommend a recursive chmod? > as long as there's no OS installed it wouldn't do a lot, but of course > this would remove a little bit security. (Not that there's a lot of > security with windows...:P) > But i think that when remounting the partitition, the permissions are > reset too. That's why there are options like fmask and dmask :) but > somehow they don't work on Mac OS X. > > Tijnema > >> >> Rahul Sitaram Johari wrote: >> >> >> Rahul Sitaram Johari wrote: >>> Ave, >>> >>> I¹m not sure if anyone here is going to be able to help, but I¹ve run into a >>> permissions snag. >>> I have Apache Web Server running on Mac OS X with PHP. I have a folder on a >>> windows machine mounted on my Mac OS X as a share using the ³mount t smbfs >>> //[EMAIL PROTECTED]/ShareName Share². >>> The ³user² has full read-write permission and physically I¹m able to do >>> anything I want sitting on my Mac OS X in this share, like create, delete or >>> modify files. >>> >>> The problem is, I don¹t think Apache Web Server (or PHP) has write access on >>> this share. In PHP, I¹m able to read data from files on this share, but I¹m >>> not able to write data to any file on that share. I get access is denied. >>> >>> Is there anyway through PHP to give Apache or PHP write access to the files >>> on this share? >>> I don¹t see how I can provide Apache Web Server (installed on my Mac) Write >>> Access through the Windows System that has the original folder. Windows is >>> only able to provide the Mac User with Permissions, not Apache. >>> >>> Any help would be appreciated. >>> >>> Thanks >>> >>> >>> ~~~ >>> Rahul Sitaram Johari >>> CEO, Twenty Four Seventy Nine Inc. >>> >>> W: http://www.rahulsjohari.com >>> E: [EMAIL PROTECTED] >>> >>> ³I morti non sono piu soli ... The dead are no longer lonely² >>> >>> >>> Ave, >>> >>> I¹m not sure if anyone here is going to be able to help, but I¹ve run into a >>> permissions snag. >>> I have Apache Web Server running on Mac OS X with PHP. I have a folder on a >>> windows machine mounted on my Mac OS X as a share using the ³mount t smbfs >>> //[EMAIL PROTECTED]/ShareName Share². >>> The ³user² has full read-write permission and physically I¹m able to do >>> anything I want sitting on my Mac OS X in this share, like create, delete or >>> modify files. >>> >>> The problem is, I don¹t think Apache Web Server (or PHP) has write access on >>> this share. In PHP, I¹m able to read data from files on this share, but I¹m >>> not able to write data to any file on that share. I get access is denied. >>> >>> Is there anyway through PHP to give Apache or PHP write access to the files >>> on this share? >>> I don¹t see how I can provide Apache Web Server (installed on my Mac) Write >>> Access through the Windows System that has the original folder. Windows is >>> only able to provide the Mac User with Permissions, not Apache. >>> >>> Any help would be appreciated. >>> >>> Thanks >>> >>> >>> ~~~ >>> Rahul Sitaram Johari >>> CEO, Twenty Four Seventy Nine Inc. >>> >>> W: http://www.rahulsjohari.com >>> E: [EMAIL PROTECTED] >>> >>> ³I morti non sono piu soli ... The dead are no longer lonely² >>> >>> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > -
Re: [PHP] Permissions issue on share
On 3/22/07, Al <[EMAIL PROTECTED]> wrote: Get a copy of WinSCP3 or FileZilla ftp utilities, both are free. They will show you who the owner is for the dirs and files. You can also use a SSH shell command; but, unless you are already familiar with Unix commands, using the utilities will be a lot easier and quicker. To change a file or dir when you do not own or have the proper permissions: Copy the files and dirs to your local HD Delete them on the server. Upload them from your HD to the server. Now the owner will be the ID of ftp login, that's you. Fix the permissions as needed. The files and dirs must have the "others", also called "world", W bit set to write and maybe the X bit also. So you would recommend a recursive chmod? as long as there's no OS installed it wouldn't do a lot, but of course this would remove a little bit security. (Not that there's a lot of security with windows...:P) But i think that when remounting the partitition, the permissions are reset too. That's why there are options like fmask and dmask :) but somehow they don't work on Mac OS X. Tijnema Rahul Sitaram Johari wrote: Rahul Sitaram Johari wrote: > Ave, > > I¹m not sure if anyone here is going to be able to help, but I¹ve run into a > permissions snag. > I have Apache Web Server running on Mac OS X with PHP. I have a folder on a > windows machine mounted on my Mac OS X as a share using the ³mount t smbfs > //[EMAIL PROTECTED]/ShareName Share². > The ³user² has full read-write permission and physically I¹m able to do > anything I want sitting on my Mac OS X in this share, like create, delete or > modify files. > > The problem is, I don¹t think Apache Web Server (or PHP) has write access on > this share. In PHP, I¹m able to read data from files on this share, but I¹m > not able to write data to any file on that share. I get access is denied. > > Is there anyway through PHP to give Apache or PHP write access to the files > on this share? > I don¹t see how I can provide Apache Web Server (installed on my Mac) Write > Access through the Windows System that has the original folder. Windows is > only able to provide the Mac User with Permissions, not Apache. > > Any help would be appreciated. > > Thanks > > > ~~~ > Rahul Sitaram Johari > CEO, Twenty Four Seventy Nine Inc. > > W: http://www.rahulsjohari.com > E: [EMAIL PROTECTED] > > ³I morti non sono piu soli ... The dead are no longer lonely² > > > Ave, > > I¹m not sure if anyone here is going to be able to help, but I¹ve run into a > permissions snag. > I have Apache Web Server running on Mac OS X with PHP. I have a folder on a > windows machine mounted on my Mac OS X as a share using the ³mount t smbfs > //[EMAIL PROTECTED]/ShareName Share². > The ³user² has full read-write permission and physically I¹m able to do > anything I want sitting on my Mac OS X in this share, like create, delete or > modify files. > > The problem is, I don¹t think Apache Web Server (or PHP) has write access on > this share. In PHP, I¹m able to read data from files on this share, but I¹m > not able to write data to any file on that share. I get access is denied. > > Is there anyway through PHP to give Apache or PHP write access to the files > on this share? > I don¹t see how I can provide Apache Web Server (installed on my Mac) Write > Access through the Windows System that has the original folder. Windows is > only able to provide the Mac User with Permissions, not Apache. > > Any help would be appreciated. > > Thanks > > > ~~~ > Rahul Sitaram Johari > CEO, Twenty Four Seventy Nine Inc. > > W: http://www.rahulsjohari.com > E: [EMAIL PROTECTED] > > ³I morti non sono piu soli ... The dead are no longer lonely² > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions issue on share
Get a copy of WinSCP3 or FileZilla ftp utilities, both are free. They will show you who the owner is for the dirs and files. You can also use a SSH shell command; but, unless you are already familiar with Unix commands, using the utilities will be a lot easier and quicker. To change a file or dir when you do not own or have the proper permissions: Copy the files and dirs to your local HD Delete them on the server. Upload them from your HD to the server. Now the owner will be the ID of ftp login, that's you. Fix the permissions as needed. The files and dirs must have the "others", also called "world", W bit set to write and maybe the X bit also. Rahul Sitaram Johari wrote: Rahul Sitaram Johari wrote: Ave, I¹m not sure if anyone here is going to be able to help, but I¹ve run into a permissions snag. I have Apache Web Server running on Mac OS X with PHP. I have a folder on a windows machine mounted on my Mac OS X as a share using the ³mount t smbfs //[EMAIL PROTECTED]/ShareName Share². The ³user² has full read-write permission and physically I¹m able to do anything I want sitting on my Mac OS X in this share, like create, delete or modify files. The problem is, I don¹t think Apache Web Server (or PHP) has write access on this share. In PHP, I¹m able to read data from files on this share, but I¹m not able to write data to any file on that share. I get access is denied. Is there anyway through PHP to give Apache or PHP write access to the files on this share? I don¹t see how I can provide Apache Web Server (installed on my Mac) Write Access through the Windows System that has the original folder. Windows is only able to provide the Mac User with Permissions, not Apache. Any help would be appreciated. Thanks ~~~ Rahul Sitaram Johari CEO, Twenty Four Seventy Nine Inc. W: http://www.rahulsjohari.com E: [EMAIL PROTECTED] ³I morti non sono piu soli ... The dead are no longer lonely² Ave, I¹m not sure if anyone here is going to be able to help, but I¹ve run into a permissions snag. I have Apache Web Server running on Mac OS X with PHP. I have a folder on a windows machine mounted on my Mac OS X as a share using the ³mount t smbfs //[EMAIL PROTECTED]/ShareName Share². The ³user² has full read-write permission and physically I¹m able to do anything I want sitting on my Mac OS X in this share, like create, delete or modify files. The problem is, I don¹t think Apache Web Server (or PHP) has write access on this share. In PHP, I¹m able to read data from files on this share, but I¹m not able to write data to any file on that share. I get access is denied. Is there anyway through PHP to give Apache or PHP write access to the files on this share? I don¹t see how I can provide Apache Web Server (installed on my Mac) Write Access through the Windows System that has the original folder. Windows is only able to provide the Mac User with Permissions, not Apache. Any help would be appreciated. Thanks ~~~ Rahul Sitaram Johari CEO, Twenty Four Seventy Nine Inc. W: http://www.rahulsjohari.com E: [EMAIL PROTECTED] ³I morti non sono piu soli ... The dead are no longer lonely² -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions issue on share
Yes, it does appear that samba on mac os x is not taking any configuration options. I tried different options for the mount_smbfs command which does have very specific user/owner/group related permissions options - but all give me the same "operation not supported" error. Let me take a closer look at Samba and also the list you linked to. Thanks again - appreciate your help! On 3/22/07 2:21 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> Ave, >> >> Certainly looks very promising, but is giving me: >> mount_smbfs: -o fmask=: option not supported >> >> Let me google it too, see what I can come up with. Appreciate it a lot mate. > > Hmm, i googled a little bit, and i found a norwegian site with some > kind of same problem, and from what i understand they say it is that > the Mac OS X implementation of Samba doesn't accept any configuration > options. > > But they don't tell how to fix (or i don't understand.. LOL) > > Maybe updating to latest samba will do the job, but this is totally > not PHP related. > You are better off going to the samba list. so have a look here: > https://lists.samba.org/mailman/ > > Tijnema > >> >> >> On 3/22/07 12:48 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: >> >>> On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: rahul:~/Documents/XFER rjohari$ ls -la osm total 26548 drwxr-xr-x 1 rjohari rjohari16384 31 Dec 1969 . drwxr-xr-x 5 rjohari rjohari 170 22 Mar 12:08 .. -rwxr-xr-x 1 rjohari rjohari21508 13 Sep 2006 .DS_Store >>> [snip] -rwxr-xr-x 1 rjohari rjohari11264 21 Sep 16:47 warm092106.xls >>> I was guessing that, all files and folders have the 755 permission..., >>> meaning that the owner can edit, but the group and all other can't. >>> I did some googling for you, and you should mount your share with >>> -o fmask=777,dmask=777 >>> so your example mount command becomes: >>> mount t smbfs -o fmask=777,dmask=777 //[EMAIL PROTECTED]/ShareName Share >>> that should do it :) >>> >>> Tijnema On 3/22/07 12:31 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> >> Well chmod is certainly not doing anything. I tried that to begin with. I >> don't get an error, but it doesn't change any permissions. Just doesn't >> do >> anything to the permissions of the file/folder. Like it's just ignored. >> >> I did it as root using sudo. > > Can you post the log of the "ls -la Share" command here? > > Tijnema >> >> >> On 3/22/07 12:18 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: >> >>> On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Ave, "Or make sure the user apache runs on has write access to the share." That's the problem I'm facing. I'm not sure how to do that. If I'm not mistaken, Apache runs as user "nobody" on my Mac, but I don't know how to give that user write access on the Windows Machine. Yes, it is quite complicated :( >>> >>> I believe this has nothing to do with your windows machine, but with >>> the mount on your Mac. I'm not very familiar with Mac OS X (Although i >>> have installed it) I know it's based on a linux kernel, and uses same >>> mount tools. I think a simple chmod 777 to the mount folder would do >>> the job. >>> so if you have it mounted at /Share >>> chmod 777 /Share >>> I believe that windows mounts everything with chmod value 777, so that >>> shouldn't be a problem. >>> >>> Tijnema > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> >> Ave, >> >> I¹m not sure if anyone here is going to be able to help, but I¹ve run >> into >> a >> permissions snag. >> I have Apache Web Server running on Mac OS X with PHP. I have a >> folder >> on >> a >> windows machine mounted on my Mac OS X as a share using the ³mount t >> smbfs >> //[EMAIL PROTECTED]/ShareName Share². >> The ³user² has full read-write permission and physically I¹m able to >> do >> anything I want sitting on my Mac OS X in this share, like create, >> delete >> or >> modify files. >> >> The problem is, I don¹t think Apache Web Server (or PHP) has write >> access >> on >> this share. In PHP, I¹m able to read data from files on this share, >> but >> I¹m >> not able to write data to any file on that share. I get access is >> denied. >> >> Is there anyway through PHP to give Apache or PHP write access to the >> files >> on this share? >> I don¹t see how
Re: [PHP] Permissions issue on share
On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Ave, Certainly looks very promising, but is giving me: mount_smbfs: -o fmask=: option not supported Let me google it too, see what I can come up with. Appreciate it a lot mate. Hmm, i googled a little bit, and i found a norwegian site with some kind of same problem, and from what i understand they say it is that the Mac OS X implementation of Samba doesn't accept any configuration options. But they don't tell how to fix (or i don't understand.. LOL) Maybe updating to latest samba will do the job, but this is totally not PHP related. You are better off going to the samba list. so have a look here: https://lists.samba.org/mailman/ Tijnema On 3/22/07 12:48 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> rahul:~/Documents/XFER rjohari$ ls -la osm >> total 26548 >> drwxr-xr-x 1 rjohari rjohari16384 31 Dec 1969 . >> drwxr-xr-x 5 rjohari rjohari 170 22 Mar 12:08 .. >> -rwxr-xr-x 1 rjohari rjohari21508 13 Sep 2006 .DS_Store > [snip] >> -rwxr-xr-x 1 rjohari rjohari11264 21 Sep 16:47 warm092106.xls >> > I was guessing that, all files and folders have the 755 permission..., > meaning that the owner can edit, but the group and all other can't. > I did some googling for you, and you should mount your share with > -o fmask=777,dmask=777 > so your example mount command becomes: > mount t smbfs -o fmask=777,dmask=777 //[EMAIL PROTECTED]/ShareName Share > that should do it :) > > Tijnema >> >> >> On 3/22/07 12:31 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: >> >>> On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Well chmod is certainly not doing anything. I tried that to begin with. I don't get an error, but it doesn't change any permissions. Just doesn't do anything to the permissions of the file/folder. Like it's just ignored. I did it as root using sudo. >>> >>> Can you post the log of the "ls -la Share" command here? >>> >>> Tijnema On 3/22/07 12:18 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> >> Ave, >> >> "Or make sure the user apache runs on has write access to the share." >> >> That's the problem I'm facing. I'm not sure how to do that. If I'm not >> mistaken, Apache runs as user "nobody" on my Mac, but I don't know how to >> give that user write access on the Windows Machine. >> >> Yes, it is quite complicated :( > > I believe this has nothing to do with your windows machine, but with > the mount on your Mac. I'm not very familiar with Mac OS X (Although i > have installed it) I know it's based on a linux kernel, and uses same > mount tools. I think a simple chmod 777 to the mount folder would do > the job. > so if you have it mounted at /Share > chmod 777 /Share > I believe that windows mounts everything with chmod value 777, so that > shouldn't be a problem. > > Tijnema >> >> >>> On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Ave, I¹m not sure if anyone here is going to be able to help, but I¹ve run into a permissions snag. I have Apache Web Server running on Mac OS X with PHP. I have a folder on a windows machine mounted on my Mac OS X as a share using the ³mount t smbfs //[EMAIL PROTECTED]/ShareName Share². The ³user² has full read-write permission and physically I¹m able to do anything I want sitting on my Mac OS X in this share, like create, delete or modify files. The problem is, I don¹t think Apache Web Server (or PHP) has write access on this share. In PHP, I¹m able to read data from files on this share, but I¹m not able to write data to any file on that share. I get access is denied. Is there anyway through PHP to give Apache or PHP write access to the files on this share? I don¹t see how I can provide Apache Web Server (installed on my Mac) Write Access through the Windows System that has the original folder. Windows is only able to provide the Mac User with Permissions, not Apache. Any help would be appreciated. Thanks >>> >>> You could chmod the whole share to 777 but that might give problems! >>> Or make sure the user apache runs on has write access to the share. >>> But normal each file is set with permission 755, means that only the >>> owner can write to it. >>> >>> I'm not able to give a real fix right now, but it is quite complicated >>> :( >>> >>> Tijnema ~~
Re: [PHP] Permissions issue on share
Well chmod is certainly not doing anything. I tried that to begin with. I don't get an error, but it doesn't change any permissions. Just doesn't do anything to the permissions of the file/folder. Like it's just ignored. I did it as root using sudo. On 3/22/07 12:18 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> >> Ave, >> >> "Or make sure the user apache runs on has write access to the share." >> >> That's the problem I'm facing. I'm not sure how to do that. If I'm not >> mistaken, Apache runs as user "nobody" on my Mac, but I don't know how to >> give that user write access on the Windows Machine. >> >> Yes, it is quite complicated :( > > I believe this has nothing to do with your windows machine, but with > the mount on your Mac. I'm not very familiar with Mac OS X (Although i > have installed it) I know it's based on a linux kernel, and uses same > mount tools. I think a simple chmod 777 to the mount folder would do > the job. > so if you have it mounted at /Share > chmod 777 /Share > I believe that windows mounts everything with chmod value 777, so that > shouldn't be a problem. > > Tijnema >> >> >>> On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Ave, I¹m not sure if anyone here is going to be able to help, but I¹ve run into a permissions snag. I have Apache Web Server running on Mac OS X with PHP. I have a folder on a windows machine mounted on my Mac OS X as a share using the ³mount t smbfs //[EMAIL PROTECTED]/ShareName Share². The ³user² has full read-write permission and physically I¹m able to do anything I want sitting on my Mac OS X in this share, like create, delete or modify files. The problem is, I don¹t think Apache Web Server (or PHP) has write access on this share. In PHP, I¹m able to read data from files on this share, but I¹m not able to write data to any file on that share. I get access is denied. Is there anyway through PHP to give Apache or PHP write access to the files on this share? I don¹t see how I can provide Apache Web Server (installed on my Mac) Write Access through the Windows System that has the original folder. Windows is only able to provide the Mac User with Permissions, not Apache. Any help would be appreciated. Thanks >>> >>> You could chmod the whole share to 777 but that might give problems! >>> Or make sure the user apache runs on has write access to the share. >>> But normal each file is set with permission 755, means that only the >>> owner can write to it. >>> >>> I'm not able to give a real fix right now, but it is quite complicated :( >>> >>> Tijnema ~~~ Rahul Sitaram Johari CEO, Twenty Four Seventy Nine Inc. W: http://www.rahulsjohari.com E: [EMAIL PROTECTED] ³I morti non sono piu soli ... The dead are no longer lonely² >> >> >> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions issue on share
Ave, Certainly looks very promising, but is giving me: mount_smbfs: -o fmask=: option not supported Let me google it too, see what I can come up with. Appreciate it a lot mate. On 3/22/07 12:48 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> rahul:~/Documents/XFER rjohari$ ls -la osm >> total 26548 >> drwxr-xr-x 1 rjohari rjohari16384 31 Dec 1969 . >> drwxr-xr-x 5 rjohari rjohari 170 22 Mar 12:08 .. >> -rwxr-xr-x 1 rjohari rjohari21508 13 Sep 2006 .DS_Store > [snip] >> -rwxr-xr-x 1 rjohari rjohari11264 21 Sep 16:47 warm092106.xls >> > I was guessing that, all files and folders have the 755 permission..., > meaning that the owner can edit, but the group and all other can't. > I did some googling for you, and you should mount your share with > -o fmask=777,dmask=777 > so your example mount command becomes: > mount t smbfs -o fmask=777,dmask=777 //[EMAIL PROTECTED]/ShareName Share > that should do it :) > > Tijnema >> >> >> On 3/22/07 12:31 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: >> >>> On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Well chmod is certainly not doing anything. I tried that to begin with. I don't get an error, but it doesn't change any permissions. Just doesn't do anything to the permissions of the file/folder. Like it's just ignored. I did it as root using sudo. >>> >>> Can you post the log of the "ls -la Share" command here? >>> >>> Tijnema On 3/22/07 12:18 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> >> Ave, >> >> "Or make sure the user apache runs on has write access to the share." >> >> That's the problem I'm facing. I'm not sure how to do that. If I'm not >> mistaken, Apache runs as user "nobody" on my Mac, but I don't know how to >> give that user write access on the Windows Machine. >> >> Yes, it is quite complicated :( > > I believe this has nothing to do with your windows machine, but with > the mount on your Mac. I'm not very familiar with Mac OS X (Although i > have installed it) I know it's based on a linux kernel, and uses same > mount tools. I think a simple chmod 777 to the mount folder would do > the job. > so if you have it mounted at /Share > chmod 777 /Share > I believe that windows mounts everything with chmod value 777, so that > shouldn't be a problem. > > Tijnema >> >> >>> On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Ave, I¹m not sure if anyone here is going to be able to help, but I¹ve run into a permissions snag. I have Apache Web Server running on Mac OS X with PHP. I have a folder on a windows machine mounted on my Mac OS X as a share using the ³mount t smbfs //[EMAIL PROTECTED]/ShareName Share². The ³user² has full read-write permission and physically I¹m able to do anything I want sitting on my Mac OS X in this share, like create, delete or modify files. The problem is, I don¹t think Apache Web Server (or PHP) has write access on this share. In PHP, I¹m able to read data from files on this share, but I¹m not able to write data to any file on that share. I get access is denied. Is there anyway through PHP to give Apache or PHP write access to the files on this share? I don¹t see how I can provide Apache Web Server (installed on my Mac) Write Access through the Windows System that has the original folder. Windows is only able to provide the Mac User with Permissions, not Apache. Any help would be appreciated. Thanks >>> >>> You could chmod the whole share to 777 but that might give problems! >>> Or make sure the user apache runs on has write access to the share. >>> But normal each file is set with permission 755, means that only the >>> owner can write to it. >>> >>> I'm not able to give a real fix right now, but it is quite complicated >>> :( >>> >>> Tijnema ~~~ Rahul Sitaram Johari CEO, Twenty Four Seventy Nine Inc. W: http://www.rahulsjohari.com E: [EMAIL PROTECTED] ³I morti non sono piu soli ... The dead are no longer lonely² >> >> >> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >> >> >> -- PHP General Mailing List (http://www.php.net/) To un
Re: [PHP] Permissions issue on share
On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Well chmod is certainly not doing anything. I tried that to begin with. I don't get an error, but it doesn't change any permissions. Just doesn't do anything to the permissions of the file/folder. Like it's just ignored. I did it as root using sudo. Can you post the log of the "ls -la Share" command here? Tijnema On 3/22/07 12:18 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> >> Ave, >> >> "Or make sure the user apache runs on has write access to the share." >> >> That's the problem I'm facing. I'm not sure how to do that. If I'm not >> mistaken, Apache runs as user "nobody" on my Mac, but I don't know how to >> give that user write access on the Windows Machine. >> >> Yes, it is quite complicated :( > > I believe this has nothing to do with your windows machine, but with > the mount on your Mac. I'm not very familiar with Mac OS X (Although i > have installed it) I know it's based on a linux kernel, and uses same > mount tools. I think a simple chmod 777 to the mount folder would do > the job. > so if you have it mounted at /Share > chmod 777 /Share > I believe that windows mounts everything with chmod value 777, so that > shouldn't be a problem. > > Tijnema >> >> >>> On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Ave, I¹m not sure if anyone here is going to be able to help, but I¹ve run into a permissions snag. I have Apache Web Server running on Mac OS X with PHP. I have a folder on a windows machine mounted on my Mac OS X as a share using the ³mount t smbfs //[EMAIL PROTECTED]/ShareName Share². The ³user² has full read-write permission and physically I¹m able to do anything I want sitting on my Mac OS X in this share, like create, delete or modify files. The problem is, I don¹t think Apache Web Server (or PHP) has write access on this share. In PHP, I¹m able to read data from files on this share, but I¹m not able to write data to any file on that share. I get access is denied. Is there anyway through PHP to give Apache or PHP write access to the files on this share? I don¹t see how I can provide Apache Web Server (installed on my Mac) Write Access through the Windows System that has the original folder. Windows is only able to provide the Mac User with Permissions, not Apache. Any help would be appreciated. Thanks >>> >>> You could chmod the whole share to 777 but that might give problems! >>> Or make sure the user apache runs on has write access to the share. >>> But normal each file is set with permission 755, means that only the >>> owner can write to it. >>> >>> I'm not able to give a real fix right now, but it is quite complicated :( >>> >>> Tijnema ~~~ Rahul Sitaram Johari CEO, Twenty Four Seventy Nine Inc. W: http://www.rahulsjohari.com E: [EMAIL PROTECTED] ³I morti non sono piu soli ... The dead are no longer lonely² >> >> >> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions issue on share
Ave, "Or make sure the user apache runs on has write access to the share." That's the problem I'm facing. I'm not sure how to do that. If I'm not mistaken, Apache runs as user "nobody" on my Mac, but I don't know how to give that user write access on the Windows Machine. Yes, it is quite complicated :( > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> >> Ave, >> >> I¹m not sure if anyone here is going to be able to help, but I¹ve run into a >> permissions snag. >> I have Apache Web Server running on Mac OS X with PHP. I have a folder on a >> windows machine mounted on my Mac OS X as a share using the ³mount t smbfs >> //[EMAIL PROTECTED]/ShareName Share². >> The ³user² has full read-write permission and physically I¹m able to do >> anything I want sitting on my Mac OS X in this share, like create, delete or >> modify files. >> >> The problem is, I don¹t think Apache Web Server (or PHP) has write access on >> this share. In PHP, I¹m able to read data from files on this share, but I¹m >> not able to write data to any file on that share. I get access is denied. >> >> Is there anyway through PHP to give Apache or PHP write access to the files >> on this share? >> I don¹t see how I can provide Apache Web Server (installed on my Mac) Write >> Access through the Windows System that has the original folder. Windows is >> only able to provide the Mac User with Permissions, not Apache. >> >> Any help would be appreciated. >> >> Thanks > > You could chmod the whole share to 777 but that might give problems! > Or make sure the user apache runs on has write access to the share. > But normal each file is set with permission 755, means that only the > owner can write to it. > > I'm not able to give a real fix right now, but it is quite complicated :( > > Tijnema >> >> >> ~~~ >> Rahul Sitaram Johari >> CEO, Twenty Four Seventy Nine Inc. >> >> W: http://www.rahulsjohari.com >> E: [EMAIL PROTECTED] >> >> ³I morti non sono piu soli ... The dead are no longer lonely² >> >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions issue on share
On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Ave, "Or make sure the user apache runs on has write access to the share." That's the problem I'm facing. I'm not sure how to do that. If I'm not mistaken, Apache runs as user "nobody" on my Mac, but I don't know how to give that user write access on the Windows Machine. Yes, it is quite complicated :( I believe this has nothing to do with your windows machine, but with the mount on your Mac. I'm not very familiar with Mac OS X (Although i have installed it) I know it's based on a linux kernel, and uses same mount tools. I think a simple chmod 777 to the mount folder would do the job. so if you have it mounted at /Share chmod 777 /Share I believe that windows mounts everything with chmod value 777, so that shouldn't be a problem. Tijnema > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> >> Ave, >> >> I¹m not sure if anyone here is going to be able to help, but I¹ve run into a >> permissions snag. >> I have Apache Web Server running on Mac OS X with PHP. I have a folder on a >> windows machine mounted on my Mac OS X as a share using the ³mount t smbfs >> //[EMAIL PROTECTED]/ShareName Share². >> The ³user² has full read-write permission and physically I¹m able to do >> anything I want sitting on my Mac OS X in this share, like create, delete or >> modify files. >> >> The problem is, I don¹t think Apache Web Server (or PHP) has write access on >> this share. In PHP, I¹m able to read data from files on this share, but I¹m >> not able to write data to any file on that share. I get access is denied. >> >> Is there anyway through PHP to give Apache or PHP write access to the files >> on this share? >> I don¹t see how I can provide Apache Web Server (installed on my Mac) Write >> Access through the Windows System that has the original folder. Windows is >> only able to provide the Mac User with Permissions, not Apache. >> >> Any help would be appreciated. >> >> Thanks > > You could chmod the whole share to 777 but that might give problems! > Or make sure the user apache runs on has write access to the share. > But normal each file is set with permission 755, means that only the > owner can write to it. > > I'm not able to give a real fix right now, but it is quite complicated :( > > Tijnema >> >> >> ~~~ >> Rahul Sitaram Johari >> CEO, Twenty Four Seventy Nine Inc. >> >> W: http://www.rahulsjohari.com >> E: [EMAIL PROTECTED] >> >> ³I morti non sono piu soli ... The dead are no longer lonely² >> >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions issue on share
On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: rahul:~/Documents/XFER rjohari$ ls -la osm total 26548 drwxr-xr-x 1 rjohari rjohari16384 31 Dec 1969 . drwxr-xr-x 5 rjohari rjohari 170 22 Mar 12:08 .. -rwxr-xr-x 1 rjohari rjohari21508 13 Sep 2006 .DS_Store [snip] -rwxr-xr-x 1 rjohari rjohari11264 21 Sep 16:47 warm092106.xls I was guessing that, all files and folders have the 755 permission..., meaning that the owner can edit, but the group and all other can't. I did some googling for you, and you should mount your share with -o fmask=777,dmask=777 so your example mount command becomes: mount t smbfs -o fmask=777,dmask=777 //[EMAIL PROTECTED]/ShareName Share that should do it :) Tijnema On 3/22/07 12:31 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> >> Well chmod is certainly not doing anything. I tried that to begin with. I >> don't get an error, but it doesn't change any permissions. Just doesn't do >> anything to the permissions of the file/folder. Like it's just ignored. >> >> I did it as root using sudo. > > Can you post the log of the "ls -la Share" command here? > > Tijnema >> >> >> On 3/22/07 12:18 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: >> >>> On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Ave, "Or make sure the user apache runs on has write access to the share." That's the problem I'm facing. I'm not sure how to do that. If I'm not mistaken, Apache runs as user "nobody" on my Mac, but I don't know how to give that user write access on the Windows Machine. Yes, it is quite complicated :( >>> >>> I believe this has nothing to do with your windows machine, but with >>> the mount on your Mac. I'm not very familiar with Mac OS X (Although i >>> have installed it) I know it's based on a linux kernel, and uses same >>> mount tools. I think a simple chmod 777 to the mount folder would do >>> the job. >>> so if you have it mounted at /Share >>> chmod 777 /Share >>> I believe that windows mounts everything with chmod value 777, so that >>> shouldn't be a problem. >>> >>> Tijnema > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> >> Ave, >> >> I¹m not sure if anyone here is going to be able to help, but I¹ve run >> into >> a >> permissions snag. >> I have Apache Web Server running on Mac OS X with PHP. I have a folder on >> a >> windows machine mounted on my Mac OS X as a share using the ³mount t >> smbfs >> //[EMAIL PROTECTED]/ShareName Share². >> The ³user² has full read-write permission and physically I¹m able to do >> anything I want sitting on my Mac OS X in this share, like create, delete >> or >> modify files. >> >> The problem is, I don¹t think Apache Web Server (or PHP) has write access >> on >> this share. In PHP, I¹m able to read data from files on this share, but >> I¹m >> not able to write data to any file on that share. I get access is >> denied. >> >> Is there anyway through PHP to give Apache or PHP write access to the >> files >> on this share? >> I don¹t see how I can provide Apache Web Server (installed on my Mac) >> Write >> Access through the Windows System that has the original folder. Windows >> is >> only able to provide the Mac User with Permissions, not Apache. >> >> Any help would be appreciated. >> >> Thanks > > You could chmod the whole share to 777 but that might give problems! > Or make sure the user apache runs on has write access to the share. > But normal each file is set with permission 755, means that only the > owner can write to it. > > I'm not able to give a real fix right now, but it is quite complicated :( > > Tijnema >> >> >> ~~~ >> Rahul Sitaram Johari >> CEO, Twenty Four Seventy Nine Inc. >> >> W: http://www.rahulsjohari.com >> E: [EMAIL PROTECTED] >> >> ³I morti non sono piu soli ... The dead are no longer lonely² >> >> >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >> >> >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions issue on share
rahul:~/Documents/XFER rjohari$ ls -la osm total 26548 drwxr-xr-x 1 rjohari rjohari16384 31 Dec 1969 . drwxr-xr-x 5 rjohari rjohari 170 22 Mar 12:08 .. -rwxr-xr-x 1 rjohari rjohari21508 13 Sep 2006 .DS_Store -rwxr-xr-x 1 rjohari rjohari 82 14 Sep 2006 ._Temporary Items -rwxr-xr-x 1 rjohari rjohari 945181 22 Mar 09:44 ALL.dbf drwxr-xr-x 1 rjohari rjohari16384 22 Mar 13:27 DISPO -rwxr-xr-x 1 rjohari rjohari 4608 28 Feb 14:04 HFGLEND.CDX -rwxr-xr-x 1 rjohari rjohari 6172 28 Feb 14:04 HFGLEND.DBF -rwxr-xr-x 1 rjohari rjohari 4608 28 Feb 14:04 HFMESA.CDX -rwxr-xr-x 1 rjohari rjohari 6172 28 Feb 14:04 HFMESA.DBF -rwxr-xr-x 1 rjohari rjohari 4608 28 Feb 14:04 HFPHENX.CDX -rwxr-xr-x 1 rjohari rjohari 6172 28 Feb 14:04 HFPHENX.DBF -rwxr-xr-x 1 rjohari rjohari 6435 7 Nov 15:15 HFUND.DBF -rwxr-xr-x 1 rjohari rjohari 642844 7 Nov 15:15 OSM.DBF -rwxr-xr-x 1 rjohari rjohari 142848 21 Mar 19:57 OSMH.CDX -rwxr-xr-x 1 rjohari rjohari 1820024 21 Mar 19:58 OSMH.DBF -rwxr-xr-x 1 rjohari rjohari12288 21 Mar 19:42 OSMT.CDX -rwxr-xr-x 1 rjohari rjohari 3072 16 Nov 14:03 TEST.CDX -rwxr-xr-x 1 rjohari rjohari12804 16 Nov 14:51 TEST.DBF -rwxr-xr-x 1 rjohari rjohari 7116 21 Sep 17:02 TEST_RUN.DBF -rwxr-xr-x 1 rjohari rjohari 4608 2 Mar 13:44 TRANSBX.CDX -rwxr-xr-x 1 rjohari rjohari 714 21 Mar 17:13 TRANSBX.DBF -rwxr-xr-x 1 rjohari rjohari 191 31 Oct 17:53 TRANSDIR.DBF drwxr-xr-x 1 rjohari rjohari16384 14 Sep 2006 Temporary Items -rwxr-xr-x 1 rjohari rjohari 4608 21 Feb 21:00 dmam.CDX -rwxr-xr-x 1 rjohari rjohari22752 21 Feb 21:01 dmam.DBF -rwxr-xr-x 1 rjohari rjohari54784 22 Mar 08:25 novastar.CDX -rwxr-xr-x 1 rjohari rjohari 6490610 22 Mar 08:25 novastar.DBF -rwxr-xr-x 1 rjohari rjohari44032 3 Nov 13:53 osm.CDX -rwxr-xr-x 1 rjohari rjohari 573 20 Sep 2006 osm_move.FXP -rwxr-xr-x 1 rjohari rjohari 407 20 Sep 2006 osm_move.prg -rwxr-xr-x 1 rjohari rjohari40448 29 Dec 15:41 osma.CDX -rwxr-xr-x 1 rjohari rjohari 486992 29 Dec 15:41 osma.DBF -rwxr-xr-x 1 rjohari rjohari 4608 21 Mar 16:05 osmf.CDX -rwxr-xr-x 1 rjohari rjohari 132180 21 Mar 16:05 osmf.DBF -rwxr-xr-x 1 rjohari rjohari89088 28 Feb 18:57 osmj.CDX -rwxr-xr-x 1 rjohari rjohari 1098794 28 Feb 18:57 osmj.DBF -rwxr-xr-x 1 rjohari rjohari31232 21 Mar 19:43 osmn.CDX -rwxr-xr-x 1 rjohari rjohari 319534 21 Mar 19:43 osmn.DBF -rwxr-xr-x 1 rjohari rjohari31744 21 Mar 19:22 osmp.CDX -rwxr-xr-x 1 rjohari rjohari 372590 21 Mar 19:22 osmp.DBF -rwxr-xr-x 1 rjohari rjohari 659424 21 Mar 19:42 osmt.dbf -rwxr-xr-x 1 rjohari rjohari 314 7 Nov 11:02 transbr2.DBF -rwxr-xr-x 1 rjohari rjohari 314 7 Nov 17:19 transbranch.DBF -rwxr-xr-x 1 rjohari rjohari11264 21 Sep 16:47 warm092106.xls On 3/22/07 12:31 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> >> Well chmod is certainly not doing anything. I tried that to begin with. I >> don't get an error, but it doesn't change any permissions. Just doesn't do >> anything to the permissions of the file/folder. Like it's just ignored. >> >> I did it as root using sudo. > > Can you post the log of the "ls -la Share" command here? > > Tijnema >> >> >> On 3/22/07 12:18 PM, "Tijnema !" <[EMAIL PROTECTED]> wrote: >> >>> On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Ave, "Or make sure the user apache runs on has write access to the share." That's the problem I'm facing. I'm not sure how to do that. If I'm not mistaken, Apache runs as user "nobody" on my Mac, but I don't know how to give that user write access on the Windows Machine. Yes, it is quite complicated :( >>> >>> I believe this has nothing to do with your windows machine, but with >>> the mount on your Mac. I'm not very familiar with Mac OS X (Although i >>> have installed it) I know it's based on a linux kernel, and uses same >>> mount tools. I think a simple chmod 777 to the mount folder would do >>> the job. >>> so if you have it mounted at /Share >>> chmod 777 /Share >>> I believe that windows mounts everything with chmod value 777, so that >>> shouldn't be a problem. >>> >>> Tijnema > On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: >> >> Ave, >> >> I¹m not sure if anyone here is going to be able to help, but I¹ve run >> into >> a >> permissions snag. >> I have Apache Web Server running on Mac OS X with PHP. I have a folder on >> a >> windows machine mounted on my Mac OS X as a share using the ³mount t >> smbfs >> //[EMAIL PROTECTED]/ShareName Share². >> The ³user² has full read-write permission and physically I¹m able to do >> anything I want sitting on my Mac OS X in this share, like create, delete >> or >>
Re: [PHP] Permissions issue on share
On 3/22/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Ave, I¹m not sure if anyone here is going to be able to help, but I¹ve run into a permissions snag. I have Apache Web Server running on Mac OS X with PHP. I have a folder on a windows machine mounted on my Mac OS X as a share using the ³mount t smbfs //[EMAIL PROTECTED]/ShareName Share². The ³user² has full read-write permission and physically I¹m able to do anything I want sitting on my Mac OS X in this share, like create, delete or modify files. The problem is, I don¹t think Apache Web Server (or PHP) has write access on this share. In PHP, I¹m able to read data from files on this share, but I¹m not able to write data to any file on that share. I get access is denied. Is there anyway through PHP to give Apache or PHP write access to the files on this share? I don¹t see how I can provide Apache Web Server (installed on my Mac) Write Access through the Windows System that has the original folder. Windows is only able to provide the Mac User with Permissions, not Apache. Any help would be appreciated. Thanks You could chmod the whole share to 777 but that might give problems! Or make sure the user apache runs on has write access to the share. But normal each file is set with permission 755, means that only the owner can write to it. I'm not able to give a real fix right now, but it is quite complicated :( Tijnema ~~~ Rahul Sitaram Johari CEO, Twenty Four Seventy Nine Inc. W: http://www.rahulsjohari.com E: [EMAIL PROTECTED] ³I morti non sono piu soli ... The dead are no longer lonely² -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions
On Fri, April 21, 2006 3:48 pm, Benjamin Adams wrote: > I have a text file that is just being read by php > Can I change the permissions of it so www can not read it? Yes. Then PHP cannot read it, if your setup is what I think it is... > what username does php uses to read files? That depends. If PHP is running as a Module to Apache (see phpinfo output and search for SAPI) then it runs as the same user Apache runs as, which is set in httpd.conf by the "User" directive. 'www' is a very common choice for this setting, so you probably have PHP running as a Module with 'www' as the user, based on what you posted. PHP can also be run as CGI or FastCGI, and in those cases can, if desired, be configured via suexec to be run as some other user. That's pretty much what suexec does. There are wrinkles and risks to using suexec, and some for using CGI, including perforamnce issues. So it's not usually done on inexpensive shared hosting, nor on high-volume servers. Under IIS, I don't know (or care) how the user process file permission stuff works. Actually, I *do* recall fighting with MS and something about IUSER_MACHINENAME at some point in Windows 95/98 days, in case that helps some very sorry luser reading this post. Back to your topic: If you make your text file un-readable (or un-writable or un-executable) by the User that PHP us running as (probably 'www' in your case) then PHP simply cannot read (or write or execute, if you change those) the file. The converse is, unfortunately also true: If PHP runs as the 'www' user and the 'www' user can read the file, then PHP can read the file. Why "unfortunately", you ask? Because ANYBODY who can write and upload a PHP script to that machine can read that file. This means that on most shared servers at a reasonable price-point, you simply have to take a leap of faith and trust your fellow users to not poke around in your stuff too much. Please see previous post regarding credit card numbers and hot potatoes to make a connection now. Thank you. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions
Benjamin Adams wrote: I have a text file that is just being read by php Can I change the permissions of it so www can not read it? what username does php uses to read files? Use a .htaccess file, if your web server supports it. For example, in apache2 you can do this: Order Allow,Deny Deny From All See: http://httpd.apache.org/docs/2.0/howto/htaccess.html, http://httpd.apache.org/docs/2.0/mod/core.html#files, and http://httpd.apache.org/docs/2.0/mod/core.html#filesmatch jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions
Benjamin Adams wrote: I have a text file that is just being read by php Can I change the permissions of it so www can not read it? what username does php uses to read files? Usually www, so you could have a bit of a problem there. PHP runs under the same user Apache does, although there are ways to change that you'll have to get that info from Google or someone else since I've never needed it. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions on uploaded image don't allow for over writing
Jason, Hugh, John, Thanks for all your help. And thanks Hugh for sending me your FTP script. It turns out that the chmod() command was the magic bullet I was looking for. By placing chmod ($imageName, 0777) ... into the script right after it places the uploaded file in it's destination directory, it is then ready to be over written by future users. I appreciate everyone taking the time to answer my question. -- Dave Gutteridge [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions on uploaded image don't allow for over writing
On Sunday 30 January 2005 23:04, Dave wrote: > I'm not sure what you mean when you say "use PHP's FTP". I'm using > $HTTP_POST_FILES because the files are retrieved through a web form. What is meant by that is that after the file is uploaded, during your processing of the upload file, instead of using something like move_uploaded_file() you use php's ftp_*() functions to FTP upload that file back to the server, in the process that file will be owned by whatever ftp user account you used to perform the ftp operations. > As for the user, I would assume that it's whatever default for any > viewer coming to a web page. I have people log in using a user name and > password retrieved from a MySQL database, but I don't see how the > browser or the server would know about that. > The thing is I'm really a newbie at this Unix server and file > permission thing. I was really hoping that there was some parameter I > could set to have the uploaded file set to full access permissions, Have a look at umask() and chmod(). -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- New Year Resolution: Ignore top posted posts -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions on uploaded image don't allow for over writing
John, Hugh, I'm not sure what you mean when you say "use PHP's FTP". I'm using $HTTP_POST_FILES because the files are retrieved through a web form. As for the user, I would assume that it's whatever default for any viewer coming to a web page. I have people log in using a user name and password retrieved from a MySQL database, but I don't see how the browser or the server would know about that. The thing is I'm really a newbie at this Unix server and file permission thing. I was really hoping that there was some parameter I could set to have the uploaded file set to full access permissions, as it took all the PHP scripting knowledge I had just to get it working as much as it is now. I guess what confuses me most is, if the file was uploaded from a user from the web, how is it not already on the same permission level for other users also accessing the file from the web? It seems like any user can upload and make a file that they can't touch again, and requires an administrator to get rid of. -- Dave Gutteridge [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions on uploaded image don't allow for over writing
Dave wrote: PHP List, The Situation: I am building a content management system where users can, among other things, upload images into a directory. The Problem: The image uploads fine, but once it's there, it can't be over written. So if a user uploads an image, and then changes his or her mind and wants to upload a new version over it, the file upload fails. What I've Tried So far: I can manually edit the file permissions using chmod and setting the files to 777. But of course that's not something I want to have to do every time someone uploads a file. I don't know enough about file permissions and settings to know how I can set these permissions at the time that someone makes the upload. The Question: How do I allow a user, who is uploading via the web, place an image on the server with permissions that allow the file to be over written? Check the permissions on the file you have uploaded. Who is the owner? Does the user running PHP have the 'w' permission? Try 'chown'ing the image directory to the user that is running PHP. -John -John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions on uploaded image don't allow for over writing
Use php's ftp commands. Hugh - Original Message - From: "Dave" <[EMAIL PROTECTED]> To: Sent: Saturday, January 29, 2005 11:11 AM Subject: [PHP] Permissions on uploaded image don't allow for over writing PHP List, The Situation: I am building a content management system where users can, among other things, upload images into a directory. The Problem: The image uploads fine, but once it's there, it can't be over written. So if a user uploads an image, and then changes his or her mind and wants to upload a new version over it, the file upload fails. What I've Tried So far: I can manually edit the file permissions using chmod and setting the files to 777. But of course that's not something I want to have to do every time someone uploads a file. I don't know enough about file permissions and settings to know how I can set these permissions at the time that someone makes the upload. The Question: How do I allow a user, who is uploading via the web, place an image on the server with permissions that allow the file to be over written? -- Dave Gutteridge [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.7.4 - Release Date: 1/25/2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.7.4 - Release Date: 1/25/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Permissions
Sorry, I do not know the exect anaswer but i have one rough idea that in PHP we have one function by which we can run the linux command like fun_name("") Actually i used this function long before so i forgot we can use chmod 777 to our file or any command to change the permissionand by this we can solve tis problem (may Be) Ankur Quoting Jay Blanchard <[EMAIL PROTECTED]>: > [snip] > I have a need for a PHP application to read/write Linux system files > that > have root.root ownership. At present reading not a problem but writing > obviously is denied. I know there are probably some serious security > issues > here, but what should I be doing to allow this behaviour. I am running > PHP > 4.3.8 on Linux Redhat Fedora 1 installed as an Apache module. > [/snip] > > either change the file permissions, making it something other than root > or chmod the file 766 so that all have read and write access to it. PHP > is running under whatever persmissions Apache is running (if that is how > you have it installed). > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions
Hi Phil, Phil Ewington - 43 Plc wrote: Hi All, I have a need for a PHP application to read/write Linux system files that have root.root ownership. At present reading not a problem but writing obviously is denied. I know there are probably some serious security issues here, but what should I be doing to allow this behaviour. I am running PHP 4.3.8 on Linux Redhat Fedora 1 installed as an Apache module. I'd write a wrapper. The wrapper has the suid and/or the sgid bit set. Your script from the webserver opens a process for that wrapper. The wrapper sets uid and/or gid, then reads its conf with new privileges; where to put the files. Next it opens stdin and reads from it. There you php-script writes data to the process-descriptor. The wrapper checks whether it is meaningful data, and if, it stores data at the place it's conf said to store it. So your phpscript isn't exploitable that much that it can overwrite random system control files. Just an idea. Stephan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Permissions
[snip] I have a need for a PHP application to read/write Linux system files that have root.root ownership. At present reading not a problem but writing obviously is denied. I know there are probably some serious security issues here, but what should I be doing to allow this behaviour. I am running PHP 4.3.8 on Linux Redhat Fedora 1 installed as an Apache module. [/snip] either change the file permissions, making it something other than root or chmod the file 766 so that all have read and write access to it. PHP is running under whatever persmissions Apache is running (if that is how you have it installed). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions with bash scripts in php?
Jason Wong wrote: > On Tuesday 13 January 2004 06:46, Jas wrote: > > [Please trim your posts!] > > >>Just tried that and I am getting the same error. I guess what I am >>really looking for is a way to have apache restart the service without >>adding the apache user in the 'sudoers' file. > > > If you really must restart system services over insecure interfaces such as a > web browser then consider using something which was 'tailor-made' for the > purpose eg Webmin. Webmin is not ideal, but since you are having to ask the > question I would assume that it would be better than anything you could come > up with at this moment in time. > > If you still want develop your own, then have a look in the archives for > possible solutions using sudo, or cronjobs. > So instead of having a function to run a bash script which would restart the dhcp service after a new dhcpd.conf file has been written (which would run under the same user as the httpd service). You are suggesting to run a cron job which would maybe run every 5 or 10 minutes to run the bash script which restarts the service? Would this be the most secure method of accomplishing such a task? Or is there a way to put a hook in the bash script which php could execute as a privledged user? Thanks for the insight, Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions with bash scripts in php?
On Tuesday 13 January 2004 06:46, Jas wrote: [Please trim your posts!] > Just tried that and I am getting the same error. I guess what I am > really looking for is a way to have apache restart the service without > adding the apache user in the 'sudoers' file. If you really must restart system services over insecure interfaces such as a web browser then consider using something which was 'tailor-made' for the purpose eg Webmin. Webmin is not ideal, but since you are having to ask the question I would assume that it would be better than anything you could come up with at this moment in time. If you still want develop your own, then have a look in the archives for possible solutions using sudo, or cronjobs. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* What's all this brouhaha? */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions with bash scripts in php?
Jake McHenry wrote: - Original Message - From: "Jas" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 12, 2004 4:47 PM Subject: [PHP] permissions with bash scripts in php? Something I have never tried... seems fairly straight-forward but I am running into problems. My problem is that I need to call system to restart a daemon service like so... /tmp/error "); ?> Script contains this command... #!/bin/bash /path/to/dhcpd -cf /path/to/config/dhcpd So far so good right? I mean it works from a command line so why not from php. Lets check some permissions... httpd as Apache:Apache script.sh as Apache:Apache Upon inspection of 'error file' in /tmp I find this... unable to create icmp socket: Operation not permitted Can't create new lease file: Permission denied And... Can't bind to dhcp address: Permission denied Please make sure there is no other dhcp server running and that there's no entry for dhcp or bootp in /etc/inetd.conf. Also make sure you are not running HP JetAdmin software, which includes a bootp server. So lets set a sticky bit on the script.sh and /path/to/config/dhcpd $> chmod 1777 /path/to/config/dhcpd $> chmod 1777 script.sh So far so good but I am still recieving the same error, if anyone has some good tips on what would be the most efficient & SECURE way of starting this service please point me to the tutorial Thanks a ton. Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php is the apache user and group able to run the script from the command line? I know under rh9, you have to be root to start / stop / restart just about all the services. Just an idea. Jake Just tried that and I am getting the same error. I guess what I am really looking for is a way to have apache restart the service without adding the apache user in the 'sudoers' file. Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions with bash scripts in php?
- Original Message - From: "Jas" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 12, 2004 4:47 PM Subject: [PHP] permissions with bash scripts in php? > Something I have never tried... seems fairly straight-forward but I am > running into problems. > > My problem is that I need to call system to restart a daemon service > like so... > $cmd = "/path/to/shell/script/script.sh"; > system($cmd . " &> /tmp/error "); > ?> > > Script contains this command... > #!/bin/bash > /path/to/dhcpd -cf /path/to/config/dhcpd > > So far so good right? I mean it works from a command line so why not > from php. Lets check some permissions... > httpd as Apache:Apache > script.sh as Apache:Apache > > Upon inspection of 'error file' in /tmp I find this... > > unable to create icmp socket: Operation not permitted > Can't create new lease file: Permission denied > > And... > > Can't bind to dhcp address: Permission denied > Please make sure there is no other dhcp server > running and that there's no entry for dhcp or > bootp in /etc/inetd.conf. Also make sure you > are not running HP JetAdmin software, which > includes a bootp server. > > So lets set a sticky bit on the script.sh and /path/to/config/dhcpd > $> chmod 1777 /path/to/config/dhcpd > $> chmod 1777 script.sh > > So far so good but I am still recieving the same error, if anyone has > some good tips on what would be the most efficient & SECURE way of > starting this service please point me to the tutorial Thanks a ton. > Jas > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > is the apache user and group able to run the script from the command line? I know under rh9, you have to be root to start / stop / restart just about all the services. Just an idea. Jake -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions on server
On Tue, 2003-07-08 at 07:21, Steve Jackson wrote: > If I set permissions of my server root to chmod 777 that's a security > risk right? > How do I set my server to allow me to write a file to my web root from > another directory using PHP? Or is it a Unix problem? > > I have a generator file writes a string to a text file and then renames > the text file as a PHP file however it occurred to me while I was doing > this that chmod 777 the root might not be a good idea. > > Anyone have a simple fix or idea for this? Change the ownership on the directory to whichever user apache is running as (this is the User directive in your httpd.conf file). Then you can restrict the permissions on that directory. You could probably make it 600 if you want. Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions to work with fopen
Tahnk you, but I don't want to let web user see the log file "Nicholas Wieland" <[EMAIL PROTECTED]> wrote in message 20030216011528.GA1411@localhost">news:20030216011528.GA1411@localhost... > On 2003.02.15 20:11 qt wrote: > > I am planning to make a log file with fopen command. > > > > I am succesfully read and write the file with fopen. But as I see > > fopen is requiring a file with read and write permission for public. > > Not for public, for your webserver user, www-data or another similar > name. > > > I was using same method with perl in cgi-bin directory; but I was > > giving read and write permission for only owner. > > > > If I give write and read permission for only owner; fopen command can > > not read the file. > > > > Do you have any idea, how can I make log file with protecting from > > public? > > Give pemissions to your web server user. > > Cheers > Nicholas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions to work with fopen
On 2003.02.15 20:11 qt wrote: I am planning to make a log file with fopen command. I am succesfully read and write the file with fopen. But as I see fopen is requiring a file with read and write permission for public. Not for public, for your webserver user, www-data or another similar name. I was using same method with perl in cgi-bin directory; but I was giving read and write permission for only owner. If I give write and read permission for only owner; fopen command can not read the file. Do you have any idea, how can I make log file with protecting from public? Give pemissions to your web server user. Cheers Nicholas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions
You can use array with the user permissions (stored in a session variable), and use it someway like if($_SESSION['perm']['do_that']) echo 'Do that'; Shaun wrote: Hi I want to make a secure site. The username , password and permission of the users must be stored in database. I only want certain icons (navigation bars) to be available to certain users. How would i be able to do this with permissions ? Thanks Shaun -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PERMISSIONS
On Thu, 12 Sep 2002, Breno Cardoso Perucchi wrote: > system("mkdir /home/hosting/test"); > but the PERMISSION IS DENIED and I am the root on my server. > How I change the user to root? Dude, you don't change to the root user ... you'll get yourself owned that way. Change the permissions on the directory to allow the web server's user to write files and create subdirectories. For example, most of my boxen run apache as user 'www-data' -- # chown root:www-data /home/hosting # chmod 2775 /home/hosting ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PERMISSIONS
I know, but how I change to root user? -- Atenciosamente Breno Cardoso Perucchi [EMAIL PROTECTED] Consultor - Omega Tecnologia http://www.omegatec.net/ "Adam Williams" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > you don't. php/apache run as the user nobody for security purposes. > > Adam > > On Thu, 12 Sep 2002, Breno Cardoso Perucchi wrote: > > > HI, > > I am trying to use a script php with the command: > > system("mkdir /home/hosting/test"); > > but the PERMISSION IS DENIED and I am the root on my server. > > > > How I change the user to root? > > > > Thanks > > > > -- > > Atenciosamente > > > > Breno Cardoso Perucchi > > [EMAIL PROTECTED] > > Consultor - Omega Tecnologia > > http://www.omegatec.net/ > > > > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PERMISSIONS
you don't. php/apache run as the user nobody for security purposes. Adam On Thu, 12 Sep 2002, Breno Cardoso Perucchi wrote: > HI, > I am trying to use a script php with the command: > system("mkdir /home/hosting/test"); > but the PERMISSION IS DENIED and I am the root on my server. > > How I change the user to root? > > Thanks > > -- > Atenciosamente > > Breno Cardoso Perucchi > [EMAIL PROTECTED] > Consultor - Omega Tecnologia > http://www.omegatec.net/ > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions issue under NT?
Jason Wong <[EMAIL PROTECTED]> wrote: >> I've tried changing the /tmp permissions, but the combinations >> are considerable, and I don't have time to try them all. I was hoping >> someone could point me in the right direction. > > Set it world readable/writeable? Oooh, nasty. That should be your last option. Assuming you're using a default install of IIS, PHP will run under the IUSR_machine user. Give that user full access to the tmp directory and you should be ok. If that does not work then take Jason's advice. If you're using apache then I can't really help but I would guess that it's a similar situation. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions issue under NT?
> Dan - It seemed pretty obvious to me too, but again, the ini file > hasn't changed since the whole thing worked. What has changed are the > permissions under NT. I've tried changing the /tmp permissions, but > the combinations are considerable, and I don't have time to try them > all. I was hoping someone could point me in the right direction. /tmp doesnt exist under windows - thats a unix path. Try changing it to a path that does exist. I dont use windows so you will have to try one of the following (assuming the dir you want it c:\temp\) c:\\temp c:\temp c:/temp One of those should work... I dont know if you need to escape php.ini values (hence the \\ and \ options). -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software & Systems Engineer First Creative Ltd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions issue under NT?
On Tuesday 07 May 2002 21:58, brent wrote: > At 02:30 PM 5/7/02 +0100, you wrote: > > > Help. I've managed to hose myself. I had this page working fine until I > > > went in and screwed up my users under NT4. I can't backtrack and > > > figure out what I changed. Can anyone point me in the right direction? > > > Is this a permissions issue? Thanks. > > Dan - It seemed pretty obvious to me too, but again, the ini file hasn't > changed since the whole thing worked. What has changed are the permissions > under NT. Never mind the ini file. Your problem is that php can't write to /tmp, Dan was just suggesting another way to deal with it. > I've tried changing the /tmp permissions, but the combinations > are considerable, and I don't have time to try them all. I was hoping > someone could point me in the right direction. Set it world readable/writeable? -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* And on the eighth day, we bulldozed it. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions issue under NT?
At 02:30 PM 5/7/02 +0100, you wrote: > > Help. I've managed to hose myself. I had this page working fine until I > > went in and screwed up my users under NT4. I can't backtrack and > > figure out what I changed. Can anyone point me in the right direction? > > Is this a permissions issue? Thanks. Dan - It seemed pretty obvious to me too, but again, the ini file hasn't changed since the whole thing worked. What has changed are the permissions under NT. I've tried changing the /tmp permissions, but the combinations are considerable, and I don't have time to try them all. I was hoping someone could point me in the right direction. Thanks. >Ok, sorry if Im gonna sound a little blunt, but the following error message >looks rather obvious to me. > > > Warning: Failed to write session data (files). Please verify that the > > current setting of session.save_path is correct (/tmp) in Unknown on > > line 0 > >Open your php.ini file and change "session.save_path" from "/tmp" >to "c:/temp" (or where-ever you wish it to go) > >-- >Dan Hardiker [[EMAIL PROTECTED]] >ADAM Software & Systems Engineer >First Creative Ltd > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions issue under NT?
On Tuesday 07 May 2002 21:30, Dan Hardiker wrote: > Ok, sorry if Im gonna sound a little blunt, but the following error message > looks rather obvious to me. > > > Warning: Failed to write session data (files). Please verify that the > > current setting of session.save_path is correct (/tmp) in Unknown on > > line 0 > > Open your php.ini file and change "session.save_path" from "/tmp" > to "c:/temp" (or where-ever you wish it to go) Plus a quick search of the archives would reveal that the same question was answered just yesterday. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Patch griefs with proverbs. -- William Shakespeare, "Much Ado About Nothing" */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions issue under NT?
> Help. I've managed to hose myself. I had this page working fine until I > went in and screwed up my users under NT4. I can't backtrack and > figure out what I changed. Can anyone point me in the right direction? > Is this a permissions issue? Thanks. Ok, sorry if Im gonna sound a little blunt, but the following error message looks rather obvious to me. > Warning: Failed to write session data (files). Please verify that the > current setting of session.save_path is correct (/tmp) in Unknown on > line 0 Open your php.ini file and change "session.save_path" from "/tmp" to "c:/temp" (or where-ever you wish it to go) -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software & Systems Engineer First Creative Ltd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions
andy thomas wrote: > > PHP will always run as the same user as Apache runs as. > true in Apache 1.3 and 2.0's prefork and worker mode. Not so in perchild (once it starts working :) ) -- === Jim Jagielski [|] [EMAIL PROTECTED] [|] http://www.jaguNET.com/ "A society that will trade a little liberty for a little order will lose both and deserve neither" - T.Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions
On Mon, 4 Mar 2002, John Gurley wrote: > Can someone pleas tell me if there is something funny when it comes to unix > permissions and PHP. When php creates a file in unix the owner is > nobody...does this raise any issues, and if it does could someone please > tell me a web site where I could read more about this. Thanks alot. PHP will always run as the same user as Apache runs as. This will often be something like 'httpd', 'www_run', 'www', 'www-adm', etc but sometimes user 'nobody' is used for this. So if any files are created by Apache or PHP during normal operation, these will be owned by that user. The one exception is the Apache log files - these are normally owned by root, the user Apache's parent process runs as initially before it forks child servers running as user 'nobody', etc. Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] permissions
Apache, and therefore PHP are running under the nobody account on your machine therefore files are created by the nobody user. You can read up on permissions by using man chmod, man chown, man chgrp. Check www.apache.org's excellent documentation for more info on how Apache interacts with the OS at the file level (or the O'Reilly Horse book) and check www.phph.net for additional info on how PHP deals with this. HTH, =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: John Gurley [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 2:26 PM To: [EMAIL PROTECTED] Subject: [PHP] permissions Can someone pleas tell me if there is something funny when it comes to unix permissions and PHP. When php creates a file in unix the owner is nobody...does this raise any issues, and if it does could someone please tell me a web site where I could read more about this. Thanks alot. John _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permissions on uploaded files via PHP
Justin, If your PHP script is placing the files there, they are owned by the 'web' user. The web user doesn't have permission to change the file ownership to you, but for your purposes all you should need to do is change the file permissions in your PHP script after the file is uploaded: chmod($filename, 0644); Carl On Thu, 17 Jan 2002, Justin French wrote: > Hi, > > I have a script which uploads an image to a directory within web root > (on Redhat 7.0). Whilst the dir itself was created via FTP, the images > of course have been written to the dir via a PHP script. > > When I try to FTP a copy of the images down to my local hard disk, I get > "permission denied". > > > What's happening here? My guess is the following: > > Things like this performed by PHP are not attached to me (the user)... > they're probably performed by nobody or root or something, hence I (the > FTP user and account holder) don't own the uploaded file, and the > permissions set for the file by default are not wide enough to permit me > to download it, rename it, etc. > > Correct? > > > So, then what do I need to do? Does the script which uploads the file > have to change the owner anmd permissions of the file? > > > Justin French > Indent.com.au > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Permissions on File
So sprach »Power Programmer« am 2001-09-14 um 13:06:05 -0700 : > What permissions would I set a php file to that could only be ready by > somebody logged into the server as root but still be executed via a website? root can always read each and everything, so you don't have to care about this "user". For the "executed via a website" part, you need to know under which user the web server process is running. This user needs to be able to read the file, and nobody else. So, something like this: chown file chmod 400 file Alexander Skwar -- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 1 day 11 hours 29 minutes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] permissions when using fopen
If Apache/php runs under nobody user, than make all files read only by the group of nobody, and no other users to be in this group. Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: "Pascal Chouinard" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 27, 2001 8:06 PM Subject: [PHP] permissions when using fopen > Hi, > > I want to read a file on my web server in a .php script using fopen and > I don't want to set read permissions on this file for everyone. However it > seems that the PHP module has that same access to the filesystem that > everyone would have. I can only read this file if I set read permissions for > everyone. Can I change the access right of the PHP module on the server's > filesystem without lowering security and if so, how can change this? > > Thanks in advance, > > Pascal Chouinard > [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]