File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -418,12 +418,11 @@ fn collect_xattrs(etc_fd: &CapStdDir, rel_path: impl AsRef<Path>) -> anyhow::Res
418418}
419419
420420#[ context( "Copying xattrs" ) ]
421- fn copy_xattrs ( xattrs : & Xattrs , new_etc_fd : & CapStdDir , file : & PathBuf ) -> anyhow:: Result < ( ) > {
421+ fn copy_xattrs ( xattrs : & Xattrs , new_etc_fd : & CapStdDir , path : & Path ) -> anyhow:: Result < ( ) > {
422422 for ( attr, value) in xattrs. borrow ( ) . iter ( ) {
423- let path = Path :: new ( & format ! ( "/proc/self/fd/{}" , new_etc_fd. as_raw_fd( ) ) ) . join ( file) ;
424-
425- lsetxattr ( path, attr. as_ref ( ) , value, XattrFlags :: empty ( ) )
426- . context ( format ! ( "setxattr for {file:?}" ) ) ?;
423+ let fdpath = & Path :: new ( & format ! ( "/proc/self/fd/{}" , new_etc_fd. as_raw_fd( ) ) ) . join ( path) ;
424+ lsetxattr ( fdpath, attr. as_ref ( ) , value, XattrFlags :: empty ( ) )
425+ . with_context ( || format ! ( "setxattr {attr:?} for {fdpath:?}" ) ) ?;
427426 }
428427
429428 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments