klehr@sun.soe.clarkson.edu (Thomas J. Klehr) (12/15/90)
The following are patches to src/fs/link.c, that allow sticky directories. For those who aren't familiar with them, sticky directories restrict who may delete/rename a file in the directory. Only the owner of the file or the owner of the directory can delete/rename files in my implementation, as long as they have write-permission on the directory. root can also, of course. The definition of ALL_MODES in /usr/include/minix/const.h should be changed from 06777 to 07777 also. Sticky directories aren't really necessary for a single-user system, but sometimes they're a nice feature, as in /tmp, /usr/spool/mail, /usr/spool/at, or any other directory that you wish to leave world-writable, and yet keep some protection over what other users can delete. These directories can help limit the number of set-uid root files needed; `mail' and `at' no longer need to be set-uid root, since anyone can write to these directories, and nobody can delete anyone else's files. Tom (klehr@sun.soe.clarkson.edu) ------------------------------------------------------ begin 600 link.c.cdif M*BHJ(&9S+C$U,3 O;&EN:RYC"49R:2!.;W8@,S @,C$Z,S4Z-#8@,3DY, HM M+2T@;&EN:RYC"0E&<FD@3F]V(#,P(#(Q.C,W.C,R(#$Y.3 **BHJ*BHJ*BHJ M*BHJ*BHJ"BHJ*B Q,3DL,3(T("HJ*BH*+2TM(#$Q.2PQ,S @+2TM+0H@(" @ M<B ]($]+.PH@(" @:68@*" H<FEP(#T@861V86YC92AR;&1I<G L('-T<FEN M9RDI(#T]($Y)3%])3D]$12D@<B ](&5R<E]C;V1E.PH@( HK(" @:68@*" H M<B ]/2!/2RD@)B8@*')L9&ER<"T^:5]M;V1E("8@4U])4U946"D@)B8@(7-U M<&5R7W5S97(@)B8**R @(" @(" @*')L9&ER<"T^:5]U:60@(3T@9G M/F9P M7V5F9G5I9"D@)B8@*')I<"T^:5]U:60@(3T@9G M/F9P7V5F9G5I9"D@*2![ M"BL@"7!U=%]I;F]D92AR:7 I.PD)("\J('!U="!R:7 @:6YO9&4@8F%C:R J M+PHK( ER(#T@14%#0T53.PHK(" @?0HK( H@(" @+RH@268@97)R;W(L(')E M='5R;B!I;F]D92X@*B\*(" @(&EF("AR("$]($]+*2!["B @"7!U=%]I;F]D +92AR;&1I<G I.PH@ end ------------------------------------------------------ -- --------------- Thomas J. Klehr