DragonFly bugs List (threaded) for 2008-09
DragonFly BSD
DragonFly bugs List (threaded) for 2008-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: `cp -Rp symlink-with-nohistory' fails...

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 3 Sep 2008 08:40:11 -0700 (PDT)

:	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?

    It isn't possible to set the flags on a symlink. There is no 
    lchflags() system call.  I think it would be fairly easy to add
    a lchflags() though any use of such a call would not be backwards
    compatible to older systems.

    A normal chflags() call on a symlink would try to dive the link, just
    like chmod() and chown() do.

    This brings up another issue with regards to 'nohistory', that being
    the problem of programs such as cp and mv trying to copy the flag
    and resulting in files being marked nohistory that you might not
    otherwise want marked nohistory.  It could very well be that the only
    solution is to add a PFS-wide nohistory flag and not use chflags for
    that purpose.

					Matthew Dillon 

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]