News for hackers. Stuff that matters.
Re:PAM Duress – Alternate passwords for panic situations by dheera on Sunday August 22, 2021 @04:47PM (#28269461)
Just do this in your script

    rm -rf /secret/files > /dev/null 2>&1
That pipes STDOUT to /dev/null and redirects STDERR to STDOUT.
Re:PAM Duress – Alternate passwords for panic situations by nuvious on Tuesday August 24, 2021 @12:42AM (#28285175)
I may actually incorporate that into the system() call in the module itself now that I think about it. The Hello World implementation was just a quick way for me to debug while I developed it and it's probably smarter to dump it to /dev/null by default.
Re:PAM Duress – Alternate passwords for panic situations by sleavey on Sunday August 22, 2021 @05:03PM (#28269588)
Seems like this should be baked in to the module. There don't seem to be any circumstances where you would want stdout/stderr from duress.d scripts to appear.
Re:PAM Duress – Alternate passwords for panic situations by wowaname on Sunday August 22, 2021 @08:13PM (#28270991)
You have the freedom to do whatever you want with the script. It's trivial to `exec >/dev/null 2>/dev/null` first thing in a script if you want it to be silent.
Re:PAM Duress – Alternate passwords for panic situations by sleavey on Monday August 23, 2021 @03:09AM (#28273046)
Do you want to first find that out when you're under duress? Sensible defaults matter.
Re:PAM Duress – Alternate passwords for panic situations by wowaname on Monday August 23, 2021 @09:15AM (#28275206)
Are you seriously writing a script when the cops are at your door? No, you aren't. You always need to verify that your protective mechanisms work before actually relying on them.
Re:PAM Duress – Alternate passwords for panic situations by sleavey on Tuesday August 24, 2021 @05:39PM (#28295334)
As I alluded to in my original comment, you might not pick up on a transient error like an I/O error during testing. This is exactly the sort of thing a sensible default setting in the program should cover.
Re:PAM Duress – Alternate passwords for panic situations by wowaname on Wednesday August 25, 2021 @05:42PM (#28307463)
I'm sorry but error handling and testing requirements are true for any software or script a person writes. The application should not give a shit, and a simple execve() is the best way to go about it. It's the principle of least surprise, and people have had to keep in mind fork/exec semantics for decades.