Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Go Back   Code Forums > Systems > Linux / BSD / OS X
User Name
Password

Reply
 
LinkBack Thread Tools Display Modes
Old 12-05-2005, 10:57 AM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
maintain a chown setting

i have this dev linux box that i'm using. from the web, i make it run a script that populates a directory.

after the directory gets populated, every file owner:group is set to apache:apache.

the problem here is that the user who's directory these files exist in can not modify the files.

i thought there was a way to set permissions on a directory, so any file recursively gets the same permission, .. but i'm not sure if there is a way to do this with keeping the owner:group the same. is there?
__________________
sde is offline   Reply With Quote
Old 12-05-2005, 02:34 PM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,114
Belisarius is on a distinguished road
I'm not following. At first glance, it sounds like you want chown -R, but based off whoever the directory is owned by, which would be an ls/awk script. I must be missing something though . . .
__________________
GitS
Belisarius is offline   Reply With Quote
Old 12-05-2005, 02:42 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
i worked around it by adding the user to the apache group and apache user to the user's group.

the thing is that this script gets executed on cron by the user. but there is also a web interface that can execute this script at any time.

if the web script executes, all the files in the directory that get generated are apache:apache. note that some files may have to be deleted as well.

so both the apache and the user need to be able to write to any file in these directories.
__________________
sde is offline   Reply With Quote
Old 12-05-2005, 08:14 PM   #4 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 595
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
why don't you make the user and apache members of the "web" group? that way you only have to make sure everything is group writable. You could even make the user part of the apache group as long as apache's secure files are only r/w by the apache user not the apache group.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 12-05-2005, 08:22 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
Quote:
Originally Posted by sde
i worked around it by adding the user to the apache group and apache user to the user's group.
like that?

i'm not sure i have a 'web' group. isn't that what the apache group is?

after the files get created, i chmod 775, so no matter if the user, or apache runs it next time, they can be written over.
__________________
sde is offline   Reply With Quote
Old 12-05-2005, 08:35 PM   #6 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 595
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
damn must be the la smog getting to me...I've grown blind.

EDIT Whoa don't make 'em executable if you don't trust your web users. You can open yyourself up for exploits.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 12-05-2005, 08:49 PM   #7 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
well it's a local internal dev box at work, so i'm not really concerned about the users. i don't think it really matters anyway since they are php files can be executed by pulling them up in the browser.

how is it so far , .. besides the smog?
__________________
sde is offline   Reply With Quote
Old 12-05-2005, 09:54 PM   #8 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 595
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
It's actually really cool, if a bit pricy, here. But work is awesome. I get two free meals a day and great health benefits. And the place is 100 percent linux. Really, it's my dream job.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Up GTKmm Feis Platform/API C++ 0 07-16-2005 08:46 PM
Setting the path for python scripting Intensegutwound All Other Coding Languages 7 11-23-2004 06:32 AM
Setting up a local test server with BadBlue DavH27 PHP 0 08-17-2004 03:28 PM
How do you pronounce CHMOD, CHGRP and CHOWN? Epsilon Lounge 9 03-06-2004 11:18 AM
setting the focus on a windows form with c# sde MS Technologies ( ASP, VB, C#, .NET ) 0 07-28-2003 06:14 AM


All times are GMT -8. The time now is 12:29 AM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle