From 93036c852d957ae3587e691920a61e1c026cea1d Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Fri, 29 Sep 2023 16:46:14 -0500 Subject: [PATCH] fs: Still print fid for 'getfid' if GetCell fails Currently, 'fs getfid' fails if we cannot get the cell for the given file via GetCell(). This GetCell call was added in commit d390df097c (fs getfid output changed for consistency with Windows implementation) to be more similar to the WINNT 'fs getfid', but the WINNT 'fs getfid' still prints the fid if getting the cell fails (and has since it was introduced in commit 5520747790 (windows-fs-getfid-20090511)). GetCell() shouldn't normally fail if getting the fid succeeded, but in case it does, don't prevent us from printing the fid. Change 'fs getfid' to just say the cell is "unknown-cell" and keep going. Change-Id: Idd4727304061e1ec4eeddd98bd9eaab5de96e2b6 Reviewed-on: https://gerrit.openafs.org/15585 Reviewed-by: Andrew Deason Tested-by: BuildBot --- src/venus/fs.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/venus/fs.c b/src/venus/fs.c index d4a512fd41..68a655005d 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -4294,12 +4294,7 @@ GetFidCmd(struct cmd_syndesc *as, void *arock) code = GetCell(ti->data, cell); } if (code) { - if (errno == ENOENT) - fprintf(stderr, "%s: no such cell as '%s'\n", pn, ti->data); - else - Die(errno, ti->data); - error = 1; - goto next_item; + strlcpy(cell, "unknown-cell", sizeof(cell)); } printf("File %s (%u.%u.%u) located in cell %s\n",