@@ -184,16 +184,16 @@ install_into_boot (OstreeRepo *repo, OstreeSePolicy *sepolicy, int src_dfd, cons
184
184
/* Copy ownership, mode, and xattrs from source directory to destination */
185
185
static gboolean
186
186
dirfd_copy_attributes_and_xattrs (int src_parent_dfd , const char * src_name , int src_dfd ,
187
- int dest_dfd , OstreeSysrootDebugFlags flags ,
188
- GCancellable * cancellable , GError * * error )
187
+ int dest_dfd , GLnxFileCopyFlags flags , GCancellable * cancellable ,
188
+ GError * * error )
189
189
{
190
190
g_autoptr (GVariant ) xattrs = NULL ;
191
191
192
192
/* Clone all xattrs first, so we get the SELinux security context
193
193
* right. This will allow other users access if they have ACLs, but
194
194
* oh well.
195
195
*/
196
- if (!(flags & OSTREE_SYSROOT_DEBUG_NO_XATTRS ))
196
+ if (!(flags & GLNX_FILE_COPY_NOXATTRS ))
197
197
{
198
198
if (!glnx_dfd_name_get_all_xattrs (src_parent_dfd , src_name , & xattrs , cancellable , error ))
199
199
return FALSE;
@@ -284,7 +284,7 @@ checksum_dir_recurse (int dfd, const char *path, OtChecksum *checksum, GCancella
284
284
285
285
static gboolean
286
286
copy_dir_recurse (int src_parent_dfd , int dest_parent_dfd , const char * name ,
287
- OstreeSysrootDebugFlags flags , GCancellable * cancellable , GError * * error )
287
+ GLnxFileCopyFlags copy_flags , GCancellable * cancellable , GError * * error )
288
288
{
289
289
g_auto (GLnxDirFdIterator ) src_dfd_iter = {
290
290
0 ,
@@ -302,8 +302,8 @@ copy_dir_recurse (int src_parent_dfd, int dest_parent_dfd, const char *name,
302
302
if (!glnx_opendirat (dest_parent_dfd , name , TRUE, & dest_dfd , error ))
303
303
return FALSE;
304
304
305
- if (!dirfd_copy_attributes_and_xattrs (src_parent_dfd , name , src_dfd_iter .fd , dest_dfd , flags ,
306
- cancellable , error ))
305
+ if (!dirfd_copy_attributes_and_xattrs (src_parent_dfd , name , src_dfd_iter .fd , dest_dfd ,
306
+ copy_flags , cancellable , error ))
307
307
return glnx_prefix_error (error , "Copying attributes of %s" , name );
308
308
309
309
while (TRUE)
@@ -320,7 +320,7 @@ copy_dir_recurse (int src_parent_dfd, int dest_parent_dfd, const char *name,
320
320
321
321
if (S_ISDIR (child_stbuf .st_mode ))
322
322
{
323
- if (!copy_dir_recurse (src_dfd_iter .fd , dest_dfd , dent -> d_name , flags , cancellable ,
323
+ if (!copy_dir_recurse (src_dfd_iter .fd , dest_dfd , dent -> d_name , copy_flags , cancellable ,
324
324
error ))
325
325
return FALSE;
326
326
}
@@ -329,8 +329,7 @@ copy_dir_recurse (int src_parent_dfd, int dest_parent_dfd, const char *name,
329
329
if (S_ISLNK (child_stbuf .st_mode ) || S_ISREG (child_stbuf .st_mode ))
330
330
{
331
331
if (!glnx_file_copy_at (src_dfd_iter .fd , dent -> d_name , & child_stbuf , dest_dfd ,
332
- dent -> d_name ,
333
- sysroot_flags_to_copy_flags (GLNX_FILE_COPY_OVERWRITE , flags ),
332
+ dent -> d_name , GLNX_FILE_COPY_OVERWRITE | copy_flags ,
334
333
cancellable , error ))
335
334
return glnx_prefix_error (error , "Copying %s" , dent -> d_name );
336
335
}
@@ -468,7 +467,8 @@ copy_modified_config_file (int orig_etc_fd, int modified_etc_fd, int new_etc_fd,
468
467
469
468
if (S_ISDIR (modified_stbuf .st_mode ))
470
469
{
471
- if (!copy_dir_recurse (modified_etc_fd , new_etc_fd , path , flags , cancellable , error ))
470
+ GLnxFileCopyFlags copy_flags = sysroot_flags_to_copy_flags (0 , flags );
471
+ if (!copy_dir_recurse (modified_etc_fd , new_etc_fd , path , copy_flags , cancellable , error ))
472
472
return FALSE;
473
473
}
474
474
else if (S_ISLNK (modified_stbuf .st_mode ) || S_ISREG (modified_stbuf .st_mode ))
@@ -1900,8 +1900,10 @@ install_deployment_kernel (OstreeSysroot *sysroot, int new_bootversion,
1900
1900
}
1901
1901
else
1902
1902
{
1903
+ // Don't copy xattrs for devicetree; Fedora derives label them modules_t which is
1904
+ // wrong for when they're installed, we want the default boot_t.
1903
1905
if (!copy_dir_recurse (kernel_layout -> boot_dfd , bootcsum_dfd ,
1904
- kernel_layout -> devicetree_srcpath , sysroot -> debug_flags ,
1906
+ kernel_layout -> devicetree_srcpath , GLNX_FILE_COPY_NOXATTRS ,
1905
1907
cancellable , error ))
1906
1908
return FALSE;
1907
1909
}
0 commit comments