473,396 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

getting around a permissions problem

I created a (real estate) site which has an area that is used by the agent
to post and edit property listings. They have the ability here to upload
pictures.

If the listing is new, it is assigned an ID, info posted to database and a
directory created using the ID to hold the uploaded pics.

The problem I have is that when they add a listing and the directory gets
created, it is uid/gid apache/apache, and this should work fine for web
access, however, I also need to make it accessible to the owner via ftp so
that they can make site changes, etc.

All of the scripts were uploaded via ftp and have the uid of the owner 10002
I think and gid of the ftp, etc. grp which is 2522.

If I try running a script against the directory created while adding the
listing, I get an error "the program whose uid/gid is 10002/10001 is not
allowed to access...etc.

It would seem that after creating the directory I could chgrp it to 2522
allowing access to it from the web but how can I change the ownership to
10002 at the time of creation?

I am thinking that I might have to run a cron job or something to reset the
perms on those files and directories.

Any suggestions would be greatly appreciated.
Jul 17 '05 #1
3 1433
Mike Wasilewski (ml**@bellsouth.net) wrote:
: I created a (real estate) site which has an area that is used by the agent
: to post and edit property listings. They have the ability here to upload
: pictures.

: If the listing is new, it is assigned an ID, info posted to database and a
: directory created using the ID to hold the uploaded pics.

: The problem I have is that when they add a listing and the directory gets
: created, it is uid/gid apache/apache, and this should work fine for web
: access, however, I also need to make it accessible to the owner via ftp so
: that they can make site changes, etc.

: All of the scripts were uploaded via ftp and have the uid of the owner 10002
: I think and gid of the ftp, etc. grp which is 2522.

: If I try running a script against the directory created while adding the
: listing, I get an error "the program whose uid/gid is 10002/10001 is not
: allowed to access...etc.

: It would seem that after creating the directory I could chgrp it to 2522
: allowing access to it from the web but how can I change the ownership to
: 10002 at the time of creation?

: I am thinking that I might have to run a cron job or something to reset the
: perms on those files and directories.

: Any suggestions would be greatly appreciated.

You could use a suid script. Do _not_ suid to root or anything silly like
that, but to a userid that is able to create the directories and set the
necessary ownerships and permissions.

The program that doesn't have access would then call on that script when
it needs a new directory created. The script must of course check its
input to be sure that is all it can be used for.

$0.02

--

This space not for rent.
Jul 17 '05 #2
"Mike Wasilewski" <ml**@bellsouth.net> wrote in message
news:WJ******************@bignews5.bellsouth.net.. .
I created a (real estate) site which has an area that is used by the agent
to post and edit property listings. They have the ability here to upload
pictures.

If the listing is new, it is assigned an ID, info posted to database and a
directory created using the ID to hold the uploaded pics.

The problem I have is that when they add a listing and the directory gets
created, it is uid/gid apache/apache, and this should work fine for web
access, however, I also need to make it accessible to the owner via ftp so
that they can make site changes, etc.

All of the scripts were uploaded via ftp and have the uid of the owner 10002 I think and gid of the ftp, etc. grp which is 2522.

If I try running a script against the directory created while adding the
listing, I get an error "the program whose uid/gid is 10002/10001 is not
allowed to access...etc.

It would seem that after creating the directory I could chgrp it to 2522
allowing access to it from the web but how can I change the ownership to
10002 at the time of creation?

I am thinking that I might have to run a cron job or something to reset the perms on those files and directories.

Any suggestions would be greatly appreciated.


chmod the files to 0777, maybe?
Jul 17 '05 #3
"Mike Wasilewski" <ml**@bellsouth.net> writes:
I created a (real estate) site which has an area that is used by the agent
to post and edit property listings. They have the ability here to upload
pictures.

If the listing is new, it is assigned an ID, info posted to database and a
directory created using the ID to hold the uploaded pics.

The problem I have is that when they add a listing and the directory gets
created, it is uid/gid apache/apache, and this should work fine for web
access, however, I also need to make it accessible to the owner via ftp so
that they can make site changes, etc.

All of the scripts were uploaded via ftp and have the uid of the owner 10002
I think and gid of the ftp, etc. grp which is 2522.

If I try running a script against the directory created while adding the
listing, I get an error "the program whose uid/gid is 10002/10001 is not
allowed to access...etc.

It would seem that after creating the directory I could chgrp it to 2522
allowing access to it from the web but how can I change the ownership to
10002 at the time of creation?

I am thinking that I might have to run a cron job or something to reset the
perms on those files and directories.

Any suggestions would be greatly appreciated.


The issue of permissions with php scripts can be a real problem
when you want folks to upload files. I assume your servers also support
cgi and 'hopefully' runs PERL with suexec (scripts run with their permissions).
It is not "too" bad to have your PHP scripts feed them to a PERL script to
handle the upload. Then permission are okay and security is not a problem.

Have not tried it, but you could also run PHP as a CGI script
and get the same benefit.

Hope this helps.

--
John
__________________________________________________ _________________
John Murtari Software Workshop Inc.
jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM)
http://thebook.com/
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Seagull Manager | last post by:
Running Apache 1.3, PHP 4.3, and WinXP, configured acc. to instructions on apache manual and php manual (as far as I can see), but getting "internal server error" in browser... log says "Premature...
15
by: lkrubner | last post by:
I want to give users the power to edit files from an easy interface, so I create a form and a PHP script called "fileUpdate". It does a reasonable about of error checking and prints out some...
303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
4
by: Nick | last post by:
I'm developing an intranet app, and want to get the current user name for logging purposes. I've turned off anonymous access, and turned on windows authentication in the IIS config. The apps...
1
by: jsever05 | last post by:
Hey there... I am using ASP.NET to create a web application running on IIS 5.0. In this app, I am linking to an external COM DLL (written in C++ by somebody else), and creating an instance of an...
22
by: Dale Pennington | last post by:
I find myself in the odd situation of trying to determine the name of a file that has been opened somewhere else with an fopen call, so all I have is the FILE * from that fopen call. I perused my...
2
by: David C | last post by:
I have an aspx page with an editible GridView. When I click the Update button the stored procedure runs (I know because the underlying data was changed) but throws an exception as follows: ...
5
by: Rahul Babbar | last post by:
Hi, I am getting the error while trying to take a backup of the schema according to the backupschema.sql written at http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0602... ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.