From a872d3c73b53b932dc0c378941ea18bad07cba58 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 12 Nov 2002 20:26:52 +0000 Subject: [PATCH] When setting the mountpoint name, remember any previous setting of the newfs flag for this partition. PR: bin/31837 Reported by: Oliver Breuninger --- usr.sbin/sade/label.c | 9 +++++++-- usr.sbin/sysinstall/label.c | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c index 247c5332edb4..9e1f5f74beb5 100644 --- a/usr.sbin/sade/label.c +++ b/usr.sbin/sade/label.c @@ -344,6 +344,7 @@ get_mountpoint(struct chunk *old) { char *val; PartInfo *tmp; + Boolean newfs; if (old && old->private_data) tmp = old->private_data; @@ -384,9 +385,13 @@ get_mountpoint(struct chunk *old) else if (old) old->flags &= ~CHUNK_IS_ROOT; - safe_free(tmp); + newfs = FALSE; + if (tmp) { + newfs = tmp->newfs; + safe_free(tmp); + } val = string_skipwhite(string_prune(val)); - tmp = new_part(val, TRUE, 0); + tmp = new_part(val, newfs, 0); if (old) { old->private_data = tmp; old->private_free = safe_free; diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c index 247c5332edb4..9e1f5f74beb5 100644 --- a/usr.sbin/sysinstall/label.c +++ b/usr.sbin/sysinstall/label.c @@ -344,6 +344,7 @@ get_mountpoint(struct chunk *old) { char *val; PartInfo *tmp; + Boolean newfs; if (old && old->private_data) tmp = old->private_data; @@ -384,9 +385,13 @@ get_mountpoint(struct chunk *old) else if (old) old->flags &= ~CHUNK_IS_ROOT; - safe_free(tmp); + newfs = FALSE; + if (tmp) { + newfs = tmp->newfs; + safe_free(tmp); + } val = string_skipwhite(string_prune(val)); - tmp = new_part(val, TRUE, 0); + tmp = new_part(val, newfs, 0); if (old) { old->private_data = tmp; old->private_free = safe_free;