Retaining file permissions

The Grand Master asg at sage.cc.purdue.edu
Fri Mar 1 08:55:34 AEST 1991


In article <1991Feb28.205734.26484 at athena.mit.edu> jik at athena.mit.edu (Jonathan I. Kamens) writes:
}
}  From write(2):
}
}     If the real user is not the super-user, then write clears
}     the set-user-id bit on a file.  This prevents penetration of
}     system security by a user who captures a writable set-user-
}     id file owned by the super-user.
}
}  If it only did it on executable files, then if there were a file on the disk
}that was setuid but not executable, a not-nice person could (a) figure out
}some way to write his own program into the file, and (b) use chmod to make it
}executable.  this defeats the purpose of the clearing of the set-user-id bit.

WAKE UP. You have got to be kidding. use chmod to make it executable???
If he could use chmod to make it executable, he could use chmod to turn
the suid bit on, which defeats the entire purpose of file ownership, 
system security, etc. 
Gee - I am glad you are not MY sysadmin
ANY modification to a suid file turns the suid bit off - this is handled
by the kernal. (unless root makes the modification). You cannot use cat,
cp, mv, write(2), or ANYTHING to keep the suid bit on. AHHHHGGG.
I am glad the designers of UNIX were not interested in doing this, 
or there would be NO security.
>From the pages of chmod(2)
     Only the owner of a file (or the super-user) may change the
     mode.
So, if I can cat > file, then chmod it to executable, It must be
my file!!! In which case it is not really any risk to system security.

}
}-- 
}Jonathan Kamens			              USnail:
}MIT Project Athena				11 Ashford Terrace
}jik at Athena.MIT.EDU				Allston, MA  02134
}Office: 617-253-8085			      Home: 617-782-0710
And I thoug MIT taught people to think before they speak.

			The Grand Master
			   Bruce Varney



More information about the Comp.unix.shell mailing list