svn commit: r217257 - user/nwhitehorn/bsdinstall/partedit
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Tue Jan 11 05:22:32 UTC 2011
Author: nwhitehorn
Date: Tue Jan 11 05:22:31 2011
New Revision: 217257
URL: http://svn.freebsd.org/changeset/base/217257
Log:
More anti-foot-shooting measures: gpart labels do not like to contain
slashes, so provide a more helpful error message if the user tries
to set one with a slash in it.
Submitted by: joel
Modified:
user/nwhitehorn/bsdinstall/partedit/gpart_ops.c
Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c
==============================================================================
--- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Tue Jan 11 04:25:54 2011 (r217256)
+++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Tue Jan 11 05:22:31 2011 (r217257)
@@ -400,6 +400,13 @@ editpart:
if (choice) /* Cancel pressed */
return;
+ /* Check if the label has a / in it */
+ if (strchr(items[3].text, '/') != NULL) {
+ dialog_msgbox("Error", "Label contains a /, which is not an "
+ "allowed character.", 0, 0, TRUE);
+ goto editpart;
+ }
+
if (strncmp(items[0].text, "freebsd-", 8) != 0 &&
items[0].text[0] != '\0') {
char message[512];
@@ -648,6 +655,13 @@ addpartform:
size = MIN((intmax_t)(bytes/sector), maxsize);
}
+ /* Check if the label has a / in it */
+ if (strchr(items[3].text, '/') != NULL) {
+ dialog_msgbox("Error", "Label contains a /, which is not an "
+ "allowed character.", 0, 0, TRUE);
+ goto addpartform;
+ }
+
/* Warn if no mountpoint set */
if (strcmp(items[0].text, "freebsd-ufs") == 0 &&
items[2].text[0] != '/') {
More information about the svn-src-user
mailing list