lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat,  7 Nov 2009 07:45:40 +0100
From:	Bernhard Kaindl <bernhard.kaindl@....net>
To:	linux-kernel@...r.kernel.org
Cc:	Bernhard Kaindl <bernhard.kaindl@....net>,
	linux-kbuild@...r.kernel.org
Subject: [PATCH 4/4] make config / oldconfig: allow editing of remarks for config symbols

In conf_sym(), which is used for ask for all bool/tristate symbols,
print sym->remark (if one exists) befor prompting for the option and
analogous to help (triggered by an input beginning with '?'), when the
user enters a line starting with '<', allow the user to enter a remark
or update it.

This extension does not cover the configuration of string, integer or
choice values. I leave this open for follow-up submission in case there
is interest in the config symbol remarks in general and in really
supporting these also fully in make config, oldconfig and (possibly)
silbings.

Signed-off-by: Bernhard Kaindl <bernhard.kaindl@....net>

PS:
make gconfig could also be considered for extension, but it does
apparently does not have a great deal of string editing UI yet,
so adding remarks to it would require finding a way to edit string
symbols in it first.
---
 scripts/kconfig/conf.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 9960d1c..dc60a1d 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -158,8 +158,11 @@ static int conf_sym(struct menu *menu)
 	struct symbol *sym = menu->sym;
 	int type;
 	tristate oldval, newval;
+	char *p;
 
 	while (1) {
+		if (sym->remark)
+			printf("Remark: %s\n", sym->remark);
 		printf("%*s%s ", indent - 1, "", _(menu->prompt->text));
 		if (sym->name)
 			printf("(%s) ", sym->name);
@@ -214,6 +217,8 @@ static int conf_sym(struct menu *menu)
 			break;
 		case '?':
 			goto help;
+		case '<':
+			goto remark;
 		default:
 			continue;
 		}
@@ -221,6 +226,20 @@ static int conf_sym(struct menu *menu)
 			return 0;
 help:
 		print_help(menu);
+		continue;
+remark:
+		if (sym->remark)
+			printf("Current Remark: %s\n", sym->remark);
+		printf("    New remark: ");
+		fgets(line, sizeof(line), stdin);
+
+		if ((p = strchr(line, '\n')))
+			*p = '\0';            /* no \n in remark */
+		if (line[0]) {
+			if (sym->remark)
+				free(sym->remark);
+			sym->remark = strdup(line);
+		}
 	}
 }
 
-- 
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ