@@ -390,6 +390,10 @@ mod linux {
390390 . resource_claims
391391 . get ( GPU_RESOURCE_CLAIM )
392392 . is_some_and ( |value| value == "true" )
393+ || config
394+ . resource_claims
395+ . get ( "podman.userns" )
396+ . is_some_and ( |value| value == "keep-id" )
393397 }
394398
395399 fn supplementary_groups_match ( actual : & [ u32 ] , expected : & [ u32 ] , allow_extra : bool ) -> bool {
@@ -3824,6 +3828,33 @@ mod linux {
38243828 assert ! ( !supplementary_groups_match( & [ 44 , 992 ] , & [ 1001 ] , true ) ) ;
38253829 }
38263830
3831+ #[ test]
3832+ fn podman_keep_id_allows_runtime_supplementary_groups ( ) {
3833+ let config = BoundaryConfig {
3834+ boundary_id : "sandbox-1" . to_string ( ) ,
3835+ generation : "generation-1" . to_string ( ) ,
3836+ session_id : test_session_id ( ) ,
3837+ session_rotation : openshell_core:: jwt:: SessionRotation :: new ( 1 )
3838+ . expect ( "session rotation" ) ,
3839+ auth_epoch : CredentialEpoch :: new ( 1 ) . expect ( "auth epoch" ) ,
3840+ gateway_id : "test-gateway" . to_string ( ) ,
3841+ verification_keys : vec ! [ ] ,
3842+ listener : BoundaryListenerConfig :: Vsock {
3843+ control_port : 5500 ,
3844+ tls : placeholder_server_tls ( ) ,
3845+ } ,
3846+ resource_claims : std:: collections:: BTreeMap :: from ( [ (
3847+ "podman.userns" . to_string ( ) ,
3848+ "keep-id" . to_string ( ) ,
3849+ ) ] ) ,
3850+ resource_claim_files : std:: collections:: BTreeMap :: new ( ) ,
3851+ workload_identity : test_workload_identity ( ) ,
3852+ driver_fence : test_driver_fence ( ) ,
3853+ child_env : std:: collections:: HashMap :: new ( ) ,
3854+ } ;
3855+ assert ! ( allows_runtime_supplementary_groups( & config) ) ;
3856+ }
3857+
38273858 #[ test]
38283859 fn control_connection_slots_bound_authenticated_sessions ( ) {
38293860 let active = Arc :: new ( AtomicUsize :: new ( MAX_CONTROL_CONNECTIONS - 1 ) ) ;
0 commit comments