Hello,

I submitted this bug report before, on 23-April-2001.  Since then, I have
verified that it continues to persist in cdrtools-1.11a01 and
cdrtools-1.11a02.  As well, I have created a test script which
demonstrates the problem (on Linux) with a slightly smaller test example.

I include

    1. the diffs for cdrtools-1.11a02
    2. the test script
    3. a "before" and an "after" log of the running of the script to
       demonstrate the efficacy of the patch
    4. The original mail message.

Thanks,

/ken

-------------------------------------------------------------------------
                                  diffs

--- mkisofs/mkisofs.c-old       Wed Jun  6 14:40:55 2001
+++ mkisofs/mkisofs.c   Wed Jun  6 14:42:02 2001
@@ -2545,7 +2545,15 @@
                 * Now see whether the user wants to add a regular file, or a
                 * directory at this point.
                 */
-               status = stat_filter(node, &st);
+
+               status = lstat_filter(node, &st);
+
+               if (status == 0
+                   && S_ISLNK(statbuf.st_mode)
+                   && follow_links) {
+                 status = stat_filter(node, &st);
+               }
+
                if (status != 0) {
                        /*
                         * This is a fatal error - the user won't be getting


-------------------------------------------------------------------------
                                 script

#! /bin/bash
#  Note that the "sudo" stuff is in order to be able to do the mount.
#  You can of course remove "sudo ", and run as root.

set -x

pwd=$PWD
testdir=/var/tmp/MkisofsTest
mkisofs=${mkisofs:-/opt/schily/bin/mkisofs}

rm -rf ${testdir}
mkdir -p ${testdir}
cd ${testdir}

mkdir -p dir1/dir2
echo foo > dir1/dir2/file1
ln -s dir1 sym1

ls -lR ${testdir}

${mkisofs} -v -v -R -d -D -o /other/tmp.iso \
             -graft-points \
             ${testdir}/sym1=${testdir}/sym1 ${testdir}/dir1/=${testdir}/dir1/

sudo mount /other/tmp.iso /mnt -o loop
ls -lR /mnt
sudo umount /mnt

-------------------------------------------------------------------------
                              "before" run

cd /home/kend/mkisotests.d/
/home/kend/mkisotests.d/test3.bash
+ pwd=/home/kend/mkisotests.d
+ testdir=/var/tmp/MkisofsTest
+ mkisofs=/opt/schily/bin/mkisofs
+ rm -rf /var/tmp/MkisofsTest
+ mkdir -p /var/tmp/MkisofsTest
+ cd /var/tmp/MkisofsTest
+ mkdir -p dir1/dir2
+ echo foo
+ ln -s dir1 sym1
+ ls -lR /var/tmp/MkisofsTest
/var/tmp/MkisofsTest:
total 4
drwxrwxr-x   3 kend     staff        4096 Jun  6 16:11 dir1
lrwxrwxrwx   1 kend     staff           4 Jun  6 16:11 sym1 -> dir1

/var/tmp/MkisofsTest/dir1:
total 4
drwxrwxr-x   2 kend     staff        4096 Jun  6 16:11 dir2

/var/tmp/MkisofsTest/dir1/dir2:
total 4
-rw-rw-r--   1 kend     staff           4 Jun  6 16:11 file1
+ /opt/schily/bin/mkisofs -v -v -R -d -D -o /other/tmp.iso -graft-points 
+/var/tmp/MkisofsTest/sym1=/var/tmp/MkisofsTest/sym1 
+/var/tmp/MkisofsTest/dir1/=/var/tmp/MkisofsTest/dir1/
Warning: creating filesystem that does not conform to ISO-9660.
mkisofs 1.14 (i686-pc-linux-gnu)
Scanning /var/tmp/MkisofsTest/sym1
Scanning /var/tmp/MkisofsTest/sym1/dir2
Scanning /var/tmp/MkisofsTest/dir1/
/opt/schily/bin/mkisofs: Warning: Directory loop (/var/tmp/MkisofsTest/dir1/dir2 dev: 
302 ino: 560784).
Scanning /var/tmp/MkisofsTest/dir1/dir2
  23   350 
  24   316 var
  25   330 tmp
  26   432 MkisofsTest
  27   322 dir2
  28   318 dir1
  29   322 dir2
Cache hit for /..
Cache hit for dir2/.
31 31 /var/tmp/MkisofsTest/sym1/dir2/file1
Cache hit for dir1/dir2
Cache hit for dir2/.
Cache hit for dir2/..
Cache hit for dir2/file1
Total extents scheduled to be written = 48
Total translation table size: 0
Total rockridge attributes bytes: 1588
Total directory bytes: 10240
Path table size(bytes): 86
Max brk space used 69c4
48 extents written (0 Mb)
+ sudo mount /other/tmp.iso /mnt -o loop
+ ls -lR /mnt
/mnt:
total 2
dr-xr-xr-x   3 kend     staff        2048 Jun  6 16:11 var

/mnt/var:
total 2
dr-xr-xr-x   3 kend     staff        2048 Jun  6 16:11 tmp

/mnt/var/tmp:
total 2
dr-xr-xr-x   4 kend     staff        2048 Jun  6 16:11 MkisofsTest

/mnt/var/tmp/MkisofsTest:
total 4
dr-xr-xr-x   3 kend     staff        2048 Jun  6 16:11 dir1
drwxrwxr-x   2 kend     staff        2048 Jun  6 16:11 dir2

/mnt/var/tmp/MkisofsTest/dir1:
total 2
drwxrwxr-x   2 kend     staff        2048 Jun  6 16:11 dir2

/mnt/var/tmp/MkisofsTest/dir1/dir2:
total 1
-rw-rw-r--   1 kend     staff           4 Jun  6 16:11 file1

/mnt/var/tmp/MkisofsTest/dir2:
total 1
-rw-rw-r--   1 kend     staff           4 Jun  6 16:11 file1
+ sudo umount /mnt

Interpretation finished at Wed Jun  6 16:11:40

-------------------------------------------------------------------------
                               "after" run

cd /home/kend/mkisotests.d/
mkisofs=/usr/testsw/cdrtools-1.11/mkisofs/OBJ/i686-linux-cc/mkisofs 
/home/kend/mkisotests.d/test3.bash
+ pwd=/home/kend/mkisotests.d
+ testdir=/var/tmp/MkisofsTest
+ mkisofs=/usr/testsw/cdrtools-1.11/mkisofs/OBJ/i686-linux-cc/mkisofs
+ rm -rf /var/tmp/MkisofsTest
+ mkdir -p /var/tmp/MkisofsTest
+ cd /var/tmp/MkisofsTest
+ mkdir -p dir1/dir2
+ echo foo
+ ln -s dir1 sym1
+ ls -lR /var/tmp/MkisofsTest
/var/tmp/MkisofsTest:
total 4
drwxrwxr-x   3 kend     staff        4096 Jun  6 16:18 dir1
lrwxrwxrwx   1 kend     staff           4 Jun  6 16:18 sym1 -> dir1

/var/tmp/MkisofsTest/dir1:
total 4
drwxrwxr-x   2 kend     staff        4096 Jun  6 16:18 dir2

/var/tmp/MkisofsTest/dir1/dir2:
total 4
-rw-rw-r--   1 kend     staff           4 Jun  6 16:18 file1
+ /usr/testsw/cdrtools-1.11/mkisofs/OBJ/i686-linux-cc/mkisofs -v -v -R -d -D -o 
+/other/tmp.iso -graft-points /var/tmp/MkisofsTest/sym1=/var/tmp/MkisofsTest/sym1 
+/var/tmp/MkisofsTest/dir1/=/var/tmp/MkisofsTest/dir1/
Warning: creating filesystem that does not conform to ISO-9660.
mkisofs 1.14 (i686-pc-linux-gnu)
Scanning /var/tmp/MkisofsTest/dir1/
Scanning /var/tmp/MkisofsTest/dir1/dir2
  23   350 
  24   316 var
  25   330 tmp
  26   446 MkisofsTest
  27   318 dir1
  28   322 dir2
Cache hit for /..
Cache hit for dir2/.
30 30 /var/tmp/MkisofsTest/dir1/dir2/file1
Total extents scheduled to be written = 48
Total translation table size: 0
Total rockridge attributes bytes: 1388
Total directory bytes: 10240
Path table size(bytes): 74
Max brk space used 6000
48 extents written (0 Mb)
+ sudo mount /other/tmp.iso /mnt -o loop
+ ls -lR /mnt
/mnt:
total 2
dr-xr-xr-x   3 kend     staff        2048 Jun  6 16:18 var

/mnt/var:
total 2
dr-xr-xr-x   3 kend     staff        2048 Jun  6 16:18 tmp

/mnt/var/tmp:
total 2
dr-xr-xr-x   3 kend     staff        2048 Jun  6 16:18 MkisofsTest

/mnt/var/tmp/MkisofsTest:
total 3
dr-xr-xr-x   3 kend     staff        2048 Jun  6 16:18 dir1
lrwxrwxrwx   1 kend     staff           4 Jun  6 16:18 sym1 -> dir1

/mnt/var/tmp/MkisofsTest/dir1:
total 2
drwxrwxr-x   2 kend     staff        2048 Jun  6 16:18 dir2

/mnt/var/tmp/MkisofsTest/dir1/dir2:
total 1
-rw-rw-r--   1 kend     staff           4 Jun  6 16:18 file1
+ sudo umount /mnt

Interpretation finished at Wed Jun  6 16:18:46

-------------------------------------------------------------------------
                            The first message

To: [EMAIL PROTECTED]
Subject: mkisofs 1.13 bug with -graft-points and symlinks
Date: Mon, 23 Apr 2001 12:00:43 -0700 (PDT)
From: [EMAIL PROTECTED] (ken dawson chia wu)
Content-Length: 1889

Hello,

I believe that I am encountering a misbehavior in mkisofs when
-graft-points is used in conjunction with symbolic links in the path
list.

I am attempting to backup a Slackware installation, and in that
distribution, they have the following:

    /usr:
    lrwxrwxrwx   1 root     root            5 Jul 18  2000 X11 -> X11R6/
    drwxr-xr-x  12 root     root         4096 Oct 23  2000 X11R6/

I try to execute the command:

    mkisofs -o test.iso -R -graft-points /usr/X11=/usr/X11 /usr/X11R6/=/usr/X11R6/

with mkisofs version 1.13 (which I got from the cdrecord-1.9 bundle),

I get the following response and no output

    mkisofs: Warning: Directory loop (/usr/X11R6/lib dev: 302 ino: 130951).

Using -v, I see that it is chasing the /usr/X11 symlink, even though -f
is not specified.  I examined the code and have prepared the following
patch, which makes my test case work properly.  I am not sure of the
impact on other modes of operation, though it does appear to work
properly when the corresponding -f form is used:

    mkisofs -f -o test.iso -R -graft-points /usr/X11/=/usr/X11/ /usr/X11R6/=/usr/X11R6/

I hope you have some test suites that could further explore the impact of
this change.  I look forward to a fix to this problem being in a future
version of mkisofs.

Thanks,

/ken dawson

-------------------------------------------------------------------------


--  
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to