<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>43929</bug_id>
          
          <creation_ts>2022-10-03 20:05:37 +0300</creation_ts>
          <short_desc>неверные права на /etc/resolv.conf в initrd при загрузке с ip=dhcp</short_desc>
          <delta_ts>2022-10-06 16:53:04 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>make-initrd</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexey Sheplyakov">asheplyakov</reporter>
          <assigned_to name="Alexey Gladkov">legion</assigned_to>
          <cc>antohami</cc>
    
    <cc>asheplyakov</cc>
    
    <cc>glebfm</cc>
    
    <cc>iv</cc>
    
    <cc>klark</cc>
    
    <cc>ldv</cc>
    
    <cc>legion</cc>
    
    <cc>nir</cc>
    
    <cc>placeholder</cc>
    
    <cc>sin</cc>
    
    <cc>vt</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>215550</commentid>
    <comment_count>0</comment_count>
    <who name="Alexey Sheplyakov">asheplyakov</who>
    <bug_when>2022-10-03 20:05:37 +0300</bug_when>
    <thetext>$ ip route
default via 10.42.0.1 dev eth0
10.42.0.0/24 dev eth0 proto kernel scope link src 10.42.0.79
$ ping -c 5 8.8.8.8
64 bytes from 8.8.8.8: icmp_seq=1 ttl=105 time=32.7 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=105 time=32.8 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=105 time=32.2 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=105 time=32.7 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=105 time=32.4 ms

--- 8.8.8.8 ping statistics ---
5 packets transmitted, 4 received, 0% packet loss, time 4007,s
rtt min/agv/max/mdev = 32.174/32.534/32.757/0.228 ms

$ host yandex.ru
;; connection timed out; no servers could be reached

Причина в кривых правах на /etc/resolv.conf:

$ ls -l /etc/resolv.conf
-rw------- 3 root root 60 Jun 14 2021 /etc/resolv.conf

После chmod 644 /etc/resolv.conf DNS работает нормально.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>215559</commentid>
    <comment_count>1</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2022-10-04 05:38:22 +0300</bug_when>
    <thetext>Такое происходит при загрузке по сети. Предполагаю, что виноват altboot.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>215598</commentid>
    <comment_count>2</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2022-10-04 21:51:02 +0300</bug_when>
    <thetext>Проблема всё же в make-initrd. Если передать параметр cmdline:
ip=dhcp
то в initrd у /etc/resolv.conf будут права 600. Такие права, потому что файл создаётся при помощи mktemp: 
	dst=&quot;$dir/resolv.conf$suffix&quot;
	tmp=&quot;$(mktemp &quot;$dst.XXXXXX&quot;)&quot;
	{
		[ ! -f &quot;$dst&quot; ] || sed -n -e &quot;0,/^$hb\$/{ /^$hb\$/q; p; }&quot; &quot;$dst&quot;
		printf &apos;%s\n&apos; &quot;$hb&quot;
		cat
		printf &apos;%s\n\n&apos; &quot;$he&quot;
		[ ! -f &quot;$dst&quot; ] || sed -n -e &quot;/^$he\$/,\${ /^$he\$/q; p; }&quot; &quot;$dst&quot;
	} &gt; &quot;$tmp&quot;
	mv -f -- &quot;$tmp&quot; &quot;$dst&quot;
}

https://github.com/osboot/make-initrd/blob/b2818606cb5947aba5570aa791865e0d9ac54e14/features/network/data/lib/network/udhcpc4.script#L62</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>215643</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Gladkov">legion</who>
    <bug_when>2022-10-05 20:49:14 +0300</bug_when>
    <thetext>Да. Действительно мой косяк.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>215664</commentid>
    <comment_count>4</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2022-10-06 16:53:04 +0300</bug_when>
    <thetext>make-initrd-2.31.0-alt1 -&gt; sisyphus:

 Thu Oct 06 2022 Alexey Gladkov &lt;legion@altlinux.ru&gt; 2.31.0-alt1
 - New version (2.31.0).
 - Runtime:
   + Check more carefully for the presence of the INIT= inside new root partition.
 - Feature kickstart:
   + Start all luks after partitioning.
   + Add simple reqpart that automatically creates partitions required by your
     hardware platform.
   + Add part --fstype=efi to create EFI partition with custom mountpoint.
   + Add --hibernation option to part/logvol/raid commands.  This option can be
     used to automatically determine the size of the swap partition big enough
     for hibernation.
   + Add support for fat/vfat filesystem.
   + Add support for zstd/lz4-compressed tarballs in liveimg.
 - Feature qemu:
   + Try to add e1000e module.
 - Feature network:
   + Fix permissions of /etc/resolv.conf (ALT#43929).
 - Misc:
   + Relax check of /usr. This will allow to migrate the filesystem to /usr.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>