Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Dec 2005 21:46:37 +0530
From:      Joseph Koshy <joseph.koshy@gmail.com>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        arch@freebsd.org
Subject:   Re: printf behaviour with illegal or malformed format string
Message-ID:  <84dead720512120816t7c907c3aq9add32c5dc8b9a38@mail.gmail.com>
In-Reply-To: <1023.1134389663@critter.freebsd.dk>
References:  <1023.1134389663@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
phk> I'm leaning towards doing what phkmalloc has migrated to
phk> over time:
phk> Make a variable which can select between "normal/paranoia"
phk> and force it to paranoia for (uid=3D=3D0 || gid=3D=3D0 ||
phk> setuid || setgid).

phk> If the variable is set, a bogus format string will result
phk> in abort(2).

phk> If it is not set, the format string will be output
phk> unformatted in the message "WARNING: Illegal printf()
phk> format string: \"...\".

Why not just print the warning for both cases, and
stop interpreting the format string any further.

What do we gain by having a uid 0 process dump core?

--
FreeBSD Volunteer,     http://people.freebsd.org/~jkoshy



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?84dead720512120816t7c907c3aq9add32c5dc8b9a38>