linux|freebsd)
hash=$("@scriptsdir@/snf-passtohash.py" "$password")
;;
- openbsd|netbsd)
+ openbsd)
hash=$("@scriptsdir@/snf-passtohash.py" -m blowfish "$password")
;;
+ netbsd)
+ hash=$("@scriptsdir@/snf-passtohash.py" -m sha1 "$password")
+ ;;
*)
log_error "Unknown unix flavor: \`$flavor'"
;;
unix_password "$SNF_IMAGE_PROPERTY_OSFAMILY" "$SNF_IMAGE_TARGET" "$SNF_IMAGE_PASSWORD"
fi
-# For FreeBSD, OpenBSD and NetBSD we need to recreate the password database too
+# For FreeBSD, OpenBSD and NetBSD we need to recreate the password databases too
if [[ "$SNF_IMAGE_PROPERTY_OSFAMILY" == *bsd ]]; then
rm -f "$SNF_IMAGE_TARGET/etc/spwd.db"
+ # NetBSD is very strict about the existence & non-existence of the db files
+ if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" = "netbsd" ]; then
+ rm -f "$SNF_IMAGE_TARGET/etc/pwd.db.tmp"
+ rm -f "$SNF_IMAGE_TARGET/etc/spwd.db.tmp"
+
+ touch "$SNF_IMAGE_TARGET/etc/spwd.db"
+ fi
+
+
# Make sure /etc/spwd.db is recreated on first boot
rc_local=$(cat <<EOF
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin