Bug 154437 - mail/nullmailer: permission problems on trigger, queue and tmp
Summary: mail/nullmailer: permission problems on trigger, queue and tmp
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Greg Larkin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-01 13:20 UTC by Uffe Jakobsen
Modified: 2011-04-27 14:40 UTC (History)
0 users

See Also:


Attachments
file.txt (1.51 KB, text/plain)
2011-02-01 13:20 UTC, Uffe Jakobsen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Uffe Jakobsen 2011-02-01 13:20:06 UTC
mail/nullmailer: permission problems on trigger, queue and tmp

I installed the nullmailer-1.05 binary package 

The  following dirs queue, tmp and the (fifo)file trigger are owned by root - thus preventing nullmailer from working.


/var/spool/nullmailer/queue/
/var/spool/nullmailer/tmp/
/var/spool/nullmailer/trigger

Fix: patch to ports files attached

Patch attached with submission follows:
How-To-Repeat: just install nullmailer and try to use it.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-02-01 13:20:13 UTC
Responsible Changed
From-To: freebsd-ports-bugs->glarkin

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Greg Larkin freebsd_committer freebsd_triage 2011-02-11 22:36:56 UTC
State Changed
From-To: open->analyzed

I have been running various installs/deinstalls with BATCH and 
PACKAGE_BUILDING set.  The Makefile defines USERS and GROUPS, and 
Mk/bsd.port.mk is supposed to take care of user creation during port 
and package installation. 

However, I think the ports infrastructure's automatic user creation commands 
are executed after the various chown/chmod commands in pkg-plist. 

I will investigate further next week, and I believe there is a solution 
to the problem.
Comment 3 Nick Hibma 2011-02-28 13:40:26 UTC
glarkin's conclusion is right. The patch given does not change the ports =
behaviour (what did happen is that the user was present during the =
second install by the user, so the permissions were set up correctly).

See the +CONTENTS file after installing the package:

...
@exec chown -R nullmail /var/spool/nullmailer/*
@exec chown nullmail %D/sbin/nullmailer-queue
@exec chmod u+s %D/sbin/nullmailer-queue
@exec chown nullmail %D/libexec/nullmailer/mailq
@exec chmod u+s %D/libexec/nullmailer/mailq
...
@unexec if [ -n "$BATCH" ]; then echo "Warning: In batch mode, I will do =
'rmuser -y nullmail'"; rmuser -y nullmail; fi;
@exec if ! /usr/sbin/pw groupshow nullmail >/dev/null 2>&1; then =
/usr/sbin/pw groupadd nullmail -g 522; fi
@exec if ! /usr/sbin/pw usershow nullmail >/dev/null 2>&1; then =
/usr/sbin/pw useradd nullmail -u 522 -g 522  -c "Nullmailer Mail System" =
-d /var/spool/nullmailer -s /bin/sh; fi
@exec install -d -g 522 -o 522 /var/spool/nullmailer
...

(unrelated statements left out for clarity).=
Comment 4 Greg Larkin 2011-04-25 16:09:59 UTC
Hello all,

I have prepared a diff for the current mail/nullmailer port that I
believe fixes the ownership issues and other package-related problems. 
When you have a moment, can you patch your local ports tree with my diff
and see if it fixes the problems reported in this PR?

http://people.freebsd.org/~glarkin/diffs/nullmailer-PR-154437.diff

Thank you,
Greg
-- 
*Greg Larkin*
Managing Member

*SourceHosting.net, LLC* <http://www.sourcehosting.net/>
PO Box 1013
Hollis, NH 03049
US
	*Work:* 603 821-1412
*Email:* glarkin@sourcehosting.net <mailto:glarkin@sourcehosting.net>
*IM:* sourcehosting (Skype)
*http://www.linkedin.com/in/greglarkin*
	

See who we know in common <http://www.linkedin.com/e/wwk/146767/> 	Want
a signature like this? <http://www.linkedin.com/e/sig/146767/>
Comment 5 Greg Larkin freebsd_committer freebsd_triage 2011-04-25 16:10:25 UTC
State Changed
From-To: analyzed->feedback

Prepared a diff and waiting for test feedback.
Comment 6 dfilter service freebsd_committer freebsd_triage 2011-04-27 14:29:34 UTC
glarkin     2011-04-27 13:29:22 UTC

  FreeBSD ports repository

  Modified files:
    mail/nullmailer      Makefile distinfo pkg-plist 
    mail/nullmailer/files nullmailer.in 
  Log:
  - Fixed spool file ownerships when installing from a package
  - Various pkg-plist cleanups to ensure that chmod/chown commands are
    executed in the proper order during package installation
  - Added LICENSE
  - Fixed REQUIRES: in rc.d script
  - Bumped PORTREVISION
  
  PR:             ports/154437 (based on)
  Submitted by:   Uffe Jakobsen <uffe@uffe.org>
  
  Revision  Changes    Path
  1.21      +18 -7     ports/mail/nullmailer/Makefile
  1.9       +0 -1      ports/mail/nullmailer/distinfo
  1.4       +2 -2      ports/mail/nullmailer/files/nullmailer.in
  1.8       +11 -14    ports/mail/nullmailer/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 7 Greg Larkin freebsd_committer freebsd_triage 2011-04-27 14:30:07 UTC
State Changed
From-To: feedback->closed

Committed with additional changes, thank you!