@@ -758,15 +758,13 @@ void receive_idmapsources(int sockfd)
758758 receive_fd_sources (sockfd , "_LIBCONTAINER_IDMAP_FDS" );
759759}
760760
761- static void update_timens (char * map , size_t map_len )
761+ static void update_timens_offsets (char * map , size_t map_len )
762762{
763763 if (map == NULL || map_len == 0 )
764764 return ;
765765 write_log (DEBUG , "update /proc/self/timens_offsets to '%s'" , map );
766- if (write_file (map , map_len , "/proc/self/timens_offsets" ) < 0 ) {
767- if (errno != EPERM )
768- bail ("failed to update /proc/self/timens_offsets" );
769- }
766+ if (write_file (map , map_len , "/proc/self/timens_offsets" ) < 0 )
767+ bail ("failed to update /proc/self/timens_offsets" );
770768}
771769
772770void nsexec (void )
@@ -1174,6 +1172,7 @@ void nsexec(void)
11741172 * was broken, so we'll just do it the long way anyway.
11751173 */
11761174 try_unshare (config .cloneflags & ~CLONE_NEWCGROUP , "remaining namespaces (except cgroupns)" );
1175+ update_timens_offsets (config .timensoffset , config .timensoffset_len );
11771176
11781177 /* Ask our parent to send the mount sources fds. */
11791178 if (config .mountsources ) {
@@ -1207,11 +1206,6 @@ void nsexec(void)
12071206 bail ("failed to sync with parent: SYNC_MOUNT_IDMAP_ACK: got %u" , s );
12081207 }
12091208
1210- /*
1211- * set boottime and monotonic timens offsets.
1212- */
1213- update_timens (config .timensoffset , config .timensoffset_len );
1214-
12151209 /*
12161210 * TODO: What about non-namespace clone flags that we're dropping here?
12171211 *
0 commit comments