X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Ftraverse.c;h=f149b120b13555d31245e7fc9f09ea61d94cde84;hb=ebcbe7f6c10482913b60fc792e72e494b439b242;hp=7d6a38f02f8dd7fa1db2cc35d56d0558f3401c9c;hpb=c930abff2469b9571a22fc49d16f50f36f5a9301;p=dump.git diff --git a/dump/traverse.c b/dump/traverse.c index 7d6a38f..f149b12 100644 --- a/dump/traverse.c +++ b/dump/traverse.c @@ -2,7 +2,7 @@ * Ported to Linux's Second Extended File System as part of the * dump and restore backup suit * Remy Card , 1994-1997 - * Stelian Pop , 1999 + * Stelian Pop , 1999-2000 */ /*- @@ -40,7 +40,7 @@ #ifndef lint static const char rcsid[] = - "$Id: traverse.c,v 1.10 1999/11/21 02:24:47 tiniou Exp $"; + "$Id: traverse.c,v 1.14 2000/01/21 10:17:41 stelian Exp $"; #endif /* not lint */ #include @@ -283,9 +283,9 @@ mapfilesindir(struct ext2_dir_entry *dirent, int offset, int blocksize, char *bu dp = getino(dirent->inode); mode = dp->di_mode & IFMT; if (mode == IFDIR && dp->di_nlink != 0 && dp->di_dtime == 0) { - if ((dirent->name[0] != '.' || dirent->name_len != 1) && + if ((dirent->name[0] != '.' || ( dirent->name_len & 0xFF ) != 1) && (dirent->name[0] != '.' || dirent->name[1] != '.' || - dirent->name_len != 2)) { + ( dirent->name_len & 0xFF ) != 2)) { retval = ext2fs_dir_iterate(fs, ino, 0, NULL, mapfilesindir, private); if (retval) @@ -516,9 +516,9 @@ searchdir(struct ext2_dir_entry *dp, int offset, int blocksize, char *buf, void if (dp->inode == 0) return 0; if (dp->name[0] == '.') { - if (dp->name_len == 1) + if (( dp->name_len & 0xFF ) == 1) return 0; - if (dp->name[1] == '.' && dp->name_len == 2) + if (dp->name[1] == '.' && ( dp->name_len & 0xFF ) == 2) return 0; } if (mdc->nodump) { @@ -667,7 +667,7 @@ dumpino(struct dinode *dp, ino_t ino) obi.di_gen = dp->di_gen; memmove(&obi.di_db, &dp->di_db, (NDADDR + NIADDR) * sizeof(daddr_t)); if (dp->di_file_acl || dp->di_dir_acl) - warn("ACLs in inode #%ld won't be dumped", ino); + warn("ACLs in inode #%ld won't be dumped", (long)ino); memmove(&spcl.c_dinode, &obi, sizeof(obi)); #else /* __linux__ */ spcl.c_dinode = *dp; @@ -759,6 +759,7 @@ dumpino(struct dinode *dp, ino_t ino) if (bc.cnt > 0) { blksout (bc.buf, bc.cnt, bc.ino); } + free(bc.buf); #else for (ind_level = 0; ind_level < NIADDR; ind_level++) { dmpindir(ino, dp->di_ib[ind_level], ind_level, &size); @@ -849,7 +850,7 @@ dumpdirino(struct dinode *dp, ino_t ino) /* Do the conversion */ retval = ext2fs_dir_iterate(fs, ino, 0, NULL, convert_dir, (void *)&cdc); if (retval) { - com_err(disk, retval, "while converting directory #%ld\n", ino); + com_err(disk, retval, "while converting directory #%ld\n", (long)ino); exit(X_ABORT); } /* Fix the last entry */ @@ -876,7 +877,7 @@ dumpdirino(struct dinode *dp, ino_t ino) obi.di_gen = dp->di_gen; memmove(&obi.di_db, &dp->di_db, (NDADDR + NIADDR) * sizeof(daddr_t)); if (dp->di_file_acl || dp->di_dir_acl) - warn("ACLs in inode #%ld won't be dumped", ino); + warn("ACLs in inode #%ld won't be dumped", (long)ino); memmove(&spcl.c_dinode, &obi, sizeof(obi)); #else /* __linux__ */ spcl.c_dinode = *dp;