LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 09-19-2006, 09:38 PM   #1
bondcaliwood
LQ Newbie
 
Registered: Sep 2006
Posts: 3

Rep: Reputation: 0
How do I make chown unrestricted?


Hi,

I am running Red Hat Linux Fedora and think I need to change the value
of the POSIX constant _POSIX_CHOWN_RESTRICTED to 0 so that users other
than root can change the owner of files.

I have found many posts that talk around the subject and some say use
this to change it...but whatever the code is doen'yt work, at least not

on the command line.

I am new to Linux and so need it spelling out a bit more clearly :-)

Can someone please explain exactly how to do this?

Thanks, Nick.
 
Old 09-19-2006, 10:00 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 162Reputation: 162
It might be better (easier?) to allow users to use chown via sudo so that you can restrict who can use it. Have you used sudo before? It's configured with the file /etc/sudoers
 
Old 09-19-2006, 10:10 PM   #3
bondcaliwood
LQ Newbie
 
Registered: Sep 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Yeah i have configured sudo and that does work but that's not really the reason i need it.

I am installing a piece of software that durring the install unpacks files and then attemps to change the owner of them and it is failing here.

Before you sugget it I am installing the software as root but durring the install it "su" to adminuser where adminuser is a user that will become the administrator for the new software. (Don't ask me why!)

So I have tried hacking the install script so that it uses "sudo chown ...." and gave adminuser access to sudo but that hasn't worked.

I would just like to dissable this restricted chown for the install.
 
Old 09-19-2006, 11:46 PM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,023

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Quote:
Originally Posted by bondcaliwood
So I have tried hacking the install script so that it uses "sudo chown ...." and gave adminuser access to sudo but that hasn't worked.
I would hack the script and comment-out the chown entirely. Then go back later and run an equivalent chown manually, as root.

Sounds like a bug in the script to me.
 
Old 09-20-2006, 01:30 AM   #5
bondcaliwood
LQ Newbie
 
Registered: Sep 2006
Posts: 3

Original Poster
Rep: Reputation: 0
After some more debugging of the install script it turns out that the problem is not with the explicit "chown" commands although these would cause problems but it falls over before this on the following tar command.

(cd /tmp/xxinstall/unpack/xxx; /bin/gzip -c -d linux.tgz) | (cd /xxx/mydir/; /bin/tar xfo -)

So it seems that it is trying to change the owner when unpacking the files. Is this normal? How do i control this behaviour.

And still the question is can I change the behaviour of Linux so it allows chown by users other than root??????

Thanks for suggestions so far,

Nick.
 
Old 09-20-2006, 06:26 AM   #6
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
The cd, gzip and tar commands you posted cannot change file ownership. They do however rely on file/directory access permissions. All they do is unzip/untar an existing file (/tmp/xxinstall/unpack/xxx/linux.tgz) into
a directory called /xxx/mydir.

If you want us to help you debug the script, please post (the relevant piece of) it.

Or alternative, try finding out why the commands you posted fail, starting off by posting the output of
Code:
ls -l /tmp/xxinstall/unpack/xxx
ls -ld /xxx/mydir/
Alternatively, you could also try adding 2>/tmp/error.log at the end of the pipe, to get a clue on what goes wrong.
 
  


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
How do i add a second hard drive to use for unrestricted file sharing? gizmo911uk Linux - Networking 8 09-12-2005 03:13 AM
Chown -R Jakeh2k1 Linux - General 3 10-31-2004 04:23 PM
Give local computer unrestricted access Boffy Linux - Security 2 08-15-2004 05:23 PM
chown -R ujotne Programming 3 02-25-2004 12:02 PM
chown Sathe Linux - General 13 10-14-2002 11:25 AM


All times are GMT -5. The time now is 01:33 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