Re: Changing permissions of ps command

From: Chris Mattern (syscjm_at_gwu.edu)
Date: 07/24/03


Date: Thu, 24 Jul 2003 17:14:20 -0400

Kishore wrote:
> Hi All,
> I have a problem here, i had tried to change the prmissions of command
> ps to 777 from 555.

Er, why? You *don't* want J. Average User rewriting your system
commands. Trust me on this.

> But the permissions of few other files are getting
> changed. I had noticed that all these files are hard links and their
> inode is same.

That is correct. Permissions are kept in the inode, not the pathname.
All pathnames that are hardlinked to the same inode have the same
permissions; change one, and you change them all.

> Probably because of this it is creating the problem.

It's not a "problem". It is simply how the Unix filesystem works.

> But, the output of each program is different.

That's because the code looks at what command name was used to
invoke it and changes its behavior based on how you called it.

> Anyways, how do i set permission for only this files. Your suggestions
> will be highly Appreciated.

You don't. You have several pathnames that point to the same inode
(file). There is only one file which has several filenames. Since
permissions are kept in the inode and not the pathname, it is
physically impossible to make the different pathnames have different
permissions.

                  Chris Mattern



Relevant Pages

  • Re: inode table
    ... The inode table can only be manipulated by a kernel ... and the left and right arrow keys to edit the command. ... ''; it redirects standard input. ... though one can always use 'cat', ...
    (comp.os.linux.setup)
  • Re: functional differences between cp and mv
    ... Your daemon will still be writing to the ... restart logging to grab the new inode of your newly created trace.log file. ... thus having the process continue to write entries to the old original ... When using the web based GUI admin console or the command line admin ...
    (comp.unix.admin)
  • Re: [SLE] file permissions?
    ... >allow you to remove and create files, vim successfully wrote the file. ... >the vi command will not write a file if you don't have write permissions on ... opens for writing again and writes out the contents. ... the inode number was ...
    (SuSE)
  • Re: alias(rm as mv)
    ... On Mon, 2003-10-06 at 16:43, Jeff Kinz wrote: ... pathnames.. ... > file can besaved mutiple times in the archive. ... nautilus to the command line, since it implements it reasonably well. ...
    (RedHat)
  • Re: /usr/bin/login patch question
    ... > The 'chmod' command does not change the modification time of the inode. ...
    (Focus-SUN)