Bug 259226 - mail/spampd: Fails to start after 2.61 upgrade: "Global symbol "$user" requires explicit package name
Summary: mail/spampd: Fails to start after 2.61 upgrade: "Global symbol "$user" requir...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Dag-Erling Smørgrav
URL:
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2021-10-17 12:04 UTC by bugs.freebsd.org@deadzone.dk
Modified: 2022-02-24 15:34 UTC (History)
3 users (show)

See Also:
koobs: maintainer-feedback? (des)
koobs: merge-quarterly?


Attachments
proposed patch (1.65 KB, patch)
2022-02-22 07:04 UTC, Daniel Morante
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description bugs.freebsd.org@deadzone.dk 2021-10-17 12:04:00 UTC
I upgraded my version of SpamPD from 2.53 to 2.61 and then it fails during startup.
It fails with "Global symbol "$user" requires explicit package name (did you forget to declare "my $user"?)"
I have discussed this with mpaperno on github.

https://github.com/mpaperno/spampd/issues/38

This line is in the FreeBSD ports version
 473: user_dir => (getpwnam($user))[7],
But not in the github version.

Right now i'm running with the github version, the only change i have made is to the shebang in the first line.

This change does not seem to be necessary.
Comment 1 mail 2022-01-27 23:47:37 UTC
(In reply to bugs.freebsd.org@deadzone.dk from comment #0)

Same here, just did the same upgrade and encountered the same error.

user_dir is not used in /usr/local/sbin/spampd itself so I deleted the line (473) after which the daemon started fine (looks to function as desired as well)

I didn't investigate whether or not user_dir is passed along to another object/class somewhere so  bugs.freebsd.org@deadzone.dk 's workaround might be better
Comment 2 Daniel Morante 2022-02-22 07:04:58 UTC
Created attachment 232003 [details]
proposed patch

Ran into this myself so I fixed the port to remove the patch file that is no longer needed. Currently using this new revision on my systems, no issues detected (so far).

Build was tested with Poudriere
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-02-24 15:10:30 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a455f124cf1c04c35142f2f9b51d4cefab9adfd3

commit a455f124cf1c04c35142f2f9b51d4cefab9adfd3
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2022-02-24 15:07:55 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2022-02-24 15:07:55 +0000

    mail/spampd: drop user_dir patch and maintainership

    PR:             259226

 mail/spampd/Makefile                     |  3 ++-
 mail/spampd/files/patch-spampd.pl (gone) | 10 ----------
 2 files changed, 2 insertions(+), 11 deletions(-)