All of lore.kernel.org
 help / color / mirror / Atom feed
From: agk@sourceware.org
To: dm-cvs@sourceware.org, dm-devel@redhat.com
Subject: device-mapper ./WHATS_NEW dmsetup/dmsetup.c
Date: 19 Oct 2006 15:34:50 -0000	[thread overview]
Message-ID: <20061019153450.20033.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/dm
Module name:	device-mapper
Changes by:	agk@sourceware.org	2006-10-19 15:34:50

Modified files:
	.              : WHATS_NEW 
	dmsetup        : dmsetup.c 

Log message:
	Suppress encryption key in 'dmsetup table' output unless --showkeys supplied.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.132&r2=1.133
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/dmsetup/dmsetup.c.diff?cvsroot=dm&r1=1.73&r2=1.74

--- device-mapper/WHATS_NEW	2006/10/13 19:01:30	1.132
+++ device-mapper/WHATS_NEW	2006/10/19 15:34:49	1.133
@@ -1,5 +1,6 @@
 Version 1.02.13 - 
 =============================
+  Suppress encryption key in 'dmsetup table' output unless --showkeys supplied.
 
 Version 1.02.12 - 13 Oct 2006
 =============================
--- device-mapper/dmsetup/dmsetup.c	2006/10/12 17:09:09	1.73
+++ device-mapper/dmsetup/dmsetup.c	2006/10/19 15:34:50	1.74
@@ -114,6 +114,7 @@
 	NOOPENCOUNT_ARG,
 	NOTABLE_ARG,
 	OPTIONS_ARG,
+	SHOWKEYS_ARG,
 	TABLE_ARG,
 	TARGET_ARG,
 	TREE_ARG,
@@ -211,7 +212,11 @@
 	r = 1;
 
       out:
+#ifndef HAVE_GETLINE
 	dm_free(buffer);
+#else
+	free(buffer);
+#endif
 	if (file)
 		fclose(fp);
 	return r;
@@ -915,7 +920,7 @@
 	void *next = NULL;
 	uint64_t start, length;
 	char *target_type = NULL;
-	char *params;
+	char *params, *c;
 	int cmd;
 	struct dm_names *names = (struct dm_names *) data;
 	const char *name = NULL;
@@ -978,6 +983,17 @@
 			if (data && !_switches[VERBOSE_ARG])
 				printf("%s: ", name);
 			if (target_type) {
+
+			/* Suppress encryption key */
+			if (!_switches[SHOWKEYS_ARG] &&
+			    !strcmp(target_type, "crypt")) {
+				c = params;
+				while (*c && *c != ' ')
+					c++;
+				c++;
+				while (*c && *c != ' ')
+					*c++ = '0';
+			}
 				printf("%" PRIu64 " %" PRIu64 " %s %s",
 				       start, length, target_type, params);
 			}
@@ -1522,7 +1538,7 @@
 	{"info", "[<device>]", 0, 1, _info},
 	{"deps", "[<device>]", 0, 1, _deps},
 	{"status", "[<device>] [--target <target_type>]", 0, 1, _status},
-	{"table", "[<device>] [--target <target_type>]", 0, 1, _status},
+	{"table", "[<device>] [--target <target_type>] [--showkeys]", 0, 1, _status},
 	{"wait", "<device> [<event_nr>]", 0, 2, _wait},
 	{"mknodes", "[<device>]", 0, 1, _mknodes},
 	{"targets", "", 0, 0, _targets},
@@ -1868,6 +1884,7 @@
 		{"noopencount", 0, &ind, NOOPENCOUNT_ARG},
 		{"notable", 0, &ind, NOTABLE_ARG},
 		{"options", 1, &ind, OPTIONS_ARG},
+		{"showkeys", 0, &ind, SHOWKEYS_ARG},
 		{"table", 1, &ind, TABLE_ARG},
 		{"target", 1, &ind, TARGET_ARG},
 		{"tree", 0, &ind, TREE_ARG},
@@ -1988,6 +2005,8 @@
 			_switches[NOLOCKFS_ARG]++;
 		if ((ind == NOOPENCOUNT_ARG))
 			_switches[NOOPENCOUNT_ARG]++;
+		if ((ind == SHOWKEYS_ARG))
+			_switches[SHOWKEYS_ARG]++;
 		if ((ind == TABLE_ARG)) {
 			_switches[TABLE_ARG]++;
 			_table = optarg;

             reply	other threads:[~2006-10-19 15:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-19 15:34 agk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-01-24 18:09 device-mapper ./WHATS_NEW dmsetup/dmsetup.c agk
2007-01-29 17:45 agk
2007-01-29 18:18 agk
2007-04-27 15:12 agk
2007-06-11 13:20 agk
2007-06-15 18:20 agk
2007-06-19 15:47 agk
2008-04-21 11:59 agk
2008-04-21 13:16 agk
2008-06-06 18:53 agk
2008-06-18 10:19 meyering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061019153450.20033.qmail@sourceware.org \
    --to=agk@sourceware.org \
    --cc=dm-cvs@sourceware.org \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.