help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to safely print a variable with secret value to stdout?


From: Philippe Cerfon
Subject: Re: How to safely print a variable with secret value to stdout?
Date: Thu, 12 May 2022 06:04:10 +0200

On Thu, May 12, 2022 at 4:05 AM Greg Wooledge <greg@wooledge.org> wrote:
> You can't idiot-proof the entire world.  If a damned idiot does something
> this stupid and compromises their own security, it is not your fault.
> Moreover, you cannot PREVENT them from doing it.  It's out of your hands.

Sure, but just trying to write portable code is not beyond acceptable
means of preventing stupid things from happening.

> Write it in C.

I'm afraid I have to use shell here.


If someone has an idea whether my assumption about built-in printf is
correct, i.e. that it would be safe, and whether the method with
command -v is safe to check for that I'd still be interested to hear,
of course also if someone knows some nice other way.

Regards,
Philippe.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]