[15142] in bugtraq

home help back first fref pref prev next nref lref last post

Re: wget-1.5.3, chmod+symlinks

daemon@ATHENA.MIT.EDU (Hrvoje Niksic)
Thu Jun 1 19:58:09 2000

Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Message-Id:  <dpzop5isez.fsf@mraz.iskon.hr>
Date:         Thu, 1 Jun 2000 12:53:24 +0200
Reply-To: hniksic@ISKON.HR
From: Hrvoje Niksic <hniksic@ISKON.HR>
X-To:         Const Kaplinsky <const@ce.cctpu.edu.ru>
To: BUGTRAQ@SECURITYFOCUS.COM
In-Reply-To:  Const Kaplinsky's message of "Tue, 02 Feb 1999 01:53:24 +0700"

Const Kaplinsky <const@ce.cctpu.edu.ru> writes:

> It seems to be bug in wget-1.5.3. When invoked with -N option, it
> tries to chmod downloaded symlinks, but actually permissions are
> changed at target files. This is very dangerous, because after that
> we can occasionally make some of our files world-writable (symlinks
> are usually report 0777 mode). It is especially dangerous when we
> are downloading symlinks with absolute paths to the target files.
>
> I think, its quite unnecessary to chmod symlinks at all, and in this
> case the bugfix is simple:
>
> -      if (f->perms && dlthis)
> +      if (f->perms && f->type != FT_SYMLINK && dlthis)

You're right.  I've even made the check stronger by using:

      if (f->perms && f->type == FT_PLAINFILE && dlthis)

Thanks for the patch, and sorry for the huge delay.

home help back first fref pref prev next nref lref last post