NetBSD-Bugs archive

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

Re: bin/44114: makefs(8) -t cd9660 -o rockridge creates corrupted cd9660fs



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

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: bin/44114: makefs(8) -t cd9660 -o rockridge creates corrupted 
cd9660fs
Date: Sun, 29 May 2011 01:25:48 +0900

 I'm testing the following patch and will commit it if there is
 no particular problem.
 
 Note cd9660_rrip_initialize_node() changes are just logical cleanup.
 (it's a bit awful to update dot_dot_record which isn't passed as input)
 
 ---
 Index: cd9660.c
 ===================================================================
 RCS file: /cvsroot/src/usr.sbin/makefs/cd9660.c,v
 retrieving revision 1.28
 diff -u -p -r1.28 cd9660.c
 --- cd9660.c   19 Nov 2010 15:47:32 -0000      1.28
 +++ cd9660.c   28 May 2011 16:20:41 -0000
 @@ -1312,6 +1312,8 @@ cd9660_rrip_move_directory(cd9660node *d
        /* Set the new name */
        memset(dir->isoDirRecord->name, 0, ISO_FILENAME_MAXLENGTH_WITH_PADDING);
        strncpy(dir->isoDirRecord->name, newname, 8);
 +      dir->isoDirRecord->length[0] = 34 + 8;
 +      dir->isoDirRecord->name_len[0] = 8;
  
        return dir;
  }
 Index: cd9660/iso9660_rrip.c
 ===================================================================
 RCS file: /cvsroot/src/usr.sbin/makefs/cd9660/iso9660_rrip.c,v
 retrieving revision 1.9
 diff -u -p -r1.9 iso9660_rrip.c
 --- cd9660/iso9660_rrip.c      28 May 2011 11:59:29 -0000      1.9
 +++ cd9660/iso9660_rrip.c      28 May 2011 16:20:41 -0000
 @@ -185,10 +185,11 @@ cd9660_rrip_finalize_node(cd9660node *no
                        break;
                case SUSP_ENTRY_RRIP_PL:
                        /* Look at rr_real_parent */
 -                      if (node->rr_real_parent == NULL)
 +                      if (node->parent == NULL ||
 +                          node->parent->rr_real_parent == NULL)
                                return -1;
                        cd9660_bothendian_dword(
 -                              node->rr_real_parent->fileDataSector,
 +                              node->parent->rr_real_parent->fileDataSector,
                                (unsigned char *)
                                    t->attr.rr_entry.PL.dir_loc);
                        break;
 @@ -398,6 +399,13 @@ cd9660_rrip_initialize_node(cd9660node *
                        cd9660node_rrip_px(current, grandparent->node);
                        TAILQ_INSERT_TAIL(&node->head, current, rr_ll);
                }
 +              if (parent != NULL && parent->rr_real_parent != NULL) {
 +                      /* Handle PL */
 +                      current = cd9660node_susp_create_node(SUSP_TYPE_RRIP,
 +                          SUSP_ENTRY_RRIP_PL, "PL", SUSP_LOC_DOTDOT);
 +                      cd9660_rrip_PL(current,node);
 +                      TAILQ_INSERT_TAIL(&node->head, current, rr_ll);
 +              }
        } else {
                cd9660_rrip_initialize_inode(node);
  
 @@ -437,13 +445,6 @@ cd9660_rrip_initialize_node(cd9660node *
                                SUSP_ENTRY_RRIP_RE, "RE", SUSP_LOC_ENTRY);
                        cd9660_rrip_RE(current,node);
                        TAILQ_INSERT_TAIL(&node->head, current, rr_ll);
 -
 -                      /* Handle PL */
 -                      current = cd9660node_susp_create_node(SUSP_TYPE_RRIP,
 -                              SUSP_ENTRY_RRIP_PL, "PL", SUSP_LOC_DOTDOT);
 -                      cd9660_rrip_PL(current,node->dot_dot_record);
 -                      TAILQ_INSERT_TAIL(&node->dot_dot_record->head, current,
 -                          rr_ll);
                }
        }
        return 1;
 
 ---
 Izumi Tsutsui
 


Home | Main Index | Thread Index | Old Index