@@ -334,7 +334,7 @@ pub(crate) struct SourceInfo {
334
334
/// The digest to use for pulls
335
335
pub ( crate ) digest : Option < String > ,
336
336
/// Whether or not SELinux appears to be enabled in the source commit
337
- pub ( crate ) selinux : bool ,
337
+ pub ( crate ) _selinux : bool ,
338
338
/// Whether the source is available in the host mount namespace
339
339
pub ( crate ) in_host_mountns : bool ,
340
340
}
@@ -585,7 +585,7 @@ impl SourceInfo {
585
585
Ok ( Self {
586
586
imageref,
587
587
digest,
588
- selinux,
588
+ _selinux : selinux,
589
589
in_host_mountns,
590
590
} )
591
591
}
@@ -946,7 +946,7 @@ pub(crate) fn reexecute_self_for_selinux_if_needed(
946
946
override_disable_selinux : bool ,
947
947
) -> Result < SELinuxFinalState > {
948
948
// If the target state has SELinux enabled, we need to check the host state.
949
- if srcdata . selinux {
949
+ if false {
950
950
let host_selinux = crate :: lsm:: selinux_enabled ( ) ?;
951
951
tracing:: debug!( "Target has SELinux, host={host_selinux}" ) ;
952
952
let r = if override_disable_selinux {
@@ -1031,66 +1031,6 @@ fn ensure_var() -> Result<()> {
1031
1031
Ok ( ( ) )
1032
1032
}
1033
1033
1034
- /// We want to have proper /tmp and /var/tmp without requiring the caller to set them up
1035
- /// in advance by manually specifying them via `podman run -v /tmp:/tmp` etc.
1036
- /// Unfortunately, it's quite complex right now to "gracefully" dynamically reconfigure
1037
- /// the mount setup for a container. See https://brauner.io/2023/02/28/mounting-into-mount-namespaces.html
1038
- /// So the brutal hack we do here is to rely on the fact that we're running in the host
1039
- /// pid namespace, and so the magic link for /proc/1/root will escape our mount namespace.
1040
- /// We can't bind mount though - we need to symlink it so that each calling process
1041
- /// will traverse the link.
1042
- #[ context( "Linking tmp mounts to host" ) ]
1043
- pub ( crate ) fn setup_tmp_mounts ( ) -> Result < ( ) > {
1044
- let st = rustix:: fs:: statfs ( "/tmp" ) ?;
1045
- if st. f_type == libc:: TMPFS_MAGIC {
1046
- tracing:: trace!( "Already have tmpfs /tmp" )
1047
- } else {
1048
- // Note we explicitly also don't want a "nosuid" tmp, because that
1049
- // suppresses our install_t transition
1050
- Task :: new ( "Mounting tmpfs /tmp" , "mount" )
1051
- . args ( [ "tmpfs" , "-t" , "tmpfs" , "/tmp" ] )
1052
- . quiet ( )
1053
- . run ( ) ?;
1054
- }
1055
-
1056
- // Point our /var/tmp at the host, via the /proc/1/root magic link
1057
- for path in [ "/var/tmp" ] . map ( Utf8Path :: new) {
1058
- if path. try_exists ( ) ? {
1059
- let st = rustix:: fs:: statfs ( path. as_std_path ( ) ) . context ( path) ?;
1060
- if st. f_type != libc:: OVERLAYFS_SUPER_MAGIC {
1061
- tracing:: trace!( "Already have {path} with f_type={}" , st. f_type) ;
1062
- continue ;
1063
- }
1064
- }
1065
- let target = format ! ( "/proc/1/root/{path}" ) ;
1066
- let tmp = format ! ( "{path}.tmp" ) ;
1067
- // Ensure idempotence in case we're re-executed
1068
- if path. is_symlink ( ) {
1069
- continue ;
1070
- }
1071
- tracing:: debug!( "Retargeting {path} to host" ) ;
1072
- if path. try_exists ( ) ? {
1073
- std:: os:: unix:: fs:: symlink ( & target, & tmp)
1074
- . with_context ( || format ! ( "Symlinking {target} to {tmp}" ) ) ?;
1075
- let cwd = rustix:: fs:: CWD ;
1076
- rustix:: fs:: renameat_with (
1077
- cwd,
1078
- path. as_os_str ( ) ,
1079
- cwd,
1080
- & tmp,
1081
- rustix:: fs:: RenameFlags :: EXCHANGE ,
1082
- )
1083
- . with_context ( || format ! ( "Exchanging {path} <=> {tmp}" ) ) ?;
1084
- std:: fs:: rename ( & tmp, format ! ( "{path}.old" ) )
1085
- . with_context ( || format ! ( "Renaming old {tmp}" ) ) ?;
1086
- } else {
1087
- std:: os:: unix:: fs:: symlink ( & target, path)
1088
- . with_context ( || format ! ( "Symlinking {target} to {path}" ) ) ?;
1089
- } ;
1090
- }
1091
- Ok ( ( ) )
1092
- }
1093
-
1094
1034
/// By default, podman/docker etc. when passed `--privileged` mount `/sys` as read-only,
1095
1035
/// but non-recursively. We selectively grab sub-filesystems that we need.
1096
1036
#[ context( "Ensuring sys mount {fspath} {fstype}" ) ]
@@ -1222,7 +1162,7 @@ async fn prepare_install(
1222
1162
crate :: mount:: ensure_mirrored_host_mount ( "/dev" ) ?;
1223
1163
crate :: mount:: ensure_mirrored_host_mount ( "/var/lib/containers" ) ?;
1224
1164
ensure_var ( ) ?;
1225
- setup_tmp_mounts ( ) ?;
1165
+ // setup_tmp_mounts()?;
1226
1166
// Allocate a temporary directory we can use in various places to avoid
1227
1167
// creating multiple.
1228
1168
let tempdir = cap_std_ext:: cap_tempfile:: TempDir :: new ( cap_std:: ambient_authority ( ) ) ?;
0 commit comments