X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=restore%2Fdirs.c;h=2d559fea248efd3078ad63a21c6eb5cf8e9098d1;hb=64bb207ae9f9a2cad0aff0990d3fd94d9b7c3c55;hp=e4cffd956755f3d25a55eecbbd211aaefc8f102e;hpb=ec387a1267f4cac7625cd5b6d1c1f080d39085b3;p=dump.git diff --git a/restore/dirs.c b/restore/dirs.c index e4cffd9..2d559fe 100644 --- a/restore/dirs.c +++ b/restore/dirs.c @@ -2,8 +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 */ /* @@ -42,10 +41,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id: dirs.c,v 1.5 1999/10/11 13:31:12 stelian Exp $ */ +#ifndef lint +static const char rcsid[] = + "$Id: dirs.c,v 1.9 2000/03/01 10:16:05 stelian Exp $"; +#endif /* not lint */ + #include #include #include @@ -377,10 +379,6 @@ putdir(char *buf, size_t size) if (Bcvt) swabst((u_char *)"is", (u_char *) dp); if (oldinofmt && dp->d_ino != 0) { -#ifdef __linux__ - if (Bcvt) - swabst((u_char *)"s", (u_char *)&dp->d_namlen); -#else # if BYTE_ORDER == BIG_ENDIAN if (Bcvt) dp->d_namlen = dp->d_type; @@ -388,16 +386,8 @@ putdir(char *buf, size_t size) if (!Bcvt) dp->d_namlen = dp->d_type; # endif -#endif /* __linux__ */ dp->d_type = DT_UNKNOWN; } -#ifdef __linux__ - /* - * Horrible hack to read FreeBSD 2.0 dumps - */ - if (!oldinofmt) - swabst((u_char *)"6bs", (u_char *) dp); -#endif /* __linux__ */ #ifdef DIRDEBUG printf ("reclen = %d, namlen = %d, type = %d\n", dp->d_reclen, dp->d_namlen, dp->d_type); @@ -406,7 +396,7 @@ putdir(char *buf, size_t size) if ((dp->d_reclen & 0x3) != 0 || dp->d_reclen > i || dp->d_reclen < DIRSIZ(0, dp) || - dp->d_namlen > NAME_MAX) { + dp->d_namlen > MAXNAMLEN) { Vprintf(stdout, "Mangled directory: "); if ((dp->d_reclen & 0x3) != 0) Vprintf(stdout, @@ -415,10 +405,10 @@ putdir(char *buf, size_t size) Vprintf(stdout, "reclen less than DIRSIZ (%d < %d) ", dp->d_reclen, DIRSIZ(0, dp)); - if (dp->d_namlen > NAME_MAX) + if (dp->d_namlen > MAXNAMLEN) Vprintf(stdout, "reclen name too big (%d > %d) ", - dp->d_namlen, NAME_MAX); + dp->d_namlen, MAXNAMLEN); Vprintf(stdout, "\n"); loc += i; continue;