FS#66718 - [opensmtpd] sendmail: this program must be setgid smtpq
Attached to Project:
Community Packages
Opened by ilf (ilf) - Wednesday, 20 May 2020, 08:33 GMT
Last edited by freswa (frederik) - Tuesday, 13 October 2020, 15:34 GMT
Opened by ilf (ilf) - Wednesday, 20 May 2020, 08:33 GMT
Last edited by freswa (frederik) - Tuesday, 13 October 2020, 15:34 GMT
|
Details
Description:
After the upgrade (6.6.4p1-2 -> 6.7.0p1-1), sending mails fails with: "sendmail: this program must be setgid smtpq" Additional info: * package version(s): 6.7.0p1-1 * config and/or log files etc. * link to upstream bug report, if any Steps to reproduce: % mail -s test test To: test Subject: test ^D ------- Envelope contains: To: test Subject: test Send this message [yes/no, empty: recompose]? y sendmail: this program must be setgid smtpq /home/test/dead.letter 1/123 mail: ... message not sent |
This task depends upon
Closed by freswa (frederik)
Tuesday, 13 October 2020, 15:34 GMT
Reason for closing: Fixed
Additional comments about closing: 6.7.1p1-4
Tuesday, 13 October 2020, 15:34 GMT
Reason for closing: Fixed
Additional comments about closing: 6.7.1p1-4
It adds a makedepends on the package itself so the package will be installed before build ensuring the smtpq user is created so chgrp does not fail with
chgrp smtpq /build/opensmtpd/pkg/opensmtpd/usr/bin/smtpctl || true
chgrp: invalid group: ‘smtpq’
sudo chgrp smtpq /usr/bin/smtpctl
sudo chmod g+s /usr/bin/smtpctl
That being said, I need to investigate a bit more before adding this to the package. I don't see why `make install` would not set the correct permissions if that's the only way the binary works.
libtool: install: /usr/bin/install -c smtpctl /build/opensmtpd/pkg/opensmtpd/usr/bin/smtpctl
libtool installs the file then chgrp is called but the group name is invalid in the chroot
chgrp smtpq /build/opensmtpd/pkg/opensmtpd/usr/bin/smtpctl || true
chgrp: invalid group: ‘smtpq’
If smtpq is replaced by 92 in the configure call then the call becomes
chgrp 92 /build/opensmtpd/pkg/opensmtpd/usr/bin/smtpctl || true
Not suggesting that approach just noting the result.
The chgrp is allowed to fail due to [1]. The chgrp call itself was added in [2]
[1] https://github.com/OpenSMTPD/OpenSMTPD/commit/198b332301f432eedfa3737be00bd7dbd159d235
[2] https://github.com/OpenSMTPD/OpenSMTPD/commit/e02d05d2ec470899363de4be658aca26de5a2466
$ ls -n /usr/bin/smtpctl
-r-xr-xr-x 1 0 92 155K Jun 3 11:30 /usr/bin/smtpctl*
$ grep smtpq /etc/group
smtpq:x:92:
```