[DragonFlyBSD - Bug #1130] (Closed) `cp -Rp symlink-with-nohistory' fails...

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Wed Jan 14 16:48:19 PST 2015

Issue #1130 has been updated by tuxillo.

Description updated
Status changed from New to Closed
Target version set to 4.2.x


Issue is resolved but patches are welcome for the proposed changes :-)

Antonio Huete

Bug #1130: `cp -Rp symlink-with-nohistory' fails...

* Author: qhwt+dfly
* Status: Closed
* Priority: Normal
* Assignee: qhwt+dfly
* Category: 
* Target version: 4.2.x

How it fails:
$ mkdir test test2
$ chflags nohistory test
$ chflags history test2		# to make sure test2 doesn't have nohistory
$ ln -s foo test/bar		# this creates a symlink with nohistory set
$ cp -Rp test/bar test2
cp: chflags: test2/bar: Function not implemented

Why does that matter:
installation of postfix fails (I know makedefs barfs first, but that's
another story, and perhaps someone else's working on it).  I have my
${WRKDIR} on a HAMMER PFS with nohistory flag set.  On the other hand
${PREFIX} (=/usr/pkg) has no nohistory set on it.  And ${WRKDIR} and
${PREFIX} are on different partitions.  I don't think this is very odd
configuration, as you want your ${WRKDIR} on a big partition but don't
want to retain the history, while you want to keep your ${PREFIX} on
a UFS filesystem to be very conservative, or at least retain history.

There's the following code in postfix-install script, which is responsible
for the installation:

compare_or_symlink() {

	ln -s $link $tempdir/junk || exit 1
	mv -f $tempdir/junk $2 || {

$tempdir points to somewhere under ${WRKDIR}, so it has nohistory flag set,
so symlinks get created with nohistory flag set, then mv'ed to
${PREFIX}/*bin.  Since ${WRKDIR} and ${PREFIX}/*bin are in different
partitions, mv internally invokes `cp -PRp' to perform the copy
across partitions, then fails.
Currently there are three workarounds for this problem(known to me):
A) run `bmake install' twice, B) set nohistory flag on ${PREFIX}/*, or
C) patch cp to special case the history flags rather than let it
   unconditionally refuse to chflags() on a symlink.

But: why does cp refuse to set file flags on a symlink in the first place?

You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account

More information about the Bugs mailing list