@@ -1243,17 +1243,11 @@ do_mount (libcrun_container_t *container, const char *source, int targetfd,
1243
1243
}
1244
1244
}
1245
1245
1246
- if (mountflags & ALL_PROPAGATIONS )
1246
+ if (mountflags & ALL_PROPAGATIONS_NO_REC )
1247
1247
{
1248
- unsigned long rec = mountflags & MS_REC ;
1249
- unsigned long propagation = mountflags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE );
1250
-
1251
- if (propagation )
1252
- {
1253
- ret = mount (NULL , real_target , NULL , rec | propagation , NULL );
1254
- if (UNLIKELY (ret < 0 ))
1255
- return crun_make_error (err , errno , "set propagation for `%s`" , target );
1256
- }
1248
+ ret = mount (NULL , real_target , NULL , mountflags & ALL_PROPAGATIONS , NULL );
1249
+ if (UNLIKELY (ret < 0 ))
1250
+ return crun_make_error (err , errno , "set propagation for `%s`" , target );
1257
1251
}
1258
1252
1259
1253
if (mountflags & (MS_BIND | MS_RDONLY ))
@@ -2595,7 +2589,7 @@ libcrun_set_mounts (struct container_entrypoint_s *entrypoint_args, libcrun_cont
2595
2589
if (def -> linux -> rootfs_propagation )
2596
2590
rootfs_propagation = get_mount_flags (def -> linux -> rootfs_propagation , 0 , NULL , NULL , NULL , NULL );
2597
2591
2598
- if ((rootfs_propagation & ( MS_SHARED | MS_SLAVE | MS_PRIVATE | MS_UNBINDABLE ) ) == 0 )
2592
+ if ((rootfs_propagation & ALL_PROPAGATIONS_NO_REC ) == 0 )
2599
2593
rootfs_propagation = MS_REC | MS_PRIVATE ;
2600
2594
2601
2595
get_private_data (container )-> rootfs_propagation = rootfs_propagation ;
0 commit comments