Path: utzoo!mnetor!uunet!husc6!cmcl2!phri!roy
From: roy@phri.UUCP (Roy Smith)
Newsgroups: comp.unix.wizards
Subject: Re: Broken chmod
Message-ID: <3067@phri.UUCP>
Date: 14 Dec 87 23:43:33 GMT
References: <10841@brl-adm.ARPA>
Reply-To: roy@phri.UUCP (Roy Smith)
Organization: Public Health Research Inst. (NY, NY)
Lines: 17

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)?
-- 
Roy Smith, {allegra,cmcl2,philabs}!phri!roy
System Administrator, Public Health Research Institute
455 First Avenue, New York, NY 10016