[patch] various bugs and strncpy abuse followup
roberto foglietta
roberto.foglietta at gmail.com
Sat Jun 10 11:48:15 UTC 2006
2006/6/7, Tito <farmatito at tiscali.it>:
>
> if ( !make_dir_tree (destination) || lstat (source, &source_stat) != 0)
> - return;
> - lstat (destination, &dest_stat);
> + return;
> + if (lstat (destination, &dest_stat) != 0)
> + return;;
> new_mode = source_stat.st_mode & ~S_ISVTX;
> if (info->type == DEVFSD_NOTIFY_CREATE)
> new_mode |= S_ISVTX;
>
> This is unneeded. The original code does:
>
> if (lstat (destination, &dest_stat) != 0) dest_stat.st_mode = 0;
>
> but we have already initialised dest_stat.st_mode to 0 so we can spare the if statement.
> Please drop this part.
>
One day somebody changes initialization of dest_stat.st_mode != 0?
It would happen/makes sense? If yes the patch should be accepted (IMHO).
Cheers,
--
/roberto
More information about the busybox
mailing list