3

There is a symbolic link:

2:root@SERVER:/root # ls -la /usr/bin/passwd
lrwxrwxrwx    1 root     system           39 Feb  3 2014  /usr/bin/passwd -> /usr/es/sbin/cluster/utilities/clpasswd
2:root@SERVER:/root #

And there is the original binary:

2:root@SERVER:/root # ls -la /usr/es/sbin/cluster/utilities/clpasswd
-rwsr-xr-x    1 root     system       413726 Aug 29 2013  /usr/es/sbin/cluster/utilities/clpasswd
2:root@SERVER:/root # 

The symbolic link knows the "-R":

2:root@SERVER:/root # /usr/bin/passwd -R files root
Changing password for "root"
root's New password:
Terminating from signal
2:root@SERVER:/root # 

The clpasswd, original binary doesn't knows the "-R"

2:root@SERVER:/root # /usr/es/sbin/cluster/utilities/clpasswd -R files root
/usr/es/sbin/cluster/utilities/clpasswd: illegal option -- R


Usage: clpasswd cluster_user [ -g ResourceGroup ]
Where:
    -g ResourceGroup - Update on participating nodes only
                       Otherwise all cluster nodes receive update

2:root@SERVER:/root # 

Why doesn't the original binary knows the "-R" option, when the symbolic link knows it?

We tried with hard link too, didn't worked.

1 Answers1

0

The binary checks its filename.

0:root@SERVER:/root # ln -s /usr/es/sbin/cluster/utilities/clpasswd /tmp/passwd
0:root@SERVER:/root # /tmp/passwd -R files root
Changing password for "root"
root's New password:
Terminating from signal
0:root@SERVER:/root # mv /tmp/passwd /tmp/clpasswd
0:root@SERVER:/root # /tmp/clpasswd -R files root
/tmp/clpasswd: illegal option -- R


Usage: clpasswd cluster_user [ -g ResourceGroup ]
Where:
    -g ResourceGroup - Update on participating nodes only
                       Otherwise all cluster nodes receive update

0:root@SERVER:/root #