ports/96252: [patch] sysutils/cpdup can not handle snapshot files
Dmitry Morozovsky
marck at FreeBSD.org
Mon Apr 24 09:50:17 UTC 2006
>Number: 96252
>Category: ports
>Synopsis: [patch] sysutils/cpdup can not handle snapshot files
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Apr 24 09:50:15 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Dmitry Morozovsky
>Release: FreeBSD 6-STABLE i386
>Organization:
Cronyx Plus LLC (RiNet ISP)
>Environment:
System: FreeBSD 6-STABLE
>Description:
sysutils/cpdup, while being great utility for file systems copy, can not
properly handle files with holes, hence is never able to copy snapshot files
(wee, on a comparable file systems).
The following patch sould fix this by simply skipping inodes with snapshot flag
set.
>How-To-Repeat:
>Fix:
#/bin/sh
echo c - files
mkdir -p files > /dev/null 2>&1
echo x - files/patch-cpdup.c
sed 's/^X//' >files/patch-cpdup.c << 'END-of-files/patch-cpdup.c'
X
X$FreeBSD$
X
X--- cpdup.c.orig
X+++ cpdup.c
X@@ -321,6 +321,11 @@
X
X if (lstat(spath, &st1) != 0)
X return(0);
X+#ifdef SF_SNAPSHOT
X+ /* skip snapshot files: we cannot handle files larger than file system */
X+ if (st1.st_flags & SF_SNAPSHOT)
X+ return(0);
X+#endif
X st2.st_mode = 0; /* in case lstat fails */
X st2.st_flags = 0; /* in case lstat fails */
X if (dpath && lstat(dpath, &st2) == 0)
END-of-files/patch-cpdup.c
patch << 'END-of-Makefile-Patch'
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/sysutils/cpdup/Makefile,v
retrieving revision 1.11
diff -u -u -r1.11 Makefile
--- Makefile 11 Dec 2004 17:49:48 -0000 1.11
+++ Makefile 24 Apr 2006 09:26:34 -0000
@@ -7,6 +7,7 @@
PORTNAME= cpdup
PORTVERSION= 1.05
+PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://apollo.backplane.com/FreeBSDPorts/
#MASTER_SITE_SUBDIR= cp
END-of-Makefile-Patch
exit
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list