Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#59301 - [msmtp] Retain executable bit for all users for the packaged scripts

Attached to Project: Arch Linux
Opened by naveen (naveen) - Wednesday, 11 July 2018, 16:17 GMT
Last edited by Antonio Rojas (arojas) - Thursday, 12 July 2018, 12:33 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Antonio Rojas (arojas)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Upstream msmtp source has the executable bit set for all users for the scripts (basically 755). However, the installed sources only set executable bit for root. This prevents us from linking to those scripts directly and using them. Please retain the exec bits for the scripts, as present upstream.

Upstream git tree:
$ ll scripts/msmtpq$ ls -al scripts/msmtpq
total 48
drwxr-xr-x 2 naveen naveen 4096 Jul 11 21:40 .
drwxr-xr-x 7 naveen naveen 4096 Jul 11 21:40 ..
-rwxr-xr-x 1 naveen naveen 23270 Jul 11 21:40 msmtpq
-rwxr-xr-x 1 naveen naveen 1005 Jul 11 21:40 msmtp-queue
-rw-r--r-- 1 naveen naveen 9298 Jul 11 21:40 README.msmtpq

Installed from package:
$ ls -al /usr/share/doc/msmtp/msmtpq
total 48
drwxr-xr-x 2 root root 4096 Jul 11 21:40 .
drwxr-xr-x 6 root root 4096 Jul 11 21:40 ..
-rwxr--r-- 1 root root 23270 Jun 16 18:36 msmtpq
-rwxr--r-- 1 root root 1005 Jun 16 18:36 msmtp-queue
-rw-r--r-- 1 root root 9298 Jun 16 18:36 README.msmtpq


Additional info:
* package version(s): 1.6.7-1
* config and/or log files etc.


Steps to reproduce:
Detailed above.
This task depends upon

Closed by  Antonio Rojas (arojas)
Thursday, 12 July 2018, 12:33 GMT
Reason for closing:  Fixed
Additional comments about closing:  msmtp 1.6.8-1
Comment by Doug Newgard (Scimmia) - Wednesday, 11 July 2018, 16:32 GMT
You want files to be executable in /usr/share/doc/? Sounds like u-x would make more sense.
Comment by naveen (naveen) - Wednesday, 11 July 2018, 17:19 GMT
I just want to be able to link to those, rather than copying them elsewhere so as not to miss upstream changes. These scripts are already set executable for root. Also, Debian seems to be setting these as executable for all users as well.

The other option is perhaps to install those under /usr/lib/msmtp?
Comment by Antonio Rojas (arojas) - Wednesday, 11 July 2018, 17:33 GMT
The package is currently unmaintained, please provide a patch if you want this to happen any time soon.
Comment by Earnestly (Earnest) - Wednesday, 11 July 2018, 17:56 GMT
Additionally, I'm unsure why it is necessary to make them executable at all. How are they being used which would prevent calling them with an appropriate interpreter?

Additonally additionally, why does the documentation need to be usable at all? The mentioned file itself is a trivial example, why not call `msmtpq --q-mgmt' directly instead? Admittdly `msmtpq' is rather more involved (and full of issues).
Comment by naveen (naveen) - Thursday, 12 July 2018, 04:55 GMT
Here's a patch that works for me:

diff --git a/msmtp/trunk/PKGBUILD b/msmtp/trunk/PKGBUILD
index 9403b26ac53..da3ce38bd3b 100644
--- a/msmtp/trunk/PKGBUILD
+++ b/msmtp/trunk/PKGBUILD
@@ -33,7 +33,8 @@ package_msmtp() {
install -d "${pkgdir}/usr/share/doc/msmtp"
cp -r scripts/{find_alias,msmtpqueue,msmtpq,set_sendmail} "${pkgdir}/usr/share/doc/msmtp/"
install -D -m644 doc/*.example "${pkgdir}/usr/share/doc/msmtp/"
-
+ chmod 755 ${pkgdir}/usr/share/doc/msmtp/{find_alias,msmtpqueue,set_sendmail}/*.sh
+ chmod 755 ${pkgdir}/usr/share/doc/msmtp/msmtpq/msmtp*
install -D -m644 scripts/vim/msmtp.vim "${pkgdir}/usr/share/vim/vimfiles/syntax/msmtp.vim"
}
Comment by naveen (naveen) - Thursday, 12 July 2018, 04:59 GMT
Not really sure what you mean by "why not call `msmtpq --q-mgmt' directly instead?"
This is about setting `msmtpq` to be executable by all users. Specifying an interpreter every time is a hassle.
This is not documentation, but rather a set of useful scripts that are being installed under /usr/share/doc similar to what Debian does (per the comment in the PKGBUILD).
As I mentioned previously, I don't mind having the scripts be installed somewhere else if having them under /usr/share/doc doesn't make sense.
Comment by Earnestly (Earnest) - Thursday, 12 July 2018, 08:23 GMT
These scripts are heavily commented examples, that doesn't mean they're not useful. If it were me I would remove all executable bits from these files and require the user copy them to somewhere in their PATH instead.
Comment by Antonio Rojas (arojas) - Thursday, 12 July 2018, 12:28 GMT
You may also want to ping upstream about having inconsistent permissions between their tarballs and their git repo

Loading...