Re: /dev/random nitpicking

From: Theodore Y. Ts'o (tytso@MIT.EDU)
Date: Fri Jun 02 2000 - 16:06:57 EST


   Date: Fri, 02 Jun 2000 13:05:38 -0400
   From: Sandy Harris <sandy@storm.ca>

   Why create the file with dd and then chmod it? If instead we set umask
   before the dd, the file never has insecure permissions.

Setting umask would be safer, but in practice it's not an issue. Since
the file normally exists with the correct permissions, there's no race
condition since dd is merely overwriting the file, and so the
permissions are retained. The chmod in that case is really a
belt-and-suspenders sort of thing. Still if you want to be uber
paranoid, I can't think of any reason not use

        ( umask 077 ; dd if=/dev/urandom of=$random_seed count=1)

instead.

                                                        - Ted

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:16 EST