Bug 192039 - [patch] net/delegate sanitize ADMIN setting, restore binary checksumming
Summary: [patch] net/delegate sanitize ADMIN setting, restore binary checksumming
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Danilo Egea Gondolfo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-22 18:11 UTC by Martin Birgmeier
Modified: 2014-07-23 10:50 UTC (History)
1 user (show)

See Also:


Attachments
patch to net/delegate/Makefile (1.23 KB, text/plain)
2014-07-22 18:11 UTC, Martin Birgmeier
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2014-07-22 18:11:37 UTC
Created attachment 144886 [details]
patch to net/delegate/Makefile

During some of the latest updates to net/delegate, the binary checksumming features seems to have been mishandled. On my system, this leads to delegate refusing to start.

Attached is a patch which restores binary checksumming. In addition, it allows to set the ADMIN variable (e.g., in /etc/make.conf) to a suitable, site-local value, and otherwise proposes a reasonable default for it.

/etc/make.conf could contain something along the lines:

.if ${.CURDIR:M*/net/delegate}
ADMIN=hostmaster@mail.xyzzy
.endif

This will override the port's default setting (see the patch).

The build has been tested on releng/9.2 and release/10.0.0, both i386 and amd64. Running has been tested on releng/9.2 i386.

-- Martin
Comment 1 John Marino freebsd_committer freebsd_triage 2014-07-22 18:13:42 UTC
over to maintainer
Comment 2 commit-hook freebsd_committer freebsd_triage 2014-07-22 19:02:08 UTC
A commit references this bug:

Author: danilo
Date: Tue Jul 22 19:01:20 UTC 2014
New revision: 362568
URL: http://svnweb.freebsd.org/changeset/ports/362568

Log:
  - Don't strip the binary. This breaks the binary checksumming
  - Introduce ADMIN variable

  PR:             ports/192039
  Submitted by:   Martin Birgmeier <la5lbtyi@aon.at>

Changes:
  head/net/delegate/Makefile
Comment 3 Danilo Egea Gondolfo freebsd_committer freebsd_triage 2014-07-22 20:25:18 UTC
This patch reintroduced the problem solved by danfe@. Seems the problem is not related to STRIP.

I'm proposing revert (partially) the commit and re-sign the binary after the staging step. Is that acceptable for you?

+post-install:
+# Re-sign the executable
+	@${CP} ${STAGEDIR}${PREFIX}/sbin/delegated ${WRKDIR}/tmp/dg
+	@${CHMOD} +w ${STAGEDIR}${PREFIX}/sbin/delegated
+	@${WRKDIR}/tmp/dg -Fesign -w ${STAGEDIR}${PREFIX}/sbin/delegated
+	@${CHMOD} -w ${STAGEDIR}${PREFIX}/sbin/delegated
+
Comment 5 commit-hook freebsd_committer freebsd_triage 2014-07-22 21:06:17 UTC
A commit references this bug:

Author: danilo
Date: Tue Jul 22 21:05:32 UTC 2014
New revision: 362580
URL: http://svnweb.freebsd.org/changeset/ports/362580

Log:
  - Fix the binary checksumming (use this approach until find a better solution)
  - Fix staging

  PR:		ports/192039

Changes:
  head/net/delegate/Makefile
Comment 6 Martin Birgmeier 2014-07-23 07:36:45 UTC
I think this method is also o.k., although it might break later should the upstream authors decide to rearrange their build logic.

However, could you please explain what was the problem solved by danfe@? (The subversion log unfortunately is too sparse.) - In my builds, using my version of the Makefile, I did not really notice any problem.

-- Martin
Comment 7 Alexey Dokuchaev freebsd_committer freebsd_triage 2014-07-23 07:54:47 UTC
The problem is that no port/package should touch files outside of the $WRKDIR.  Delegate creates files relative to DGROOT (which defaults to $HOME AFAIR) when being run, and it runs itself during the build.  Now, it doesn't do any real harm and probably goes unnoticed when the port is built normally, but breaks automated build robots such as tinderbox [1], for example.

Explicitly setting DGROOT to ${WRKDIR} (that's basically what my patching with sed(1) does) allows it to package successfully.  It does not affect the build in any other way (hopefully).

[1] http://tinderbox.marcuscom.com/
Comment 8 Danilo Egea Gondolfo freebsd_committer freebsd_triage 2014-07-23 10:50:19 UTC
Fixed. Thanks!