The underlying problem appears to be an earlier bug in genisoimage or
its cdrtools predecessor (I didn't track it down), such that .. entries
get created without the ISO_DIRECTORY flag attached. This torpedoes
image merging with such images specified in -M because we end up with
two .. entries in the directory, one a directory, one a file.
This bug no longer appears to be present --- images created by this
version of genisoimage can have multisessions created atop them without
trouble --- but because multisession images created by the buggy
versions may be used as -M sources, we still need to work around it.
Evidence on my system suggests that this may have been a bug in Debian
cdrkit 1.1.6 and perhaps 1.1.7: the bug may have been present in other
versions, though: I don't make multisession data images often. (I
haven't verified that this is the case: the bug may be present somewhere
else, or may still be present but only active in certain circumstances.)
This somewhat kludgy workaround simply unconditionally treats '..' as a
directory. (I suspect that ISO-9660 images that have files named '..'
can't be usefully mounted on Linux systems in any case, because there's
no way to access those files at all.)
This works for me and lets me do an incremental backup from a buggy
image, but I don't know the ISO-9660 standard at all so it may cause
other interoperability problems for all I know: I do not claim this is
other than a kludge. Review solicited from someone who actually knows
the standard: I'm aware that `works for me' isn't ideal, but I needed to
get my backups done, so someone else seeing this problem might as well
benefit :)
Index: genisoimage/multi.c
===================================================================
--- genisoimage/multi.c (revision 815)
+++ genisoimage/multi.c (working copy)
@@ -1217,6 +1217,19 @@
}
/*
+ * If this entry is named "." or ".." but doesn't have the directory flag
+ * (or any other flag) on, it was written by an old (buggy) version of
+ * genisoimage. Linux doesn't care about the value of this flag: we should
+ * act as if it has ISO_DIRECTORY set.
+ */
+
+ if (((pnt[i]->isorec.flags[0]) == 0) &&
+ ((strcmp(pnt[i]->name, ".") == 0) ||
+ (strcmp(pnt[i]->name, "..") == 0))) {
+ pnt[i]->isorec.flags[0] = ISO_DIRECTORY;
+ }
+
+ /*
* Skip directories for now - these need to be treated
* differently.
*/