Bug 191580 - The permissions of the config file of security/duo are wrong
Summary: The permissions of the config file of security/duo are wrong
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Ryan Steinmetz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-03 08:35 UTC by Ben
Modified: 2014-07-03 16:18 UTC (History)
3 users (show)

See Also:


Attachments
Patchfile for Makefile (1.04 KB, patch)
2014-07-03 08:35 UTC, Ben
no flags Details | Diff
Perms fix, libtool, no USE_GCC (3.69 KB, patch)
2014-07-03 13:39 UTC, Jason E. Hale
jhale: maintainer-approval? (zi)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben 2014-07-03 08:35:59 UTC
Created attachment 144367 [details]
Patchfile for Makefile

The port security/duo installs the following configuration files:

- /usr/local/etc/login_duo.conf
- /usr/local/etc/login_duo.conf.sample
- /usr/local/etc/pam_duo.conf
- /usr/local/etc/pam_duo.conf.sample

Currently the permissions on these files are set to 700 and the owner is root:wheel.

When you run the installed program login_duo it will fail as it expects the configuration file login_duo.conf to be owned by the user sshd only.

The attached patch fixes two issues:

1. Preserve the owner of the files which were set in the staging/work directory correctly
2. Set the permissions to 600 which should be sufficient
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2014-07-03 08:48:25 UTC
Over to maintainer
Comment 2 Jason E. Hale freebsd_committer freebsd_triage 2014-07-03 13:39:48 UTC
Created attachment 144369 [details]
Perms fix, libtool, no USE_GCC

The real fix should be in the pkg-plist.  All the Makefile needs to do is install the sample config.  The @sample directive will take care of copying .conf.sample to .conf.  The @mode and @owner directives will set the permissions and owner, respectively.  Since wheel is the default group, there is no reason to set it.

While I was looking at this, I noticed an unneeded patch (patch-lib__Makefile.am) it does nothing since automake isn't being run on it.  patch-lib__Makefile.in just fixes the pkgconfig path...that can just be done with USES=pathfix.

I also added USES=libtool to drop the .la files and removed the docs install hack because that is taken care of by staging.

Finally, this seems to build fine with clang, so the USE_GCC can be dropped.
https://redports.org/buildarchive/20140703131500-14885/
Comment 3 Ryan Steinmetz freebsd_committer freebsd_triage 2014-07-03 15:38:56 UTC
jhale@ patch approved.
Comment 4 Jason E. Hale freebsd_committer freebsd_triage 2014-07-03 16:18:12 UTC
Committed my patch in r360401.  Thanks!