View | Details | Raw Unified | Return to bug 277601 | Differences between
and this patch

Collapse All | Expand All

(-)libexec/rc/rc.d/random (+10 lines)
Lines 54-63 random_start() Link Here
54
54
55
	echo -n 'Feeding entropy: '
55
	echo -n 'Feeding entropy: '
56
56
57
	checkyesno root_rw_mount || mount -uw /
57
	if [ ! -w /dev/random ] ; then
58
	if [ ! -w /dev/random ] ; then
58
		warn "/dev/random is not writeable"
59
		warn "/dev/random is not writeable"
59
		return 1
60
		return 1
60
	fi
61
	fi
62
	checkyesno root_rw_mount || mount -ur /
61
63
62
	# Reseed /dev/random with previously stored entropy.
64
	# Reseed /dev/random with previously stored entropy.
63
	case ${entropy_dir:=/var/db/entropy} in
65
	case ${entropy_dir:=/var/db/entropy} in
Lines 74-81 random_start() Link Here
74
	[Nn][Oo])
76
	[Nn][Oo])
75
		;;
77
		;;
76
	*)
78
	*)
79
		checkyesno root_rw_mount || mount -uw /
77
		feed_dev_random "${entropy_file}" /var/db/entropy-file
80
		feed_dev_random "${entropy_file}" /var/db/entropy-file
78
		save_dev_random "${entropy_file}"
81
		save_dev_random "${entropy_file}"
82
		checkyesno root_rw_mount || mount -ur /
79
		;;
83
		;;
80
	esac
84
	esac
81
85
Lines 83-89 random_start() Link Here
83
	[Nn][Oo])
87
	[Nn][Oo])
84
		;;
88
		;;
85
	*)
89
	*)
90
		checkyesno root_rw_mount || mount -uw /
86
		save_dev_random "${entropy_boot_file}"
91
		save_dev_random "${entropy_boot_file}"
92
		checkyesno root_rw_mount || mount -ur /
87
		;;
93
		;;
88
	esac
94
	esac
89
95
Lines 100-105 random_stop() Link Here
100
		;;
106
		;;
101
	*)
107
	*)
102
		echo -n 'Writing entropy file: '
108
		echo -n 'Writing entropy file: '
109
		checkyesno root_rw_mount || mount -uw /
103
		rm -f ${entropy_file} 2> /dev/null
110
		rm -f ${entropy_file} 2> /dev/null
104
		oumask=`umask`
111
		oumask=`umask`
105
		umask 077
112
		umask 077
Lines 123-128 random_stop() Link Here
123
			;;
130
			;;
124
		esac
131
		esac
125
		umask ${oumask}
132
		umask ${oumask}
133
		checkyesno root_rw_mount || mount -ur /
126
		;;
134
		;;
127
	esac
135
	esac
128
	case ${entropy_boot_file:=/boot/entropy} in
136
	case ${entropy_boot_file:=/boot/entropy} in
Lines 130-135 random_stop() Link Here
130
		;;
138
		;;
131
	*)
139
	*)
132
		echo -n 'Writing early boot entropy file: '
140
		echo -n 'Writing early boot entropy file: '
141
		checkyesno root_rw_mount || mount -uw /
133
		rm -f ${entropy_boot_file} 2> /dev/null
142
		rm -f ${entropy_boot_file} 2> /dev/null
134
		oumask=`umask`
143
		oumask=`umask`
135
		umask 077
144
		umask 077
Lines 146-151 random_stop() Link Here
146
			;;
155
			;;
147
		esac
156
		esac
148
		umask ${oumask}
157
		umask ${oumask}
158
		checkyesno root_rw_mount || mount -ur /
149
		;;
159
		;;
150
	esac
160
	esac
151
}
161
}

Return to bug 277601