Path: utzoo!mnetor!uunet!husc6!think!ames!umd5!umbc3!alex
From: alex@umbc3.UMD.EDU (Alex S. Crain)
Newsgroups: comp.unix.wizards
Subject: Re: Broken chmod
Message-ID: <641@umbc3.UMD.EDU>
Date: 15 Dec 87 08:59:00 GMT
References: <10841@brl-adm.ARPA> <3067@phri.UUCP>
Reply-To: alex@umbc3.UMD.EDU (Alex S. Crain)
Organization: University of Maryland, Baltimore County
Lines: 33

In article <3067@phri.UUCP> roy@phri.UUCP (Roy Smith) writes:
>In article <10841@brl-adm.ARPA> rbj@icst-cmr.arpa (Root Boy Jim) writes:
>> Awhile back, somebody lamented the fact that their chmod had somehow
>> acquired mode 644. Since there was no way to chmod chmod because it wasn't
>> executable, they loaded it from a backup tape.
>
>Why not just compile:
>
>main ()
>{
>	chmod ("/bin/chmod", 0755);
>}
>
>and run it (probably suid to root)?
>-- 
	     ^^^^^^^^^^^^^^^^^^^^^

hmmm... would you do this

# chmod 4755 a.out  

or perhaps

main()
{
	chmod( "a.out", 4755 );
}

which would require root protections, which if you had, you wouldn't need ;-)

						:alex.

alex@umbc3.imd.edu