[PATCH] Re: /etc/rc.d/sshd : "kldload random" missing?

Rob spamrefuse at yahoo.com
Tue Apr 19 00:13:07 PDT 2005


--- Kris Kennaway <kris at obsecurity.org> wrote:
> On Sun, Apr 17, 2005 at 08:48:37PM -0700, Rob wrote:
> > 
> > Hi,
> > 
> > I noticed that 'random.ko' module is required
> > by ssh, especially when running the server sshd.
> > However, the sshd script in /etc/rc.d does not
> > verify the pressence of the random.ko module and
> > neither loads it if necessary. Shouldn't that be
> > added?
> > 
> > I bring this up, since I have observed that the
> > nfsserver.ko module is automagically loaded by the
> > /etc/rc.d/nfsserver script.
> > 
> > Both cases seem to have some similarity.
> 
> Sounds like a great opportunity to submit a patch!
> :)


Should I submit a patch here?

Following patch works fine for me
(be aware some lines are wrapped :[ )

--- /etc/rc.d/sshd       Sun Oct 10 18:50:54 2004
+++ /etc/rc.d/sshd       Tue Apr 19 15:56:12 2005
@@ -80,6 +80,14 @@
 
 sshd_precmd()
 {
+        if !  ${SYSCTL} kern.random >/dev/null 2>&1;
then
+                if ! kldload random; then
+                        warn 'Could not load random
module'
+                        return 1
+                fi
+        fi
+
         if [ ! -f /etc/ssh/ssh_host_key -o \
             ! -f /etc/ssh/ssh_host_dsa_key -o \
             ! -f /etc/ssh/ssh_host_rsa_key ]; then



		
__________________________________ 
Do you Yahoo!? 
Make Yahoo! your home page 
http://www.yahoo.com/r/hs


More information about the freebsd-stable mailing list