Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37382340
en ru br
ALT Linux repos
S:5.45.4-alt4
5.0: 5.44-alt3
4.1: 5.44-alt2
4.0: 5.43-alt3
3.0: 5.43-alt1

Other repositories
Upstream:5.44.1

Group :: Development/Tcl
RPM: expect

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: expect-5.38-rh-mkpasswd.patch
Download


diff --git a/example/mkpasswd b/example/mkpasswd
index d532d10..b43ccf3 100755
--- a/example/mkpasswd
+++ b/example/mkpasswd
@@ -92,7 +92,12 @@ proc insert {pvar char} {
 }
 
 proc rand {m} {
-    expr {int($m*rand())}
+    set device /dev/urandom		;# /dev/random can block
+    set fileId [open $device r]
+    binary scan [read $fileId 4] i1 number
+    set clipped [expr $number % $m]
+    close $fileId
+    return $clipped
 }
 
 # choose left or right starting hand
@@ -188,6 +193,7 @@ if {[info exists user]} {
 	expect {
 		"assword*:" {
 			# some systems say "Password (again):"
+			sleep .5s
 			send "$password\r"
 			exp_continue
 		}
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin