summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-05-12 05:05:19 +0000
committerMike Frysinger <vapier@gentoo.org>2015-05-12 05:05:19 +0000
commit8324bca77259974938e7c7159749ab4fdfb2b0c6 (patch)
tree0c3692f2cd4dff22178f9e6411abb6c32cfc78db /sys-fs/udftools
parentPull in stdlib.h for system prototype. (diff)
downloadgentoo-2-8324bca77259974938e7c7159749ab4fdfb2b0c6.tar.gz
gentoo-2-8324bca77259974938e7c7159749ab4fdfb2b0c6.tar.bz2
gentoo-2-8324bca77259974938e7c7159749ab4fdfb2b0c6.zip
Update to latest EAPI and import a bunch of Fedora patches.
(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
Diffstat (limited to 'sys-fs/udftools')
-rw-r--r--sys-fs/udftools/ChangeLog14
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch44
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch57
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch115
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch164
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch94
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch160
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch52
-rw-r--r--sys-fs/udftools/udftools-1.0.0b-r10.ebuild49
9 files changed, 748 insertions, 1 deletions
diff --git a/sys-fs/udftools/ChangeLog b/sys-fs/udftools/ChangeLog
index ae749559d871..e24b56a29e64 100644
--- a/sys-fs/udftools/ChangeLog
+++ b/sys-fs/udftools/ChangeLog
@@ -1,6 +1,18 @@
# ChangeLog for sys-fs/udftools
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/udftools/ChangeLog,v 1.34 2015/05/12 05:02:08 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/udftools/ChangeLog,v 1.35 2015/05/12 05:05:19 vapier Exp $
+
+*udftools-1.0.0b-r10 (12 May 2015)
+
+ 12 May 2015; Mike Frysinger <vapier@gentoo.org>
+ +files/udftools-1.0.0b3-extsize.patch,
+ +files/udftools-1.0.0b3-man-missing-options.patch,
+ +files/udftools-1.0.0b3-mkudffs-bigendian.patch,
+ +files/udftools-1.0.0b3-staticanal.patch,
+ +files/udftools-1.0.0b3-warningfixes.patch,
+ +files/udftools-1.0.0b3-warningfixes2.patch,
+ +files/udftools-1.0.0b3-wrudf_help.patch, +udftools-1.0.0b-r10.ebuild:
+ Update to latest EAPI and import a bunch of Fedora patches.
12 May 2015; Mike Frysinger <vapier@gentoo.org>
files/udftools-1.0.0b-limits_h.patch:
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch b/sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch
new file mode 100644
index 000000000000..8e7e0d13a7f2
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch
@@ -0,0 +1,44 @@
+taken from Fedora, but with minor return type fixes: changed NULL to 0
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-extsize.patch?h=f22
+
+diff -up udftools-1.0.0b3/libudffs/extent.c.extsize udftools-1.0.0b3/libudffs/extent.c
+--- udftools-1.0.0b3/libudffs/extent.c.extsize 2012-01-26 09:45:22.217856499 +0100
++++ udftools-1.0.0b3/libudffs/extent.c 2012-01-26 09:45:43.142855067 +0100
+@@ -50,7 +50,7 @@ cont:
+ while (start_ext != NULL && start_ext->blocks < blocks)
+ start_ext = next_extent(start_ext->next, type);
+
+- if (start_ext->start % offset)
++ if (start_ext != NULL && start_ext->start % offset)
+ {
+ inc = offset - (start_ext->start % offset);
+ if (start_ext->blocks - inc < blocks)
+@@ -62,7 +62,7 @@ cont:
+ else
+ inc = 0;
+
+- return start_ext->start + inc;
++ return start_ext ? start_ext->start + inc : 0;
+ }
+
+ struct udf_extent *prev_extent(struct udf_extent *start_ext, enum udf_space_type type)
+@@ -81,7 +81,7 @@ cont:
+ while (start_ext != NULL && start_ext->blocks < blocks)
+ start_ext = prev_extent(start_ext->prev, type);
+
+- if ((start_ext->start + start_ext->blocks) % offset)
++ if (start_ext != NULL && (start_ext->start + start_ext->blocks) % offset)
+ {
+ dec = (start_ext->start + start_ext->blocks) % offset;
+ if (start_ext->blocks - dec < blocks)
+@@ -93,7 +93,7 @@ cont:
+ else
+ dec = 0;
+
+- return start_ext->start + start_ext->blocks - dec - blocks;
++ return start_ext ? start_ext->start + start_ext->blocks - dec - blocks : 0;
+ }
+
+ struct udf_extent *find_extent(struct udf_disc *disc, uint32_t start)
+
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch b/sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch
new file mode 100644
index 000000000000..afda3bd00d3a
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch
@@ -0,0 +1,57 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-man-missing-options.patch?h=f22
+
+diff -up wrk/doc/cdrwtool.1.wrk wrk/doc/cdrwtool.1
+--- wrk/doc/cdrwtool.1.wrk 2014-01-29 15:23:18.623940293 +0100
++++ wrk/doc/cdrwtool.1 2014-01-29 15:24:27.027471222 +0100
+@@ -97,6 +97,10 @@ Close track.
+ .IP "\fB\-r \fItrack\fP"
+ Reserve track.
+
++.IP "\fB\-z \fIlength\fP"
++Fixed packet length.
++
++
+ .IP \fB\-s\fP
+ Set write parameters determined by
+ .BR "\-l" , " \-w" ", and" " \-p"
+diff -up wrk/doc/mkudffs.8.wrk wrk/doc/mkudffs.8
+--- wrk/doc/mkudffs.8.wrk 2014-01-29 15:47:54.095408327 +0100
++++ wrk/doc/mkudffs.8 2014-01-29 15:51:18.115200882 +0100
+@@ -151,6 +151,13 @@ Use 16-bit unicode for file names
+ .TP
+ .B \-\-utf8
+ Use UTF-8 for file names
++.TP
++.B \-\-closed
++.TP
++.B \-\-bridge
++.TP
++.BI \-\-packetlen= " length "
++
+
+ .SH "EXIT STATUS"
+ .B mkudffs
+diff -up wrk/doc/pktsetup.8.wrk wrk/doc/pktsetup.8
+--- wrk/doc/pktsetup.8.wrk 2002-11-26 08:18:51.000000000 +0100
++++ wrk/doc/pktsetup.8 2014-01-29 15:36:29.509665177 +0100
+@@ -37,6 +37,9 @@ pktsetup \- set up and tear down packet
+ .B pktsetup
+ .B \-d
+ .I packet_device
++.br
++.B pktsetup
++.B \-s
+ .ad b
+ .SH DESCRIPTION
+ .B Pktsetup
+@@ -58,6 +61,8 @@ returns 0 on success, nonzero on failure
+ .IP "\fB\-d \fIpacket-device\fP"
+ Delete the association between the specified \fIpacket-device\fP
+ and its block device.
++.IP "\fB\-s"
++Show device mappings.
+
+ .SH EXAMPLE
+ The following commands provide an example of using the
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch b/sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch
new file mode 100644
index 000000000000..68c637cd89f4
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch
@@ -0,0 +1,115 @@
+taken from Fedora, but parts removed due to conflicts w/udftools-1.0.0b-bigendian.patch
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-mkudffs-bigendian.patch?h=f22
+
+diff -up udftools-1.0.0b3/mkudffs/defaults.c.mkudffs-bigendian udftools-1.0.0b3/mkudffs/defaults.c
+--- udftools-1.0.0b3/mkudffs/defaults.c.mkudffs-bigendian 2007-08-23 13:41:29.000000000 +0200
++++ udftools-1.0.0b3/mkudffs/defaults.c 2007-08-23 13:42:16.000000000 +0200
+@@ -69,7 +69,7 @@ struct primaryVolDesc default_pvd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_PVD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct primaryVolDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(1),
+@@ -119,7 +119,7 @@ struct logicalVolDesc default_lvd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct logicalVolDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(2),
+@@ -157,7 +157,7 @@ struct volDescPtr default_vdp =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_VDP),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct volDescPtr) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(3),
+@@ -192,7 +192,7 @@ struct impUseVolDesc default_iuvd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_IUVD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct impUseVolDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(4),
+@@ -215,7 +215,7 @@ struct partitionDesc default_pd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_PD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct partitionDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(5),
+@@ -242,7 +242,7 @@ struct unallocSpaceDesc default_usd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_USD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct unallocSpaceDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(6),
+@@ -254,7 +254,7 @@ struct terminatingDesc default_td =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_TD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct terminatingDesc) - sizeof(tag)),
+ },
+ };
+@@ -265,7 +265,7 @@ struct logicalVolIntegrityDesc default_l
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVID),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct logicalVolIntegrityDesc) - sizeof(tag)),
+ },
+ integrityType : constant_cpu_to_le32(LVID_INTEGRITY_TYPE_CLOSE),
+@@ -295,7 +295,7 @@ struct sparingTable default_stable =
+ {
+ tagIdent : constant_cpu_to_le16(0),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct sparingTable) - sizeof(tag)),
+ },
+ sparingIdent :
+@@ -387,7 +387,7 @@ struct fileSetDesc default_fsd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_FSD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct fileSetDesc) - sizeof(tag)),
+ },
+ interchangeLvl : constant_cpu_to_le16(2),
+@@ -426,7 +426,7 @@ struct fileEntry default_fe =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVID),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct primaryVolDesc) - sizeof(tag)),
+ },
+ icbTag :
+@@ -458,7 +458,7 @@ struct extendedFileEntry default_efe =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVID),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct primaryVolDesc) - sizeof(tag)),
+ },
+ icbTag :
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch b/sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch
new file mode 100644
index 000000000000..9ff411b24528
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch
@@ -0,0 +1,164 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-staticanal.patch?h=f22
+
+Error: CONSTANT_EXPRESSION_RESULT:
+/builddir/build/BUILD/udftools-1.0.0b3/cdrwtool/cdrwtool.c:626: result_independent_of_operands: (ret == ioctl(fd, 21289, 1)) < 0 is always false regardless of the values of its operands. This occurs as the logical operand of if.
+
+Possible buffer overflow of static allocated variable "device".
+
+diff -up udftools-1.0.0b3/cdrwtool/cdrwtool.c.staticanal udftools-1.0.0b3/cdrwtool/cdrwtool.c
+--- udftools-1.0.0b3/cdrwtool/cdrwtool.c.staticanal 2012-01-26 16:20:44.518234366 +0100
++++ udftools-1.0.0b3/cdrwtool/cdrwtool.c 2012-01-26 16:20:44.537234366 +0100
+@@ -623,7 +623,7 @@ int cdrom_open_check(int fd)
+ if ((ret = ioctl(fd, CDROM_CLEAR_OPTIONS, CDO_LOCK)) < 0)
+ return ret;
+
+- if ((ret == ioctl(fd, CDROM_LOCKDOOR, 1)) < 0) {
++ if ((ret = ioctl(fd, CDROM_LOCKDOOR, 1)) < 0) {
+ fprintf(stderr, "CD-ROM appears to already be opened\n");
+ return 1;
+ }
+diff -up udftools-1.0.0b3/cdrwtool/options.c.staticanal udftools-1.0.0b3/cdrwtool/options.c
+--- udftools-1.0.0b3/cdrwtool/options.c.staticanal 2012-01-26 16:26:11.288212023 +0100
++++ udftools-1.0.0b3/cdrwtool/options.c 2012-01-26 16:27:24.125207040 +0100
+@@ -135,7 +135,8 @@ void parse_args(int argc, char *argv[],
+ }
+ case 'd':
+ {
+- strcpy(device, optarg);
++ strncpy(device, optarg, NAME_MAX-1);
++ device[NAME_MAX-1] = '\0';
+ printf("using device %s\n", device);
+ break;
+ }
+
+
+==========================================================================
+Error: NEGATIVE_RETURNS:
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:161: negative_return_fn: Function "open64(filename, 66, 432)" returns a negative number.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:161: var_assign: Assigning: signed variable "fd" = "open64".
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:165: negative_returns: "fd" is passed to a parameter that cannot be negative.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:85: neg_sink_parm_call: Passing "fd" to "valid_offset", which cannot accept a negative.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:55: neg_sink_parm_call: Passing "fd" to "udf_lseek64", which cannot accept a negative.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:43: neg_sink_parm_call: Passing "fd" to "lseek64", which cannot accept a negative.
+
+diff -up udftools-1.0.0b3/mkudffs/main.c.staticanal udftools-1.0.0b3/mkudffs/main.c
+--- udftools-1.0.0b3/mkudffs/main.c.staticanal 2004-02-23 04:33:11.000000000 +0100
++++ udftools-1.0.0b3/mkudffs/main.c 2012-01-26 16:29:17.605199282 +0100
+@@ -162,6 +162,10 @@ int main(int argc, char *argv[])
+ #else
+ fd = open(filename, O_RDWR | O_CREAT | O_LARGEFILE, 0660);
+ #endif
++ if (fd == NULL) {
++ fprintf(stderr, "mkudffs: cannot open '%s' for writing\n", filename);
++ exit(1);
++ }
+ disc.head->blocks = get_blocks(fd, disc.blocksize, disc.head->blocks);
+ disc.write = write_func;
+ disc.write_data = &fd;
+
+
+==========================================================================
+Error: BAD_SIZEOF:
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/mkudffs.c:45: bad_sizeof: Taking the size of pointer parameter "disc" is suspicious.
+
+Possible buffer overflow of static allocated variable "device".
+
+diff -up udftools-1.0.0b3/mkudffs/mkudffs.c.staticanal udftools-1.0.0b3/mkudffs/mkudffs.c
+--- udftools-1.0.0b3/mkudffs/mkudffs.c.staticanal 2012-01-26 16:20:44.526234367 +0100
++++ udftools-1.0.0b3/mkudffs/mkudffs.c 2012-01-26 16:20:44.539234366 +0100
+@@ -42,7 +42,7 @@ void udf_init_disc(struct udf_disc *disc
+ struct tm *tm;
+ int altzone;
+
+- memset(disc, 0x00, sizeof(disc));
++ memset(disc, 0x00, sizeof(*disc));
+
+ disc->blocksize = 2048;
+ disc->blocksize_bits = 11;
+diff -up udftools-1.0.0b3/mkudffs/options.c.staticanal udftools-1.0.0b3/mkudffs/options.c
+--- udftools-1.0.0b3/mkudffs/options.c.staticanal 2012-01-26 16:24:14.082220036 +0100
++++ udftools-1.0.0b3/mkudffs/options.c 2012-01-26 16:27:29.086206703 +0100
+@@ -320,7 +320,8 @@ void parse_args(int argc, char *argv[],
+ }
+ if (optind == argc)
+ usage();
+- strcpy(device, argv[optind]);
++ strncpy(device, argv[optind], NAME_MAX-1);
++ device[NAME_MAX-1] = '\0';
+ optind ++;
+ if (optind < argc)
+ disc->head->blocks = strtoul(argv[optind++], NULL, 0);
+
+
+==========================================================================
+Error: OVERRUN_STATIC:
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:378: overrun-local: Overrunning static array "spm->locSparingTable", with 4 elements, at position 4 with index variable "i".
+
+Error: NEGATIVE_RETURNS:
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:769: negative_return_fn: Function "open(filename, 2)" returns a negative number.
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:769: var_assign: Assigning: signed variable "device" = "open".
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:773: negative_returns: "device" is passed to a parameter that cannot be negative.
+
+diff -up udftools-1.0.0b3/wrudf/wrudf-cdrw.c.staticanal udftools-1.0.0b3/wrudf/wrudf-cdrw.c
+--- udftools-1.0.0b3/wrudf/wrudf-cdrw.c.staticanal 2012-01-26 16:20:44.529234367 +0100
++++ udftools-1.0.0b3/wrudf/wrudf-cdrw.c 2012-01-26 16:35:29.729173836 +0100
+@@ -374,7 +374,7 @@ void updateSparingTable() {
+ struct packetbuf *pb;
+ struct sparablePartitionMap *spm = (struct sparablePartitionMap*)lvd->partitionMaps;
+
+- for( i = 0; i <= 4; i++ ) {
++ for( i = 0; i < sizeof(spm->locSparingTable); i++ ) {
+ pbn = spm->locSparingTable[i];
+ if( pbn == 0 )
+ return;
+@@ -682,6 +682,8 @@ readExtents(char* dest, int usesShort, v
+ dest += 2048;
+ if( len < 2048 )
+ break;
++ /* dead code, len couldn't be 0 at this point
++ (break was called in this case) */
+ if( len == 0 ) {
+ if( usesShort ) {
+ sh++;
+@@ -766,8 +768,10 @@ initIO(char *filename)
+
+ if( S_ISREG(filestat.st_mode) ) { /* disk image of a UDF volume */
+ devicetype = DISK_IMAGE;
+- if( !(device = open(filename, O_RDWR)) )
++ if( !(device = open(filename, O_RDWR)) ) {
+ fail("initIO: open %s failed\n", filename);
++ return 0;
++ }
+
+ /* heuristically determine medium imitated on disk image based on VAT FileEntry in block 512 */
+ rv = lseek(device, 2048 * 512, SEEK_SET);
+
+==========================================================================
+Error: CONSTANT_EXPRESSION_RESULT:
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cmnd.c:699: missing_parentheses: !(*fid)->fileCharacteristics & 2 is always 0 regardless of the values of its operands. This occurs as the logical operand of if. Did you intend to apply '&' to (*fid)->fileCharacteristics and 2? If so, parentheses would be required to force this interpretation.
+
+diff -up udftools-1.0.0b3/wrudf/wrudf-cmnd.c.staticanal udftools-1.0.0b3/wrudf/wrudf-cmnd.c
+--- udftools-1.0.0b3/wrudf/wrudf-cmnd.c.staticanal 2012-01-26 16:20:44.530234366 +0100
++++ udftools-1.0.0b3/wrudf/wrudf-cmnd.c 2012-01-26 16:20:44.543234366 +0100
+@@ -696,7 +696,7 @@ analyzeDest(char* arg, struct fileIdentD
+ *fid = findFileIdentDesc(curDir, comp);
+ if( *fid == NULL )
+ return DIR_INVALID;
+- if( ! (*fid)->fileCharacteristics & FID_FILE_CHAR_DIRECTORY )
++ if( ! ((*fid)->fileCharacteristics & FID_FILE_CHAR_DIRECTORY ))
+ return DIR_INVALID;
+ if( (*fid)->fileCharacteristics & FID_FILE_CHAR_DELETED )
+ return DIR_INVALID;
+diff -up udftools-1.0.0b3/wrudf/wrudf.c.staticanal udftools-1.0.0b3/wrudf/wrudf.c
+--- udftools-1.0.0b3/wrudf/wrudf.c.staticanal 2012-01-26 16:20:44.528234367 +0100
++++ udftools-1.0.0b3/wrudf/wrudf.c 2012-01-26 16:20:44.545234365 +0100
+@@ -158,6 +158,7 @@ initialise(char *devicename)
+
+ if( (p = readTaggedBlock(blkno, ABSOLUTE)) == NULL ) {
+ if( !inMainSeq )
++ /* dead code - the condition "inMainSeq" cannot be false */
+ fail("Volume Descriptor Sequences read failure\n");
+ blkno = extentRsrvVolDescSeq.extLocation;
+ len = extentRsrvVolDescSeq.extLength;
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch
new file mode 100644
index 000000000000..5b530c6041e1
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch
@@ -0,0 +1,94 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-warningfixes.patch?h=f22
+
+diff -Naupr udftools-1.0.0b3.orig/cdrwtool/cdrwtool.h udftools-1.0.0b3/cdrwtool/cdrwtool.h
+--- udftools-1.0.0b3.orig/cdrwtool/cdrwtool.h 2002-11-26 08:18:50.000000000 +0100
++++ udftools-1.0.0b3/cdrwtool/cdrwtool.h 2006-07-27 14:16:06.000000000 +0200
+@@ -226,6 +226,7 @@ int read_disc_info(int, disc_info_t *);
+ int read_track_info(int, track_info_t *, int);
+ int reserve_track(int, struct cdrw_disc *);
+ int close_track(int, unsigned int);
++int close_session(int, unsigned int);
+ int read_buffer_cap(int, struct cdrw_disc *);
+ int set_cd_speed(int, int);
+ void cdrom_close(int);
+@@ -236,5 +237,6 @@ int print_disc_track_info(int);
+ void make_write_page(write_params_t *, struct cdrw_disc *);
+ void print_params(write_params_t *);
+ void cdrw_init_disc(struct cdrw_disc *);
++int udf_set_version(struct udf_disc *, int);
+
+ #endif /* _CDRWTOOL_H */
+diff -Naupr udftools-1.0.0b3.orig/include/udf_endian.h udftools-1.0.0b3/include/udf_endian.h
+--- udftools-1.0.0b3.orig/include/udf_endian.h 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/include/udf_endian.h 2006-07-27 14:09:30.000000000 +0200
+@@ -23,6 +23,8 @@
+ #ifndef __UDF_ENDIAN_H
+ #define __UDF_ENDIAN_H
+
++#include <string.h>
++
+ #include "bswap.h"
+
+ static inline lb_addr lelb_to_cpu(lb_addr in)
+diff -Naupr udftools-1.0.0b3.orig/libudffs/unicode.c udftools-1.0.0b3/libudffs/unicode.c
+--- udftools-1.0.0b3.orig/libudffs/unicode.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/libudffs/unicode.c 2006-07-27 14:11:17.000000000 +0200
+@@ -169,8 +169,6 @@ error_out:
+
+ int decode_string(struct udf_disc *disc, char *in, char *out, int inlen)
+ {
+- int i;
+-
+ if (disc->flags & FLAG_UTF8)
+ return decode_utf8(in, out, inlen);
+ else if (disc->flags & (FLAG_UNICODE8 | FLAG_UNICODE16))
+diff -Naupr udftools-1.0.0b3.orig/pktsetup/pktsetup.c udftools-1.0.0b3/pktsetup/pktsetup.c
+--- udftools-1.0.0b3.orig/pktsetup/pktsetup.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/pktsetup/pktsetup.c 2006-07-27 14:18:24.000000000 +0200
+@@ -23,6 +23,7 @@
+ #include <getopt.h>
+ #include <bits/types.h>
+ #include <sys/types.h>
++#include <string.h>
+
+ #include <linux/cdrom.h>
+
+diff -Naupr udftools-1.0.0b3.orig/wrudf/Makefile.am udftools-1.0.0b3/wrudf/Makefile.am
+--- udftools-1.0.0b3.orig/wrudf/Makefile.am 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/wrudf/Makefile.am 2006-07-27 14:21:24.000000000 +0200
+@@ -1,5 +1,5 @@
+ bin_PROGRAMS = wrudf
+ wrudf_LDADD = $(top_builddir)/libudffs/libudffs.la -lreadline -lncurses
+-wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h
++wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h ../include/libudffs.h
+
+ AM_CPPFLAGS = -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DDEBUG
+diff -Naupr udftools-1.0.0b3.orig/wrudf/Makefile.in udftools-1.0.0b3/wrudf/Makefile.in
+--- udftools-1.0.0b3.orig/wrudf/Makefile.in 2004-02-23 10:33:48.000000000 +0100
++++ udftools-1.0.0b3/wrudf/Makefile.in 2006-07-27 14:21:44.000000000 +0200
+@@ -85,7 +85,7 @@ am__quote = @am__quote@
+ install_sh = @install_sh@
+ bin_PROGRAMS = wrudf
+ wrudf_LDADD = $(top_builddir)/libudffs/libudffs.la -lreadline -lncurses
+-wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h
++wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h ../include/libudffs.h
+
+ AM_CPPFLAGS = -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DDEBUG
+ subdir = wrudf
+diff -Naupr udftools-1.0.0b3.orig/wrudf/wrudf.h udftools-1.0.0b3/wrudf/wrudf.h
+--- udftools-1.0.0b3.orig/wrudf/wrudf.h 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/wrudf/wrudf.h 2006-07-27 14:22:33.000000000 +0200
+@@ -23,9 +23,11 @@
+ #include <sys/time.h>
+ #include <time.h>
+ #include <stdint.h>
++#include <string.h>
+
+ #include "ecma_167.h"
+ #include "osta_udf.h"
++#include "libudffs.h"
+
+ struct generic_desc
+ {
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch
new file mode 100644
index 000000000000..1593eb600fae
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch
@@ -0,0 +1,160 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-warningfixes2.patch?h=f22
+
+diff -ur udftools-1.0.0b3/libudffs/file.c udftools-1.0.0b3-new/libudffs/file.c
+--- udftools-1.0.0b3/libudffs/file.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/libudffs/file.c 2007-08-23 14:02:07.000000000 +0200
+@@ -576,7 +576,7 @@
+ tmp = leBPL_to_cpup(p);
+ found_first:
+ tmp |= (~0UL << size);
+- if (tmp == ~0UL) /* Are any bits zero? */
++ if (tmp == (uintBPL)~0UL) /* Are any bits zero? */
+ return result + size; /* Nope. */
+ found_middle:
+ return result + ffz(tmp);
+diff -ur udftools-1.0.0b3/mkudffs/mkudffs.c udftools-1.0.0b3-new/mkudffs/mkudffs.c
+--- udftools-1.0.0b3/mkudffs/mkudffs.c 2007-08-23 14:32:38.000000000 +0200
++++ udftools-1.0.0b3-new/mkudffs/mkudffs.c 2007-08-23 14:14:42.000000000 +0200
+@@ -72,7 +72,7 @@
+ disc->udf_pvd[0] = malloc(sizeof(struct primaryVolDesc));
+ memcpy(disc->udf_pvd[0], &default_pvd, sizeof(struct primaryVolDesc));
+ memcpy(&disc->udf_pvd[0]->recordingDateAndTime, &ts, sizeof(timestamp));
+- sprintf(&disc->udf_pvd[0]->volSetIdent[1], "%08lx%s",
++ sprintf((char *)&disc->udf_pvd[0]->volSetIdent[1], "%08lx%s",
+ mktime(tm), &disc->udf_pvd[0]->volSetIdent[9]);
+ disc->udf_pvd[0]->volIdent[31] = strlen(disc->udf_pvd[0]->volIdent);
+ disc->udf_pvd[0]->volSetIdent[127] = strlen(disc->udf_pvd[0]->volSetIdent);
+@@ -289,7 +289,7 @@
+ int write_disc(struct udf_disc *disc)
+ {
+ struct udf_extent *start_ext;
+- int ret;
++ int ret=0;
+
+ start_ext = disc->head;
+
+@@ -299,6 +299,7 @@
+ return ret;
+ start_ext = start_ext->next;
+ }
++ return ret;
+ }
+
+ void setup_vrs(struct udf_disc *disc)
+@@ -450,7 +451,7 @@
+ struct unallocSpaceEntry *use;
+ short_ad *sad;
+ int max = (0x3FFFFFFF / disc->blocksize) * disc->blocksize;
+- int pos;
++ int pos=0;
+ long long rem;
+
+ if (disc->flags & FLAG_STRATEGY4096)
+diff -ur udftools-1.0.0b3/wrudf/ide-pc.c udftools-1.0.0b3-new/wrudf/ide-pc.c
+--- udftools-1.0.0b3/wrudf/ide-pc.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/wrudf/ide-pc.c 2007-08-23 14:32:09.000000000 +0200
+@@ -31,6 +31,7 @@
+ #include <sys/types.h> /* for u_char etc. */
+ #include <linux/cdrom.h>
+ #include <unistd.h> /* sleep() */
++#include <stdlib.h>
+
+ #include "bswap.h"
+ #include "ide-pc.h"
+diff -ur udftools-1.0.0b3/wrudf/wrudf.c udftools-1.0.0b3-new/wrudf/wrudf.c
+--- udftools-1.0.0b3/wrudf/wrudf.c 2007-08-23 14:32:38.000000000 +0200
++++ udftools-1.0.0b3-new/wrudf/wrudf.c 2007-08-23 14:26:41.000000000 +0200
+@@ -245,7 +245,7 @@
+ } else if( strncmp( spm->partIdent.ident, UDF_ID_VIRTUAL, strlen(UDF_ID_VIRTUAL)) == 0 )
+ virtualPartitionNum = i;
+ }
+- spm = (char*)spm + spm->partitionMapLength;
++ spm = (struct sparablePartitionMap*)((char*)spm + spm->partitionMapLength);
+ }
+
+ if( medium == CDR ) {
+@@ -300,7 +300,7 @@
+ fail("SpaceBitmap not found\n");
+ }
+
+- if (fsdLen = decode_utf8(fsd->fileSetIdent, fsdOut, fsd->fileSetIdent[31]))
++ if ((fsdLen = decode_utf8(fsd->fileSetIdent, fsdOut, fsd->fileSetIdent[31]))>=0)
+ fsdOut[fsdLen] = '\0';
+
+ printf("You are going to update fileset '%s'\nProceed (y/N) : ", &fsdOut[1]);
+@@ -605,7 +605,7 @@
+ int
+ main(int argc, char** argv)
+ {
+- int rv;
++ int rv=0;
+ int cmnd;
+ char prompt[256];
+ Directory *d;
+diff -ur udftools-1.0.0b3/wrudf/wrudf-cdrw.c udftools-1.0.0b3-new/wrudf/wrudf-cdrw.c
+--- udftools-1.0.0b3/wrudf/wrudf-cdrw.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/wrudf/wrudf-cdrw.c 2007-08-23 14:30:14.000000000 +0200
+@@ -614,7 +614,6 @@
+ readTaggedBlock(uint32_t lbn, uint16_t partition)
+ {
+ int i;
+- uint32_t blkno;
+ uint8_t sum, *p;
+ struct generic_desc *block;
+
+@@ -634,7 +633,7 @@
+ if( strncmp(((struct sparingTable*)block)->sparingIdent.ident, UDF_ID_SPARING, strlen(UDF_ID_SPARING)) != 0 ) {
+ for( i = 0; i < 2048; i++ ) {
+ if( ((uint8_t*)block)[i] != 0 ) {
+- printf("readTaggedBlock: Empty block %d not all zeroes\n", blkno);
++ printf("readTaggedBlock: Empty block %d not all zeroes\n", lbn);
+ break;
+ }
+ }
+@@ -647,10 +646,10 @@
+ sum += *(p + i);
+
+ if( block->descTag.tagChecksum != sum )
+- fail("readTagged: Checksum error in block %d\n", blkno);
++ fail("readTagged: Checksum error in block %d\n", lbn);
+
+ if( block->descTag.descCRC != udf_crc((uint8_t*)block + sizeof(tag), ((tag*)block)->descCRCLength, 0) )
+- fail("readTagged: CRC error in block %d\n", blkno);
++ fail("readTagged: CRC error in block %d\n", lbn);
+
+ return block;
+ }
+@@ -709,8 +708,8 @@
+ writeExtents(char* src, int usesShort, void* extents)
+ {
+ uint len, blkno, partitionNumber;
+- long_ad *lo;
+- short_ad *sh;
++ long_ad *lo=NULL;
++ short_ad *sh=NULL;
+
+ if( usesShort ) {
+ sh = (short_ad*) extents;
+diff -ur udftools-1.0.0b3/wrudf/wrudf-cmnd.c udftools-1.0.0b3-new/wrudf/wrudf-cmnd.c
+--- udftools-1.0.0b3/wrudf/wrudf-cmnd.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/wrudf/wrudf-cmnd.c 2007-08-23 14:22:41.000000000 +0200
+@@ -45,7 +45,7 @@
+ int
+ copyFile(Directory *dir, char* inName, char*newName, struct stat *fileStat)
+ {
+- int fd, i, blkno;
++ int fd, i=0, blkno;
+ uint32_t nBytes, blkInPkt;
+ uint32_t maxVarPktSize; // in bytes
+ struct fileIdentDesc *fid;
+@@ -54,7 +54,7 @@
+
+ fd = open(inName, O_RDONLY);
+ if( fd == 0 ) {
+- printf("'%s' does not exist\n", cmndv[i]);
++ printf("'%s' does not exist\n", inName);
+ return CMND_FAILED;
+ }
+
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch b/sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch
new file mode 100644
index 000000000000..06d9c3f616f4
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch
@@ -0,0 +1,52 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-wrudf_help.patch?h=f22
+
+diff -up wrk/wrudf/wrudf.c.wrk wrk/wrudf/wrudf.c
+--- wrk/wrudf/wrudf.c.wrk 2013-04-15 15:32:03.395528452 +0200
++++ wrk/wrudf/wrudf.c 2013-04-15 16:06:37.535546730 +0200
+@@ -603,6 +603,28 @@ parseCmnd(char* line)
+ return cmnd;
+ }
+
++int show_help()
++{
++ char *msg =
++ "Interactive tool to maintain an UDF filesystem.\n"
++ "Usage:\n"
++ "\twrudf [device]\n"
++ "Available commands:\n"
++ "\tcp\n"
++ "\trm\n"
++ "\tmkdir\n"
++ "\trmdir\n"
++ "\tlsc\n"
++ "\tlsh\n"
++ "\tcdc\n"
++ "\tcdh\n"
++ "Specify cdh/lsh or cdc/lsc to do cd or ls for Harddisk or CompactDisc.\n"
++ "\tquit\n"
++ "\texit\n";
++ printf("%s", msg);
++ return 0;
++}
++
+ int
+ main(int argc, char** argv)
+ {
+@@ -614,8 +636,14 @@ main(int argc, char** argv)
+ printf("wrudf " WRUDF_VERSION "\n");
+ devicename= "/dev/cdrom";
+
+- if(argc > 1 )
++ if(argc > 1 ) {
++ if (strcmp(argv[1], "-h")==0 || strcmp(argv[1], "-help")==0 || strcmp(argv[1], "--help")==0) {
++ return show_help();
++ }
++ }
++ else {
+ devicename = argv[1]; /* can specify disk image filename */
++ }
+
+ if( setpriority(PRIO_PROCESS, 0, -10) ) {
+ printf("setpriority(): %m\n");
diff --git a/sys-fs/udftools/udftools-1.0.0b-r10.ebuild b/sys-fs/udftools/udftools-1.0.0b-r10.ebuild
new file mode 100644
index 000000000000..6796fcc12731
--- /dev/null
+++ b/sys-fs/udftools/udftools-1.0.0b-r10.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/udftools/udftools-1.0.0b-r10.ebuild,v 1.1 2015/05/12 05:05:19 vapier Exp $
+
+EAPI="5"
+
+inherit eutils flag-o-matic
+
+MY_P=${P}3
+
+DESCRIPTION="Ben Fennema's tools for packet writing and the UDF filesystem"
+HOMEPAGE="http://sourceforge.net/projects/linux-udf/"
+SRC_URI="mirror://sourceforge/linux-udf/${MY_P}.tar.gz
+ http://w1.894.telia.com/~u89404340/patches/packet/${MY_P}.patch.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sys-libs/readline"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ # For new kernel packet writing driver
+ epatch "${WORKDIR}"/${MY_P}.patch
+ epatch "${FILESDIR}"/cdrwtool-linux2.6-fix-v2.patch
+ epatch "${FILESDIR}"/${P}-gcc4.patch #112122
+ epatch "${FILESDIR}"/${P}-bigendian.patch #120245
+ epatch "${FILESDIR}"/${P}-openflags.patch #232100
+ epatch "${FILESDIR}"/${P}-limits_h.patch
+ epatch "${FILESDIR}"/${P}3-extsize.patch
+ epatch "${FILESDIR}"/${P}3-man-missing-options.patch
+ epatch "${FILESDIR}"/${P}3-mkudffs-bigendian.patch
+ epatch "${FILESDIR}"/${P}3-staticanal.patch
+ epatch "${FILESDIR}"/${P}3-warningfixes.patch
+ epatch "${FILESDIR}"/${P}3-warningfixes2.patch
+ epatch "${FILESDIR}"/${P}3-wrudf_help.patch
+ # Force older C standard as the code relies on static inline behavior. #548324
+ append-flags -std=gnu89
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/pktcdvd.init pktcdvd
+ dosym /usr/bin/udffsck /usr/sbin/fsck.udf
+}