@@ -428,23 +428,17 @@ impl ManifestDiff<'_> {
428428
429429/// Apply default configuration for container image pulls to an existing configuration.
430430/// For example, if `authfile` is not set, and `auth_anonymous` is `false`, and a global configuration file exists, it will be used.
431- ///
432- /// If there is no configured explicit subprocess for skopeo, and the process is running
433- /// as root, then a default isolation of running the process via `nobody` will be applied.
434431pub fn merge_default_container_proxy_opts (
435432 config : & mut containers_image_proxy:: ImageProxyConfig ,
436433) -> Result < ( ) > {
437- let user = rustix:: process:: getuid ( )
438- . is_root ( )
439- . then_some ( isolation:: DEFAULT_UNPRIVILEGED_USER ) ;
440- merge_default_container_proxy_opts_with_isolation ( config, user)
434+ merge_default_container_proxy_opts_with_isolation ( config, None )
441435}
442436
443437/// Apply default configuration for container image pulls, with optional support
444438/// for isolation as an unprivileged user.
445439pub fn merge_default_container_proxy_opts_with_isolation (
446440 config : & mut containers_image_proxy:: ImageProxyConfig ,
447- isolation_user : Option < & str > ,
441+ _isolation_user : Option < & str > ,
448442) -> Result < ( ) > {
449443 let auth_specified =
450444 config. auth_anonymous || config. authfile . is_some ( ) || config. auth_data . is_some ( ) ;
@@ -458,22 +452,6 @@ pub fn merge_default_container_proxy_opts_with_isolation(
458452 config. auth_anonymous = true ;
459453 }
460454 }
461- // By default, drop privileges, unless the higher level code
462- // has configured the skopeo command explicitly.
463- let isolation_user = config
464- . skopeo_cmd
465- . is_none ( )
466- . then_some ( isolation_user. as_ref ( ) )
467- . flatten ( ) ;
468- if let Some ( user) = isolation_user {
469- // Read the default authfile if it exists and pass it via file descriptor
470- // which will ensure it's readable when we drop privileges.
471- if let Some ( authfile) = config. authfile . take ( ) {
472- config. auth_data = Some ( std:: fs:: File :: open ( authfile) ?) ;
473- }
474- let cmd = crate :: isolation:: unprivileged_subprocess ( bootc_utils:: skopeo_bin ( ) , user) ;
475- config. skopeo_cmd = Some ( cmd) ;
476- }
477455 Ok ( ( ) )
478456}
479457
@@ -520,8 +498,6 @@ pub mod store;
520498mod update_detachedmeta;
521499pub use update_detachedmeta:: * ;
522500
523- use crate :: isolation;
524-
525501#[ cfg( test) ]
526502mod tests {
527503 use std:: process:: Command ;
0 commit comments