News for hackers. Stuff that matters.
Re:#include </etc/shadow> by puzzledobserver on Tuesday December 17, 2019 @12:53AM (#21811042)
Neither of the individual facts is surprising. It is the juxtaposition that is. In 20 years of writing C/C++ code, I had never thought of #including files such as /dev/stdin.

Of course, I know how the #include mechanism works, and what the special device files do, so I can anticipate the results of #include </dev/stdin>, but it is unusual enough that I had to write a small test program to see for myself.

Re:#include &lt;/etc/shadow&gt; by commandersaki on Tuesday December 17, 2019 @02:10AM (#21811371)
I’ve known about it for a very long time after someone pointed it out. I always joke that’s how I write C.

I never thought about it in terms of a security problem.