mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 15:00:12 +00:00
vos: Avoid dumping volume to tty
Add a check to avoid dumping a volume to the user's terminal when an output file is not specified and the user forgets to pipe or redirect stdout. Change-Id: Ifdef6550d37981497ac2e8cb596993c2ed2e58f2 Reviewed-on: https://gerrit.openafs.org/14778 Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net>
This commit is contained in:
parent
96f1209ea7
commit
55f27294a3
@ -2996,6 +2996,11 @@ DumpVolumeCmd(struct cmd_syndesc *as, void *arock)
|
||||
if (as->parms[2].items) {
|
||||
filename = as->parms[2].items->data;
|
||||
} else {
|
||||
if (isatty(STDOUT_FILENO)) {
|
||||
fprintf(STDERR, "Refusing to dump volume to a tty. Either redirect "
|
||||
"stdout, or specify a path with -file.\n");
|
||||
exit(1);
|
||||
}
|
||||
filename = "";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user