Paul Eggert <[EMAIL PROTECTED]> wrote: > Jim Meyering <[EMAIL PROTECTED]> writes: > >> 2008-01-07 Jan Blunck <[EMAIL PROTECTED]> >> >> cp --parents: don't use uninitialized memory when restoring permissions > > In reviewing that patch I noticed that the bug of using uninitialized > memory still remains in some (unlikely) cases. If 'stat (src, > &new->st)' fails, the resulting uninitialized new->st buffer still > remains in the list of directories whose modes need fixing later. As > far as I can tell the bug is triggered only in a race condition, where > a directory is moved as we are trying to copy it, so it's hard to come > up with a test case for it. However, here's a patch. > > 2008-01-08 Paul Eggert <[EMAIL PROTECTED]> > > Fix a minor race condition when using cp -p --parents. > * src/cp.c (make_dir_parents_private): If stat fails on the parent > directory, do not add it to the list of directories whose modes > might need fixing later. Also, do not bother invoking 'stat' > unless the stat results might be needed later.
Good catch. I've applied and pushed that. _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils