NetBSD-Bugs archive

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

Re: kern/48852 CD9660 RockRidge: device files not properly handled



The following reply was made to PR kern/48852; it has been noted by GNATS.

From: "Thomas Schmitt" <scdbackup%gmx.net@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/48852 CD9660 RockRidge: device files not properly handled
Date: Fri, 30 May 2014 11:14:27 +0200

 The problem is reproducible on my 6.99.40:
 
   mknod /home/thomas/test/wd1e b 0 12
   chmod u+r,go-r,a-wx /home/thomas/test/wd1e
   cd /home/thomas
   ls -l test
 
 yields
 
   br--------  1 root  users  0, 12 May 30 08:52 wd1e
 
 But
   makefs -t cd9660 -o rockridge test.iso test
   xorriso -indev test.iso -lsl / --
 yields
   br--------    1 0        100           0,0 May 30 08:52 'wd1e'
 
 So the problem is in makefs and not in cd9660.
 
 -----------------------------------------------------------------------
 
 Related source code is in cd9660/iso9660_rrip.c:
 
                 if (node->node->inode != NULL &&
                     ((S_ISCHR(node->node->inode->st.st_mode) ||
                      S_ISBLK(node->node->inode->st.st_mode)))) {
                         attr =
                             cd9660node_susp_create_node(SUSP_TYPE_RRIP,
                                 SUSP_ENTRY_RRIP_PN, "PN",
                                 SUSP_LOC_ENTRY);
                         cd9660node_rrip_pn(attr, node->node);
                         TAILQ_INSERT_TAIL(&node->head, attr, rr_ll);
                 }
 and
 
   int
   cd9660node_rrip_pn(struct ISO_SUSP_ATTRIBUTES *pn_field, fsnode *fnode)
   {
         pn_field->attr.rr_entry.PN.h.length[0] = 20;
         pn_field->attr.rr_entry.PN.h.version[0] = 1;
 
         if (sizeof (fnode->inode->st.st_dev) > 32)
                 cd9660_bothendian_dword((uint64_t)fnode->inode->st.st_dev >> 
32,
                     pn_field->attr.rr_entry.PN.high);
         else
                 cd9660_bothendian_dword(0, pn_field->attr.rr_entry.PN.high);
 
         cd9660_bothendian_dword(fnode->inode->st.st_dev & 0xffffffff,
                 pn_field->attr.rr_entry.PN.low);
         return 1;
   }
 
 sizeof (fnode->inode->st.st_dev) > 32 looks strange.
 Did the programmer mean bits rather than bytes ?
 But a bug here would affect the major device number, which is
 0 anyway.
 
 The numbers 20 and 1 comply to RRIP-1.12.
 cd9660_bothendian_dword() is frequently used in makefs.
 A bug of this would show up at other ISO 9660 aspects too.
 
 So something undesirable must have happened to the dev_t numbers.
 
 ------
 cd9660/iso9660_rrip.h:
 
   typedef struct {
         ISO_SUSP_HEADER          h;
         u_char high             [ISODCL(5,12)];
         u_char low              [ISODCL(13,20)];
   } ISO_RRIP_PN;
 
 This layout complies to RRIP-1.12 (in the web as e.g. rrip128.pdf).
 
 -----------------------------------------------------------------------
 
 My attempts to compile /usr/src/usr.sbin/makefs fail with
   cd9660.o: In function `cd9660_level2_convert_filename':
   cd9660.c:(.text+0x271): undefined reference to `_ctype_tab_'
 which seems to be an incompatibility between NetBSD-6.1.3 from
 binary packages and /usr/src from CVS.
 
 So i cannot insert a few printf() here to find out which values
 are seen and what code branch is executed.
 


Home | Main Index | Thread Index | Old Index