From 1fc5576e265f3f00a987231f3adeae17278b033e Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 27 Oct 2025 16:17:08 +0000 Subject: [PATCH] Skip inserting rrootdisk and rootdisk into the database. There are callers to devname(3) who get don't understand that the database isn't covering a 1:1 relationship... ok bluhm robert beck this is a part of 7.8 errata 001 --- usr.sbin/dev_mkdb/dev_mkdb.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/usr.sbin/dev_mkdb/dev_mkdb.c b/usr.sbin/dev_mkdb/dev_mkdb.c index d4afa38701f..2c88933ef1a 100644 --- a/usr.sbin/dev_mkdb/dev_mkdb.c +++ b/usr.sbin/dev_mkdb/dev_mkdb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev_mkdb.c,v 1.20 2023/12/24 06:35:05 gnezdo Exp $ */ +/* $OpenBSD: dev_mkdb.c,v 1.21 2025/10/27 16:17:08 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -112,11 +112,15 @@ main(int argc, char *argv[]) continue; /* Create the key. */ - if (S_ISCHR(dp->fts_statp->st_mode)) + if (S_ISCHR(dp->fts_statp->st_mode)) { + if (strcmp(dp->fts_path, "./rrootdisk") == 0) + continue; bkey.type = S_IFCHR; - else if (S_ISBLK(dp->fts_statp->st_mode)) + } else if (S_ISBLK(dp->fts_statp->st_mode)) { + if (strcmp(dp->fts_path, "./rootdisk") == 0) + continue; bkey.type = S_IFBLK; - else + } else continue; bkey.dev = dp->fts_statp->st_rdev;