Bug 193209 - [patch] install @sample files with mode u+w
Summary: [patch] install @sample files with mode u+w
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-31 18:09 UTC by Olli Hauer
Modified: 2014-10-03 18:34 UTC (History)
1 user (show)

See Also:


Attachments
[patch] install @sample files with mode u+w (943 bytes, patch)
2014-08-31 18:09 UTC, Olli Hauer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olli Hauer freebsd_committer freebsd_triage 2014-08-31 18:09:14 UTC
Created attachment 146611 [details]
[patch] install @sample files with mode u+w

Most of the @sample files are installed with u+r and this is not handy for fresh installs.

I'm building my ports already with the patch, so my users don't have to change u+w the .conf files.
The .sample file is not touched and keeps the original mode.
Comment 1 John Marino freebsd_committer freebsd_triage 2014-09-01 11:08:14 UTC
Hmm, don't you have the authority to assign your PRs directly instead of letting it fall to people doing triage?

assinging to portmgr@...
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2014-09-01 11:33:04 UTC
This will fix it all at once https://reviews.freebsd.org/D703
Comment 3 Olli Hauer freebsd_committer freebsd_triage 2014-09-01 12:18:59 UTC
(In reply to John Marino from comment #1)
> Hmm, don't you have the authority to assign your PRs directly instead of
> letting it fall to people doing triage?
> 
> assinging to portmgr@...

Sorry, I haven't noticed and assumed if I open a PR in infrastructure which has a remark portmgr@ it will be assigned automatically.
Comment 4 Mathieu Arnold freebsd_committer freebsd_triage 2014-09-01 12:20:19 UTC
(In reply to Olli Hauer from comment #3)
>  it will be assigned automatically.

There's no automatic assignment in bugzilla.
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2014-09-06 03:10:46 UTC
Although they are aliased, canonicalize assignment for searching purposes.
Comment 6 Olli Hauer freebsd_committer freebsd_triage 2014-09-30 21:53:27 UTC
Even the fix from https://reviews.freebsd.org/D703 was committed there are still ports affected (e.g. openldap24-server) because they use own install routines.

Hacking all ports with own install routines is still more work then this fix.

Index: Keywords/sample.ucl
===================================================================
--- Keywords/sample.ucl      (revision 369664)
+++ Keywords/sample.ucl      (working copy)
@@ -22,7 +22,7 @@
   esac
   target_file="${sample_file%.sample}"
   if ! [ -f "${target_file}" ]; then
-    /bin/cp -p "${sample_file}" "${target_file}"
+    /bin/cp -p "${sample_file}" "${target_file}" && /bin/chmod u+w "${target_file}"
   fi
 EOD
 pre-deinstall: <<EOD
Comment 7 Bryan Drewery freebsd_committer freebsd_triage 2014-09-30 23:09:54 UTC
(In reply to Olli Hauer from comment #6)
> Even the fix from https://reviews.freebsd.org/D703 was committed there are
> still ports affected (e.g. openldap24-server) because they use own install
> routines.
> 
> Hacking all ports with own install routines is still more work then this fix.
> 
> Index: Keywords/sample.ucl
> ===================================================================
> --- Keywords/sample.ucl      (revision 369664)
> +++ Keywords/sample.ucl      (working copy)
> @@ -22,7 +22,7 @@
>    esac
>    target_file="${sample_file%.sample}"
>    if ! [ -f "${target_file}" ]; then
> -    /bin/cp -p "${sample_file}" "${target_file}"
> +    /bin/cp -p "${sample_file}" "${target_file}" && /bin/chmod u+w
> "${target_file}"
>    fi
>  EOD
>  pre-deinstall: <<EOD

I agree with this.
Comment 8 commit-hook freebsd_committer freebsd_triage 2014-10-03 18:34:17 UTC
A commit references this bug:

Author: bdrewery
Date: Fri Oct  3 18:33:32 UTC 2014
New revision: 369927
URL: https://svnweb.freebsd.org/changeset/ports/369927

Log:
  @sample: chmod u+w to ensure user may write to it.

  PR:		193209
  Submitted by:	ohauer
  With hat:	portmgr

Changes:
  head/Keywords/sample.ucl