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

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

    <bug>
          <bug_id>42189</bug_id>
          
          <creation_ts>2022-03-20 23:20:31 +0300</creation_ts>
          <short_desc>cpio 2.13 убирает ведущий слеш у симлинков</short_desc>
          <delta_ts>2024-04-03 15:23:32 +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>cpio</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugzilla.altlinux.org/show_bug.cgi?id=9226</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>42561</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Vitaly Lipatov">lav</reporter>
          <assigned_to name="placeholder@altlinux.org">placeholder</assigned_to>
          <cc>atropichev</cc>
    
    <cc>glebfm</cc>
    
    <cc>ldv</cc>
    
    <cc>placeholder</cc>
    
    <cc>tergoev-m</cc>
    
    <cc>vanyamajukin</cc>
    
    <cc>vt</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>208671</commentid>
    <comment_count>0</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2022-03-20 23:20:31 +0300</bug_when>
    <thetext>* Пт дек 10 2021 Gleb F-Malinovskiy &lt;glebfm@altlinux.org&gt; 2.13-alt1
- Updated to 2.13.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>208672</commentid>
    <comment_count>1</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2022-03-20 23:26:49 +0300</bug_when>
    <thetext>Это баг в cpio-2.13: relative symlink handling with --no-absolute-filenames
https://lists.gnu.org/archive/html/bug-cpio/2019-11/msg00016.html

Корректный архив:
$ cpio -i -t -v -F 2.cpio
drwxrwxr-x   2 lav      users           0 Mar 20 23:10 1
lrwxrwxrwx   1 lav      users          13 Mar 20 23:10 1/bash -&gt; /usr/bin/bash

Распаковка:
$ cpio --extract --make-directories --no-absolute-filenames &lt; 2.cpio
cpio: Removing leading `/&apos; from hard link targets
1 block

Битый симлинк в итоге:
$ ls -l 1/
итого 0
lrwxrwxrwx 1 lav users 12 мар 20 23:24 bash -&gt; usr/bin/bash

Причём проблема только при указании --no-absolute-filenames, то есть она не применяется по умолчанию, несмотря на комментарий
https://bugzilla.altlinux.org/show_bug.cgi?id=9226#c2


Аналогичная бага в Gentoo:
https://bugs.gentoo.org/700020</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>218883</commentid>
    <comment_count>2</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2022-12-14 11:51:03 +0300</bug_when>
    <thetext>Спустя 2 года в Gentoo багу закрыли:
https://bugs.gentoo.org/700020#c15

Очень ждём исправления и в Сизифе (в p10 пока что 2.12, возможно, с CVE, но без этой баги).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>226546</commentid>
    <comment_count>3</comment_count>
    <who name="Mikhail Tergoev">tergoev-m</who>
    <bug_when>2023-05-26 14:16:09 +0300</bug_when>
    <thetext>Есть новая версия cpio 2.14
История изменения:
https://savannah.gnu.org/news/?id=10359
Нас интересует пункт:
* Rewrite the fix for CVE-2015-1197

Но для обновления cpio необходимо обновить autoconf до версии 2.71+
https://bugzilla.altlinux.org/42349</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>226551</commentid>
    <comment_count>4</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2023-05-26 14:58:17 +0300</bug_when>
    <thetext>(Ответ для Mikhail Tergoev на комментарий #3)
&gt; Есть новая версия cpio 2.14
&gt; История изменения:
&gt; https://savannah.gnu.org/news/?id=10359
&gt; Нас интересует пункт:
&gt; * Rewrite the fix for CVE-2015-1197
&gt; 
&gt; Но для обновления cpio необходимо обновить autoconf до версии 2.71+
&gt; https://bugzilla.altlinux.org/42349

Ещё есть вариант добавить только исправляющий патч в нынешнюю 2.13.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>226597</commentid>
    <comment_count>5</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2023-05-27 22:35:26 +0300</bug_when>
    <thetext>(In reply to Mikhail Tergoev from comment #3)
&gt; Но для обновления cpio необходимо обновить autoconf до версии 2.71+
&gt; https://bugzilla.altlinux.org/42349

Прямо-таки необходимо?  Можете обосновать это утверждение?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>242502</commentid>
    <comment_count>6</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2024-03-03 21:51:21 +0300</bug_when>
    <thetext>В 2024 году уже есть новая версия 2.15.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>243968</commentid>
    <comment_count>7</comment_count>
    <who name="Ivan Mazhukin">vanyamajukin</who>
    <bug_when>2024-04-02 21:33:30 +0300</bug_when>
    <thetext>Создаю тестовый архив и тестовый симлинк:
mkdir testcpio &amp;&amp; cd testcpio
mkdir 1 
ln -s /usr/bin/bash 1/bash
find $HOME/testcpio/ -depth | cpio -o &gt; test.cpio

Проверяю архив:
$ cpio -i -t -v -F test.cpio
-rw-r--r--   1 vano     vano            0 Apr  2 21:15 /home/vano/testcpio/1/test.cpio
lrwxrwxrwx   1 vano     vano           13 Apr  2 21:14 /home/vano/testcpio/1/bash -&gt; /usr/bin/bash
drwxr-xr-x   2 vano     vano            0 Apr  2 21:15 /home/vano/testcpio/1
drwxr-xr-x   3 vano     vano            0 Apr  2 21:12 /home/vano/testcpio/

Распаковка:
$ cpio --extract --make-directories --no-absolute-filenames &lt; test.cpio
cpio: Из имён членов удаляются начальные `/&apos;
1 блок


Проверяю распакованый симлинк:
$ ls -l ~/testcpio/home/vano/testcpio/1/
итого 0
lrwxrwxrwx 1 vano vano 13 апр  2 21:17 bash -&gt; /usr/bin/bash

С ним всё нормально. 
Проверял на версии cpio 2.15</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>244029</commentid>
    <comment_count>8</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2024-04-03 15:23:32 +0300</bug_when>
    <thetext>(Ответ для Ivan Mazhukin на комментарий #7)
...
&gt; Проверял на версии cpio 2.15
Да, как раз там исправлено:

GNU cpio version 2.15 is available for download. This is a bug-fixing release.  Short summary of changes:

Fix the operation of --no-absolute-filenames --make-directories.
Restore access and modification times of symlinks in copy-in and copy-pass modes</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>