mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-28 00:04:16 +02:00
Fix for too short IDs due to hexdump output missing leading or trailing zeroes
This commit is contained in:
parent
7b6624f85d
commit
6eae35e564
@ -51,8 +51,10 @@ if [ $# -gt 0 ]; then
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# xxd does not exist on FreeBSD
|
# xxd does not exist on FreeBSD
|
||||||
HOSTID=$(head -c20 < /dev/urandom | hexdump -ve '"%.2x"')
|
# Note: hexdump may omit leading or trailing zeroes.
|
||||||
HOSTID2=$(head -c32 < /dev/urandom | hexdump -ve '"%.2x"')
|
# Take 100 characters as input, turn to hex, then take first 40/64.
|
||||||
|
HOSTID=$(head -c100 < /dev/urandom | hexdump -ve '"%.2x"' | head -c40)
|
||||||
|
HOSTID2=$(head -c100 < /dev/urandom | hexdump -ve '"%.2x"' | head -c64)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user