Re: chmod a-x chmod Fix?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2006-01-06 at 08:13 -0500, Chasecreek Systemhouse wrote:

> 
> Is there a way to execute chmod when it is set 0644?  Is there a way
> to change the file permissions when chmod is disabled?
> 

Here is a way - there are bound to be a number of others.

Use "cp -p" to copy an arbitrary file that already has the desired perms
(ie. 755) to a scratch file.

Use "cat" to overwrite the scratch file with the contents of the chmod
executable.

Replace /bin/chmod with the scratch file (using cp -p again).


Eg.

cp -p /usr/bin/autoconf /tmp/scratch
cat /bin/chmod > /tmp/scratch
cp -p /tmp/scratch /bin/chmod

You could also write a quick bit of C code to call the chmod system
call. See "man 2 chmod".

Cheers, Ben



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux