Bug 202603 - [PATCH] net-p2p/namecoin: fix build with _FORTIFY_SOURCE
Summary: [PATCH] net-p2p/namecoin: fix build with _FORTIFY_SOURCE
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Kurt Jaeger
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-08-24 00:05 UTC by Oliver Pinter
Modified: 2015-09-02 05:24 UTC (History)
3 users (show)

See Also:
milios: maintainer-feedback+


Attachments
net-p2p-namecoin.diff (1.37 KB, patch)
2015-08-24 00:05 UTC, Oliver Pinter
no flags Details | Diff
Cleaner fix (1.10 KB, patch)
2015-08-24 00:45 UTC, Pedro F. Giffuni
no flags Details | Diff
fix with support for old FreeBSD versions. (1.14 KB, patch)
2015-08-24 01:15 UTC, Pedro F. Giffuni
no flags Details | Diff
svn diff to 0.3.80_1,1 (1.51 KB, patch)
2015-08-28 01:24 UTC, Chad Jacob Milios
milios: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Pinter freebsd_committer freebsd_triage 2015-08-24 00:05:40 UTC
Created attachment 160267 [details]
net-p2p-namecoin.diff
Comment 1 Pedro F. Giffuni freebsd_committer freebsd_triage 2015-08-24 00:45:27 UTC
Created attachment 160276 [details]
Cleaner fix

This should be cleaner:

On FreeBSD strlcat and strcpy exist so you should be using the native libc versions instead of redefining your own.

FORTIFY_SOURCE depends on using the system headers so this change fixes that case too.
Comment 2 Pedro F. Giffuni freebsd_committer freebsd_triage 2015-08-24 01:15:55 UTC
Created attachment 160277 [details]
fix with support for old FreeBSD versions.

We probably shouldn't care about EOL'd versions but for correctness we can consider the version check for strlcat/strcpy.
Comment 3 Chad Jacob Milios 2015-08-24 01:44:47 UTC
Thanks guys! I will review and confirm within the next two days.
Comment 4 Chad Jacob Milios 2015-08-28 01:24:01 UTC
Created attachment 160427 [details]
svn diff to 0.3.80_1,1

Thanks guys! Patch looks and runs great. Included latest one as-is here, plus bumped PORTREVISION in the Makefile.

# svn status
M       Makefile
A       files/patch-src__strlcpy.h
Comment 5 Kurt Jaeger freebsd_committer freebsd_triage 2015-09-02 05:22:03 UTC
build-tested on cur-amd64, 10.2a, 10.2i, 9.3a.
Comment 6 commit-hook freebsd_committer freebsd_triage 2015-09-02 05:24:26 UTC
A commit references this bug:

Author: pi
Date: Wed Sep  2 05:23:36 UTC 2015
New revision: 395821
URL: https://svnweb.freebsd.org/changeset/ports/395821

Log:
  net-p2p/namecoin: fix for upcoming FORTIFY_SOURCE

  On FreeBSD strlcat and strcpy exist so you should be using the
  native libc versions instead of redefining your own.

  FORTIFY_SOURCE depends on using the system headers so this change
  fixes that case too.

  PR:		202603
  Submitted by:	pfg, op
  Approved by:	milios@ccsys.com (maintainer)

Changes:
  head/net-p2p/namecoin/Makefile
  head/net-p2p/namecoin/files/patch-src__strlcpy.h
Comment 7 Kurt Jaeger freebsd_committer freebsd_triage 2015-09-02 05:24:51 UTC
Committed, thanks.