LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-23-2007, 11:40 AM   #1
senthilpr_in
LQ Newbie
 
Registered: Aug 2005
Distribution: FC4 2.6.11-1.1369_FC4smp
Posts: 21

Rep: Reputation: 15
How to start a process with specific uid/gid during bootup?


Hi all,

I have a process which I startup at boot time by adding the following line to my rc.local file

/usr/local/dcmtk/bin/dcmqrscp -c /home/db/dcmqrscp.cfg 2100 &

'dcmqrscp' is a server program, which receives files and writes them to a temp directory on disk. All Users can run a script which processes the files in this temp directory and deletes them after the processing is complete. The temp directory has 777 permission, but the files are created (by dcmqrscp) with a default permission of 644 and with the owner being root.

Should I start 'dcmqrscp' with a specific gid, to which all my users belong, so that they can delete the files in the temp directory, once they are done with their processing? What I'm looking for, is a way to make all the files created by 'dcmqrscp' program, world writeable, so that the script run by my users, will delete these files, once the processing is complete.

Thanks!

Senthil
 
Old 05-23-2007, 05:07 PM   #2
rednuht
Member
 
Registered: Aug 2005
Posts: 239
Blog Entries: 1

Rep: Reputation: 30
change the owner of the app to a user that has the required permissions and setuid the executable.
or change the owner of the folder and set setuid
read up on both of these http://en.wikipedia.org/wiki/Setuid
 
Old 05-23-2007, 05:10 PM   #3
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Rep: Reputation: 15
that's all you have to do?

so scripts and binaries run under whatever user owns the file?
 
Old 05-23-2007, 11:00 PM   #4
hackintosh
Member
 
Registered: Dec 2005
Posts: 52

Rep: Reputation: 15
u never know the danger of using SETGID and SETUID.

better pray your server dont break by others
 
Old 05-23-2007, 11:18 PM   #5
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Rep: Reputation: 15
Quote:
Originally Posted by hackintosh
u never know the danger of using SETGID and SETUID.

better pray your server dont break by others

then what is the right way to do it?
 
Old 05-24-2007, 12:22 AM   #6
hackintosh
Member
 
Registered: Dec 2005
Posts: 52

Rep: Reputation: 15
Quote:
Originally Posted by mattsoftnet
then what is the right way to do it?
as i mention in the security sub-forum, use sudo to instead of setuid or setgid.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is uid and gid rmanocha Linux - Software 9 08-19-2008 12:03 AM
Changing the UID of a Physical Volume to a specific UID jambraun Linux - Newbie 2 02-09-2006 03:34 PM
What is my uid/gid? Jeebizz Slackware 2 11-22-2005 12:39 PM
How can I change a user's uid and gid? homesp Debian 2 05-31-2005 03:39 PM
changing uid, gid zeke1955 Linux - General 4 01-10-2004 12:53 AM


All times are GMT -5. The time now is 03:08 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration