X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnu%2Funlink.c;h=a861d307fb06bdd7f1ac40374f30dcd7e7de5018;hb=1a44d77d50f4fb37c0410eed04b82303624ea2ec;hp=568d2cdce4a58caa2516a5943cfc18dc7f08fa5a;hpb=22f1eb8bc17e5be72dd23d42d6aaa60196ac22e6;p=debian%2Ftar diff --git a/gnu/unlink.c b/gnu/unlink.c index 568d2cdc..a861d307 100644 --- a/gnu/unlink.c +++ b/gnu/unlink.c @@ -2,7 +2,7 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Work around unlink bugs. - Copyright (C) 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2009-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,6 +26,8 @@ #include #include +#include "dosname.h" + #undef unlink /* Remove file NAME. @@ -82,6 +84,16 @@ rpl_unlink (char const *name) } } if (!result) - result = unlink (name); + { +#if UNLINK_PARENT_BUG + if (len >= 2 && name[len - 1] == '.' && name[len - 2] == '.' + && (len == 2 || ISSLASH (name[len - 3]))) + { + errno = EISDIR; /* could also use EPERM */ + return -1; + } +#endif + result = unlink (name); + } return result; }