Example:
echo a > 2;
echo b > 3;
mv --reply=no 2 3;
will overwrite 3 instead of aborting move operation.
Problem:
In copy.c:932
if ((x->interactive == I_ALWAYS_NO
&& UNWRITABLE (dst_path, dst_sb.st_mode))
|| ((x->interactive == I_ASK_USER
|| (x->interactive == I_UNSPECIFIED
&& x->stdin_tty
&& UNWRITABLE (dst_path, dst_sb.st_mode)))
&& (overwrite_prompt (dst_path, &dst_sb), 1)
&& ! yesno ()))
UNWRITABLE (dst_path, dst_sb.st_mode) returns false, rendering
x->interactive == I_ALWAYS_NO irrelevant.
Solution:
Remove the offending expression and it works as documented.
if (x->interactive == I_ALWAYS_NO
|| ((x->interactive == I_ASK_USER
|| (x->interactive == I_UNSPECIFIED
&& x->stdin_tty
&& UNWRITABLE (dst_path, dst_sb.st_mode)))
&& (overwrite_prompt (dst_path, &dst_sb), 1)
&& ! yesno ()))
Jan Ove Haaland
_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils