13575
![]() |
|
|
|
|
|||||||
| General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
From reading the FreeBSD documentation, it seems like the setuid permission is given to a script or a program and allows it to run as another UID. The reason behind this, using the passwd command as an example, is to allow a non-root user to change their password without changing anyone else's password (passwd prevents one user from being able to change other user's passords). Is this correct? Is the setuid permission used for any other purpose than to allow a user to use a program to access a file as another user?
A follow on question (if the above is incorrect, ignore this question), would implementing finer-grained file permissions (different permissions for different portions of a file) remove the necessity for the setuid permission? For example, in the password database, each user would have permission to edit their own password, but not any other user's password. This way, passwd could run with the permissions of the user that's changing their password. I realize that this would be a huge rewrite, but beyond that, is this a possible solution, or would it just create more problems than it would solve? Last edited by DutchDaemon; May 8th, 2012 at 22:55. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816 / don't use [b] |
|
#2
|
||||
|
||||
|
Quote:
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
|
#3
|
|||
|
|||
|
Quote:
Moreover, remember that passwd(1) is an example, but other services could require suid even when not dealing with files. Last edited by DutchDaemon; May 8th, 2012 at 22:56. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816 / don't use [I] |
|
#4
|
|||
|
|||
|
Quote:
Quote:
I don't think you'd have to install any more programs and/or configuration files, just have to modify them to work with this new method. Could you explain more why you think user specific programs/configuration files would be needed? Could you give an example of when a program/script would need setuid permissions other than to edit files? Last edited by DutchDaemon; May 8th, 2012 at 22:57. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816 / don't use [b] |
|
#5
|
||||
|
||||
|
Quote:
Quote:
Quote:
Code:
dice@molly:~> ll /sbin/ping -r-sr-xr-x 1 root wheel 28016 Apr 22 18:27 /sbin/ping
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. Last edited by DutchDaemon; May 8th, 2012 at 22:58. |
|
#6
|
|||
|
|||
|
One implementation problem is that the current /etc/passwd file format uses a variable amount of data for each entry. This is a problem because the size of each entry could change, and the permissions/ownership of that entry's range would have to change with it. Ugly mess.
|
|
#7
|
|||
|
|||
|
Openwall TCB is an implementation of SGID-only passwd(1). You need the group to access /etc/tcb, but your actual password is writable by you. It stops the user randomly editing the file, and limits any flaws in passwd(1) to letting you mess with your password. They have the same concept for their crontabs.
|
|
#8
|
|||||
|
|||||
|
Quote:
Quote:
Quote:
![]() Quote:
Quote:
Last edited by DutchDaemon; May 9th, 2012 at 21:44. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816 / don't use [b] |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help with setuid | Slurp | FreeBSD Development | 2 | October 7th, 2011 08:11 |
| [Solved] setuid issues | Beeblebrox | Installation and Maintenance of FreeBSD Ports or Packages | 2 | March 13th, 2011 12:31 |
| Apache Maintenance - Clarification | jaymax | Installation and Maintenance of FreeBSD Ports or Packages | 6 | August 22nd, 2010 07:16 |
| [Solved] xorg setuid | ssn_bsd | X.Org | 6 | October 29th, 2009 15:47 |