Don't continue if the '-C' option (a-la GNUtar; commited in options.c
rev 1.18, but not documented in the man page) caused a failed chdir. Otherwise, one can easily overwrite files. Submitted by: Robert Nagy <robert@openbsd.org> Obtained from: OpenBSD
This commit is contained in:
parent
b9baf21492
commit
8714fd098c
@ -154,8 +154,10 @@ ar_open(const char *name)
|
||||
return(-1);
|
||||
|
||||
if (chdname != NULL)
|
||||
if (chdir(chdname) != 0)
|
||||
if (chdir(chdname) != 0) {
|
||||
syswarn(1, errno, "Failed chdir to %s", chdname);
|
||||
return(-1);
|
||||
}
|
||||
/*
|
||||
* set up is based on device type
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user