On Thu, 30 Oct 1997, Oliver Xymoron wrote:
> On Thu, 30 Oct 1997, Pam Skillman wrote:
>
> > Okay, after getting my Perl expert to look at this, he
> > suggested moving the 'srand time^$$;' to somewhere
> > outsite the loop so it would only run once per execution
> > of the majordomo program. This seems to have solved
> > my problem.
>
> Ahhh.. I didn't understand your problem before. You're send multiple
> subscribe requests in a single message, thus they're getting processed by
> a single run of Majordomo, hence the same time and PID.
>
> The /dev/random fix should work for this case as well. But I don't
> think you set it up right, otherwise the behaviour would have
> changed dramatically. Here's the relevant code from majordomo:
>
I have 2.0 kernel and /dev/random and /dev/urandom both exist.
It seems that the 'if' code is never getting executed due to the
'-f' option check... /dev/random and /dev/urandom will never be
plain files, right? I changed this to '-e' to check for existence
instead. Is that what was intended? Thanks!
> if($confirm_randev && -f $confirm_randev)
> {
> local(*RAND);
> open(RAND,"$confirm_randev") ||
> abort("Couldn't open $confirm_randev: $!");
>
> for(1..7)
> {
> $binkey .= getc RAND;
> }
> close RAND;
> }
> else
> {
> srand time^$$;
> for(1..7)
> {
> $binkey .= pack("c",rand 256);
> }
> }
>
> /dev/random is guaranteed to deliver characters that are completely
> unpredictable to users, but the above code falls back to the built-in
> random function if the variable isn't set properly or it can't open the
> file. Check your /dev directory to see if the device exists. If you have a
> non-2.0 kernel, it may not be available. If you DO have a 2.0 kernel, you
> may have to create the device with mknod.
>
> --
> "Love the dolphins," she advised him. "Write by W.A.S.T.E.."
>
>
>
>
/////////////////////////////////////////////////////////////////////////////
pam@infi.net Pamela J. Skillman
http://www.usgcc.odu.edu Systems Engineer III
Systems Engineering
InfiNet
(757) 624-2295 (x3082)
(757) 624-2473 FAX
/////////////////////////////////////////////////////////////////////////////
Follow-Ups:
|
|