mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Suppress encryption key in 'dmsetup table' output unless --showkeys supplied.
This commit is contained in:
parent
b16b9c2bf1
commit
475be6ab45
@ -1,5 +1,6 @@
|
|||||||
Version 1.02.13 -
|
Version 1.02.13 -
|
||||||
=============================
|
=============================
|
||||||
|
Suppress encryption key in 'dmsetup table' output unless --showkeys supplied.
|
||||||
|
|
||||||
Version 1.02.12 - 13 Oct 2006
|
Version 1.02.12 - 13 Oct 2006
|
||||||
=============================
|
=============================
|
||||||
|
@ -114,6 +114,7 @@ enum {
|
|||||||
NOOPENCOUNT_ARG,
|
NOOPENCOUNT_ARG,
|
||||||
NOTABLE_ARG,
|
NOTABLE_ARG,
|
||||||
OPTIONS_ARG,
|
OPTIONS_ARG,
|
||||||
|
SHOWKEYS_ARG,
|
||||||
TABLE_ARG,
|
TABLE_ARG,
|
||||||
TARGET_ARG,
|
TARGET_ARG,
|
||||||
TREE_ARG,
|
TREE_ARG,
|
||||||
@ -211,7 +212,11 @@ static int _parse_file(struct dm_task *dmt, const char *file)
|
|||||||
r = 1;
|
r = 1;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
#ifndef HAVE_GETLINE
|
||||||
dm_free(buffer);
|
dm_free(buffer);
|
||||||
|
#else
|
||||||
|
free(buffer);
|
||||||
|
#endif
|
||||||
if (file)
|
if (file)
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return r;
|
return r;
|
||||||
@ -915,7 +920,7 @@ static int _status(int argc, char **argv, void *data)
|
|||||||
void *next = NULL;
|
void *next = NULL;
|
||||||
uint64_t start, length;
|
uint64_t start, length;
|
||||||
char *target_type = NULL;
|
char *target_type = NULL;
|
||||||
char *params;
|
char *params, *c;
|
||||||
int cmd;
|
int cmd;
|
||||||
struct dm_names *names = (struct dm_names *) data;
|
struct dm_names *names = (struct dm_names *) data;
|
||||||
const char *name = NULL;
|
const char *name = NULL;
|
||||||
@ -978,6 +983,17 @@ static int _status(int argc, char **argv, void *data)
|
|||||||
if (data && !_switches[VERBOSE_ARG])
|
if (data && !_switches[VERBOSE_ARG])
|
||||||
printf("%s: ", name);
|
printf("%s: ", name);
|
||||||
if (target_type) {
|
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",
|
printf("%" PRIu64 " %" PRIu64 " %s %s",
|
||||||
start, length, target_type, params);
|
start, length, target_type, params);
|
||||||
}
|
}
|
||||||
@ -1522,7 +1538,7 @@ static struct command _commands[] = {
|
|||||||
{"info", "[<device>]", 0, 1, _info},
|
{"info", "[<device>]", 0, 1, _info},
|
||||||
{"deps", "[<device>]", 0, 1, _deps},
|
{"deps", "[<device>]", 0, 1, _deps},
|
||||||
{"status", "[<device>] [--target <target_type>]", 0, 1, _status},
|
{"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},
|
{"wait", "<device> [<event_nr>]", 0, 2, _wait},
|
||||||
{"mknodes", "[<device>]", 0, 1, _mknodes},
|
{"mknodes", "[<device>]", 0, 1, _mknodes},
|
||||||
{"targets", "", 0, 0, _targets},
|
{"targets", "", 0, 0, _targets},
|
||||||
@ -1868,6 +1884,7 @@ static int _process_switches(int *argc, char ***argv)
|
|||||||
{"noopencount", 0, &ind, NOOPENCOUNT_ARG},
|
{"noopencount", 0, &ind, NOOPENCOUNT_ARG},
|
||||||
{"notable", 0, &ind, NOTABLE_ARG},
|
{"notable", 0, &ind, NOTABLE_ARG},
|
||||||
{"options", 1, &ind, OPTIONS_ARG},
|
{"options", 1, &ind, OPTIONS_ARG},
|
||||||
|
{"showkeys", 0, &ind, SHOWKEYS_ARG},
|
||||||
{"table", 1, &ind, TABLE_ARG},
|
{"table", 1, &ind, TABLE_ARG},
|
||||||
{"target", 1, &ind, TARGET_ARG},
|
{"target", 1, &ind, TARGET_ARG},
|
||||||
{"tree", 0, &ind, TREE_ARG},
|
{"tree", 0, &ind, TREE_ARG},
|
||||||
@ -1988,6 +2005,8 @@ static int _process_switches(int *argc, char ***argv)
|
|||||||
_switches[NOLOCKFS_ARG]++;
|
_switches[NOLOCKFS_ARG]++;
|
||||||
if ((ind == NOOPENCOUNT_ARG))
|
if ((ind == NOOPENCOUNT_ARG))
|
||||||
_switches[NOOPENCOUNT_ARG]++;
|
_switches[NOOPENCOUNT_ARG]++;
|
||||||
|
if ((ind == SHOWKEYS_ARG))
|
||||||
|
_switches[SHOWKEYS_ARG]++;
|
||||||
if ((ind == TABLE_ARG)) {
|
if ((ind == TABLE_ARG)) {
|
||||||
_switches[TABLE_ARG]++;
|
_switches[TABLE_ARG]++;
|
||||||
_table = optarg;
|
_table = optarg;
|
||||||
|
Loading…
Reference in New Issue
Block a user