Skip to content

Commit aa7c5e5

Browse files
committed
feat: Adding a couple more cases for returning insecure path for NVMe identify
Adding a couple more places where insecure path can be returned in openSeaChest_NVMe for reading identify data. Signed-off-by: Tyler Erickson <[email protected]>
1 parent 8f97382 commit aa7c5e5

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

utils/C/openSeaChest/openSeaChest_NVMe.c

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,18 +1197,29 @@ int main(int argc, char* argv[])
11971197
{
11981198
printf("ERROR: failed to open file to write namespace identify information\n");
11991199
}
1200-
exitCode = UTIL_EXIT_OPERATION_FAILURE;
1200+
exitCode = UTIL_EXIT_CANNOT_OPEN_FILE;
12011201
}
12021202
}
12031203
free_Secure_File_Info(&secureFile);
12041204
}
12051205
else
12061206
{
1207-
if (VERBOSITY_QUIET < toolVerbosity)
1207+
if (secureFile->error == SEC_FILE_INSECURE_PATH)
12081208
{
1209-
printf("ERROR: failed to open file to write controller information\n");
1209+
if (VERBOSITY_QUIET < toolVerbosity)
1210+
{
1211+
print_Insecure_Path_Utility_Message();
1212+
}
1213+
exitCode = UTIL_EXIT_INSECURE_PATH;
1214+
}
1215+
else
1216+
{
1217+
if (VERBOSITY_QUIET < toolVerbosity)
1218+
{
1219+
printf("ERROR: failed to open file to write controller identify information\n");
1220+
}
1221+
exitCode = UTIL_EXIT_CANNOT_OPEN_FILE;
12101222
}
1211-
exitCode = UTIL_EXIT_OPERATION_FAILURE;
12121223
}
12131224
free_Secure_File_Info(&secureFile);
12141225
}
@@ -1398,11 +1409,22 @@ int main(int argc, char* argv[])
13981409
}
13991410
else
14001411
{
1401-
if (VERBOSITY_QUIET < toolVerbosity)
1412+
if (secureFile->error == SEC_FILE_INSECURE_PATH)
1413+
{
1414+
if (VERBOSITY_QUIET < toolVerbosity)
1415+
{
1416+
print_Insecure_Path_Utility_Message();
1417+
}
1418+
exitCode = UTIL_EXIT_INSECURE_PATH;
1419+
}
1420+
else
14021421
{
1403-
printf("ERROR: failed to open file to write Log Page Information\n");
1422+
if (VERBOSITY_QUIET < toolVerbosity)
1423+
{
1424+
printf("ERROR: failed to open file to write Log Page Information\n");
1425+
}
1426+
exitCode = UTIL_EXIT_CANNOT_OPEN_FILE;
14041427
}
1405-
exitCode = UTIL_EXIT_OPERATION_FAILURE;
14061428
}
14071429
free_Secure_File_Info(&secureFile);
14081430
}

0 commit comments

Comments
 (0)