catar/encoder.rs: use O_DIRECTORY to open dirs

This commit is contained in:
Dietmar Maurer 2019-01-11 16:53:17 +01:00
parent 490683ec93
commit dce0ebd505
1 changed files with 1 additions and 1 deletions

View File

@ -284,7 +284,7 @@ impl <'a, W: Write> CaTarEncoder<'a, W> {
if ifmt == libc::S_IFDIR { if ifmt == libc::S_IFDIR {
match nix::dir::Dir::openat(rawfd, filename.as_ref(), OFlag::O_NOFOLLOW, Mode::empty()) { match nix::dir::Dir::openat(rawfd, filename.as_ref(), OFlag::O_DIRECTORY|OFlag::O_NOFOLLOW, Mode::empty()) {
Ok(mut dir) => self.encode_dir(&mut dir, &stat)?, Ok(mut dir) => self.encode_dir(&mut dir, &stat)?,
Err(nix::Error::Sys(Errno::ENOENT)) => self.report_vanished_file(&self.current_path)?, Err(nix::Error::Sys(Errno::ENOENT)) => self.report_vanished_file(&self.current_path)?,
Err(err) => bail!("open dir {:?} failed - {}", self.current_path, err), Err(err) => bail!("open dir {:?} failed - {}", self.current_path, err),