*** djlib/src/utils/djtar/djtar.org Thu Jan 1 16:35:50 1998
--- djlib/src/utils/djtar/djtar.c Fri Mar 13 23:23:06 1998
***************
*** 234,240 ****
--- 234,246 ----
break;
r = mkdir (n, 0777);
if (r)
+ {
+ if(errno == ENOENT)
+ {
+ Fatal("Unable to create directory");
+ }
r = change(n, "Unable to create directory", 1);
+ }
} while (r);
*sl = save;
}
***************
*** 446,451 ****
--- 452,461 ----
{
status = change(dirname, "Duplicate directory name", 2);
continue;
+ }
+ if (status && (errno==ENOENT))
+ {
+ Fatal("Unable to create directory");
}
if (status)
status = change(dirname, "Unable to create directory", 1);
djtar can still be made to loop endlessly, but without overwriting the
stack, on the right input in plain DOS.
Say you have a tar file containing the directories "1/aaaaaaaa"
(eight As) and "1/aaaaaaaaa" (nine As). djtar creates the first
directory, but fails on the second (as it is the same name in plain
DOS). The user is asked for a new name, he answers "aaaaaaaa" (eight
As), which will fail. Then he answers "aaaaaaaaa" (nine As).
Ergo loop.