Skip to contentSkip to conversation

tools/xenstored: Wire properly the command line option -M/--path-max

PATCH In review Julien Grall 3 participants 4 messages Apr 21, 2021 – Apr 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/xenstored: Wire properly the command line option -M/--path-max

From: Julien Grall <[email protected]>

The command line option -M/--path-max was meant to be added by commit 924bf8c793cb "tools/xenstore: rework path length check" but this wasn't wired through properly.

Fix it by adding the missing "case 'M':".

Fixes 924bf8c793cb ("tools/xenstore: rework path length check")
---
 tools/xenstore/xenstored_core.c | 1 +
 1 file changed, 1 insertion(+)
tools/xenstore/xenstored_core.c +1 -0
index 591b28e4552f..c638e46221eb 100644
@@ -2148,6 +2148,7 @@ int main(int argc, char *argv[])
 		case 'A':
 			quota_nb_perms_per_node = strtol(optarg, NULL, 10);
 			break;
+		case 'M':
 			quota_max_path_len = strtol(optarg, NULL, 10);
 			quota_max_path_len = min(XENSTORE_REL_PATH_MAX,
 						 quota_max_path_len);
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 30 lines · Julien Grall

From: Julien Grall <[email protected]>

The command line option -M/--path-max was meant to be added by commit 924bf8c793cb "tools/xenstore: rework path length check" but this wasn't wired through properly.

Fix it by adding the missing "case 'M':".

Fixes 924bf8c793cb ("tools/xenstore: rework path length check")

---
tools/xenstore/xenstored_core.c | 1 +

1 file changed, 1 insertion(+)
tools/xenstore/xenstored_core.c +1 -0
index 591b28e4552f..c638e46221eb 100644
@@ -2148,6 +2148,7 @@ int main(int argc, char *argv[])
 		case 'A':
 			quota_nb_perms_per_node = strtol(optarg, NULL, 10);
 			break;
+		case 'M':
 			quota_max_path_len = strtol(optarg, NULL, 10);
 			quota_max_path_len = min(XENSTORE_REL_PATH_MAX,
 						 quota_max_path_len);
Quoted 4 lines

—
2.17.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Julien Grall
Quoted 10 lines · Julien Grall

From: Julien Grall <[email protected]>

The command line option -M/--path-max was meant to be added by commit 924bf8c793cb "tools/xenstore: rework path length check" but this wasn't wired through properly.

Fix it by adding the missing "case 'M':".

Fixes 924bf8c793cb ("tools/xenstore: rework path length check")

I wonder why no compiler cared about the obviously dead coding.

Juergen

#3 lore raw

Hi Juergen,

Quoted 7 lines · Juergen Gross
Quoted 6 lines · Julien Grall

From: Julien Grall <[email protected]>

The command line option -M/--path-max was meant to be added by commit 924bf8c793cb "tools/xenstore: rework path length check" but this wasn't wired through properly.

Quoted 6 lines
Quoted 4 lines

Fix it by adding the missing "case 'M':".

Fixes 924bf8c793cb ("tools/xenstore: rework path length check")

Thanks! I have committed it.

Quoted 1 line

I wonder why no compiler cared about the obviously dead coding.

Coverity actually spotted it (see CID-1470790) back in December 2020. Although, I wasn't aware of it because I just check coverity now.

Cheers,

Signature · 1 line
Julien Grall