Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst Do not allow editing of start/size/fs-type ...
details: https://anonhg.NetBSD.org/src/rev/27c5c1b37fa1
branches: trunk
changeset: 379084:27c5c1b37fa1
user: martin <martin%NetBSD.org@localhost>
date: Sun May 09 11:06:20 2021 +0000
description:
Do not allow editing of start/size/fs-type for partitions that
are already carved in stone (e.g. defined in an outer MBR while we are
editing the inner disklabel).
diffstat:
usr.sbin/sysinst/label.c | 23 ++++++++++++++++++++---
1 files changed, 20 insertions(+), 3 deletions(-)
diffs (54 lines):
diff -r e725a17d4112 -r 27c5c1b37fa1 usr.sbin/sysinst/label.c
--- a/usr.sbin/sysinst/label.c Sun May 09 10:39:00 2021 +0000
+++ b/usr.sbin/sysinst/label.c Sun May 09 11:06:20 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: label.c,v 1.32 2021/01/31 22:45:46 rillig Exp $ */
+/* $NetBSD: label.c,v 1.33 2021/05/09 11:06:20 martin Exp $ */
/*
* Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.32 2021/01/31 22:45:46 rillig Exp $");
+__RCSID("$NetBSD: label.c,v 1.33 2021/05/09 11:06:20 martin Exp $");
#endif
#include <sys/types.h>
@@ -1070,9 +1070,23 @@ update_edit_ptn_menu(menudesc *m, void *
edit->pset->parts, edit->id, attr_no))
continue;
}
+ /*
+ * Do not allow editing of size/start/type when partition
+ * is defined in some outer partition table already
+ */
+ if ((edit->pset->infos[edit->index].flags & PUIFLG_IS_OUTER)
+ && (m->opts[i].opt_action == edit_fs_type
+ || m->opts[i].opt_action == edit_fs_start
+ || m->opts[i].opt_action == edit_fs_size))
+ continue;
/* Ok: we want this one */
m->opts[i].opt_flags &= ~OPT_IGNORE;
}
+
+ /* Avoid starting at a (now) disabled menu item */
+ while (m->cursel >= 0 && m->cursel < m->numopts
+ && (m->opts[m->cursel].opt_flags & OPT_IGNORE))
+ m->cursel++;
}
static void
@@ -1123,7 +1137,10 @@ draw_edit_ptn_line(menudesc *m, int opt,
if (m->opts[opt].opt_flags & OPT_IGNORE
&& (opt != 3 || edit->info.fs_type == FS_UNUSED)
- && m->opts[opt].opt_action != edit_ptn_custom_type) {
+ && m->opts[opt].opt_action != edit_ptn_custom_type
+ && m->opts[opt].opt_action != edit_fs_type
+ && m->opts[opt].opt_action != edit_fs_start
+ && m->opts[opt].opt_action != edit_fs_size) {
wprintw(m->mw, "%*s -", col_width, "");
return;
}
Home |
Main Index |
Thread Index |
Old Index