/usr/bin/pyspf: Permission denied
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyspf (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Steps to reproduce:
1. Install python3-spf
2. Install spf-tools-python
3. Run the "pyspf" command.
Expected output:
The command-line help for pyspf.
Actual output:
-bash: /usr/bin/pyspf: Permission denied
Some terminal output to illustrate:
$ pyspf
-bash: /usr/bin/pyspf: Permission denied
$ ls -l /usr/bin/pyspf
lrwxrwxrwx 1 root root 35 Jun 3 2022 /usr/bin/pyspf -> ../lib/
$ ls -l /usr/lib/
-rw-r--r-- 1 root root 79629 Jun 3 2022 /usr/lib/
$ pyspf
-bash: /usr/bin/pyspf: Permission denied
$ sudo chmod +x /usr/lib/
$ pyspf
/usr/bin/
"""Quote the value for a key-value pair in Received-SPF header field
To check an incoming mail request:
% python spf.py [-v] {ip} {sender} {helo}
% python spf.py 69.55.226.139 <email address hidden> mx1.wayforward.net
To test an SPF record:
% python spf.py [-v] "v=spf1..." {ip} {sender} {helo}
% python spf.py "v=spf1 +mx +ip4:10.0.0.1 -all" 10.0.0.1 <email address hidden> a
To fetch an SPF record:
% python spf.py {domain}
% python spf.py wayforward.net
To test this script (and to output this usage message):
% python spf.py
$
Suggested solution:
It appears that the /usr/lib/
I suggest one of the three possible solutions:
1. The python3-spf package could be updated to deploy the /usr/lib/
2. The spf-tools-python package could replace the symlink with a sort of a "shim script", which exec's python3 with the script path instead, preserving the same arguments, in order to work around the missing executable bit.
3. The spf-tools-python package could have some kind of post-install script to ensure that the executable bit is set on /usr/lib/
Workaround:
sudo chmod +x /usr/lib/
Versions:
Ubuntu 24.04.1 LTS
python3-spf 2.0.14-3
spf-tools-python 2.0.14-3