Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • oh, so you're saying I'll have to write a little bit more complex program similar to chmod to revert the changes to chmod itself (like something in C that revert the metadata settings to the original file itself (aka chmod). Commented Jan 19, 2019 at 20:18
  • There are many, many possibilities. You could archive your chmod binary, e.g. using pax, tar, or cpio, then change the permission metadata inside the archive using a hex editor, then extract it again. Or, just run ruby -e 'File.chmod(0755, "/bin/chmod"', or the Perl, Python, PHP, or Tcl equivalent. Commented Jan 19, 2019 at 21:56