rhash / RHash

Great utility for computing hash sums
http://rhash.sf.net
BSD Zero Clause License
586 stars 116 forks source link

1.4.2: shared library is installed with 644 permission #170

Closed kloczek closed 2 years ago

kloczek commented 3 years ago

https://github.com/rhash/RHash/blob/master/librhash/Makefile#L13 And it should be with 755.

rhash commented 3 years ago

What is your OS?

Permissions of shared libraries are discussed at stackexchange: Why are shared libraries executable?

kloczek commented 3 years ago

On any Unix (Linux/Solarix/*BSD) all libraries should be with 755.

rhash commented 3 years ago

I cannot confirm this.

Debian Linux

root@debian# lsb_release -d
Description:    Debian GNU/Linux 11 (bullseye)
root@debian# ls -l /usr/lib/lib*.so.* | grep -v '^l' | head -n3
-rw-r--r-- 1 root root 1517856 Dec 23  2020 /usr/lib/libBLT.2.5.so.8.6
-rw-r--r-- 1 root root  329680 Dec 23  2020 /usr/lib/libBLTlite.2.5.so.8.6
-rw-r--r-- 1 root root   56480 Jan 15  2018 /usr/lib/libdiscover.so.2.0.1

FreeBSD

root@freebsd:~ # uname -mrs
FreeBSD 12.1-RELEASE amd64
root@freebsd:~ # ls -l /usr/lib/lib*.so.* | grep -v '^l' | head -n3
-r--r--r--  1 root  wheel    19104 Nov  1  2019 /usr/lib/libBlocksRuntime.so.0
-r--r--r--  1 root  wheel   867016 Nov  1  2019 /usr/lib/libarchive.so.7
-r--r--r--  1 root  wheel   678304 Nov  1  2019 /usr/lib/libasn1.so.11
root@freebsd:~ # ls -l /usr/local/lib/lib*.so.* | grep -v '^[^ ]*[lx]' | head -n3
-rw-r--r--  1 root  wheel    18216 Apr 23  2020 /usr/local/lib/libcharset.so.1.0.0
-rw-r--r--  1 root  wheel    51960 Apr 23  2020 /usr/local/lib/libhistory.so.8.0
-rw-r--r--  1 root  wheel  1088552 Apr 23  2020 /usr/local/lib/libiconv.so.2.5.1

OpenBSD

openbsd# uname -mrs
OpenBSD 6.5 amd64
openbsd# ls -l /usr/lib/lib*.so.* | grep -v '^l' | head -n3
-r--r--r--  1 root  bin  46564560 Apr 13  2019 /usr/lib/libLLVM.so.0.0
-r--r--r--  1 root  bin   5139984 Apr 13  2019 /usr/lib/libc++.so.2.1
-r--r--r--  1 root  bin   1232152 Apr 13  2019 /usr/lib/libc++abi.so.0.1
openbsd# ls -l /usr/local/lib/lib*.so.* | grep -v '^l' | head -n3
-rw-r--r--  1 root  bin      17464 Apr 14  2019 /usr/local/lib/libasprintf.so.1.1
-rw-r--r--  1 root  bin      98712 Aug  6  2019 /usr/local/lib/libbz2.so.10.4
-rw-r--r--  1 root  bin      17232 Apr 14  2019 /usr/local/lib/libcharset.so.1.1
rhash commented 2 years ago

From the second thought, it is a bug.

RHash aims for portability, including Unix support, but HP-UX requires executable bit to be set for the shared library file, otherwise the library code can't be executed. Also Solaris and NetBSD sets executable bit for a shared library files.

The bug is fixed by 9903be0cb94b84188f9b3a42d6b6b8ca5073372e.

kloczek commented 2 years ago

Thank you :)

rhash commented 2 years ago

Fix included into RHash v1.4.3.