From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Matt Zimmerman <mdz-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
Cc: "Stéphane Aulery" <saulery-GANU6spQydw@public.gmane.org>,
679323-61a8vm9lEZVf4u+23C9RwQ@public.gmane.org,
linux-man <linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: clearenv(3): implies that it's a security tool
Date: Fri, 19 Feb 2016 12:59:05 +0100 [thread overview]
Message-ID: <CAKgNAkh0qR-5Kj0-bc6QtAM7j44s41YfNMUOfi_BAiFHYVOO5g@mail.gmail.com> (raw)
In-Reply-To: <20160218203447.GF3560-GlOw+ZFk85JeoWH0uzbU5w@public.gmane.org>
On 18 February 2016 at 21:34, Matt Zimmerman <mdz-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org> wrote:
> Thanks for following up. My recommendation is to say something like:
>
> This function DOES NOT securely erase the contents of the environment.
> Security-conscious applications which need to do this should use ....
> instead.
So, I think this report is a little confused, but mainly because of
the poor description in the man page.
The security-conscious applications in this context are those that
want to precisely control the environment passed to an exec()ed
program. clearenv() cannot, indeed must not, try to erase the buffers
containing the environment definitions. (See putenv(3) to understand
why.) I've adjusted the man page in away that I hope explains things
better:
The clearenv() function may be useful in security-conscious
applications that want to precisely control the environment that
is passed to programs executed using exec(3). The application
would do this by first clearing the environment and then adding
select environment variables.
Note that the main effect of clearenv() is to adjust the value of
the pointer environ(7); this function does not erase the contents
of the buffers containing the environment definitions.
Cheers,
Michael
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-02-19 11:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-18 17:28 clearenv(3): implies that it's a security tool Stéphane Aulery
[not found] ` <2022845728.87847295.1455816499626.JavaMail.root-ejyA1lUx/7j5pO4zsKA69P9ALaXTbT7g0e7PPNI6Mm0@public.gmane.org>
2016-02-18 20:34 ` Matt Zimmerman
[not found] ` <20160218203447.GF3560-GlOw+ZFk85JeoWH0uzbU5w@public.gmane.org>
2016-02-18 21:44 ` Bug#679323: " Stéphane Aulery
2016-02-19 11:59 ` Michael Kerrisk (man-pages) [this message]
[not found] ` <CAKgNAkh0qR-5Kj0-bc6QtAM7j44s41YfNMUOfi_BAiFHYVOO5g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-19 12:25 ` Stéphane Aulery
2016-02-19 16:22 ` Matt Zimmerman
[not found] ` <20160219162222.GB14410-GlOw+ZFk85JeoWH0uzbU5w@public.gmane.org>
2016-02-19 16:43 ` Stéphane Aulery
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKgNAkh0qR-5Kj0-bc6QtAM7j44s41YfNMUOfi_BAiFHYVOO5g@mail.gmail.com \
--to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=679323-61a8vm9lEZVf4u+23C9RwQ@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mdz-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org \
--cc=saulery-GANU6spQydw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).