심볼릭 링크가 있습니다:
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 #
그리고 원본 바이너리는 다음과 같습니다.
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 #
심볼릭 링크는 "-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 #
clpasswd, 원시 바이너리는 "-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 #
심볼릭 링크가 "-R" 옵션에 대해 알고 있는데 왜 원본 바이너리는 이에 대해 알지 못합니까?
우리는 또한 성공하지 못한 채 하드 링크를 시도했습니다.
답변1
바이너리는 파일 이름을 확인합니다.
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 #