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

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

    <bug>
          <bug_id>61720</bug_id>
          
          <creation_ts>2026-11-30 16:55:17 +0300</creation_ts>
          <short_desc>control++: ошибка «Can&apos;t execute the script (no interpreter, noexec mount or no shebang)» при применении любого режима со скриптами юнита scripts</short_desc>
          <delta_ts>2026-11-30 21:59:45 +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>control++</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</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="obidinog@basealt.ru">obidinog</reporter>
          <assigned_to>alexey</assigned_to>
          <cc>alexey</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>305524</commentid>
    <comment_count>0</comment_count>
    <who name="obidinog@basealt.ru">obidinog</who>
    <bug_when>2026-11-30 16:55:17 +0300</bug_when>
    <thetext>1. Описание стенда:
ALT Server p11 x86_64, обновлённый до Sisyphus

2. Версия пакета:
control++-0.25.0-alt1.x86_64
libcontrol++-0.36.0-alt1.x86_64

3. Шаги воспроизведения:
1. Создать тестовый режим со скриптом (валидный shebang #!/bin/bash, права 0755):
# cat &gt;&gt; /etc/control++/control++.conf &lt;&lt; &apos;EOF&apos;
[test_mode]
scripts = test_s1
EOF

# mkdir -p /etc/control++/scripts/test_s1
# cat &gt; /etc/control++/scripts/test_s1/do &lt;&lt; &apos;EOF&apos;
#!/bin/bash
touch /root/test_s1_DO
EOF
# chmod 755 /etc/control++/scripts/test_s1/do

2. Применить режим:
# control++ test_mode

4. Ожидаемый результат:
Режим успешно применяется («Mode set OK»), скрипт /etc/control++/scripts/test_s1/do исполняется, создаётся файл /root/test_s1_DO.

5. Реальный результат:
Утилита завершается с ошибкой применения скрипта:
Setting &apos;test_mode&apos; mode:
Current mode is unknown, restoring will not be performed
Setting &apos;test_mode&apos; mode for the &apos;scripts&apos; unit
Applying &apos;test_s1&apos; mode of the scripts unit.......................................[ERROR: Can&apos;t execute the script (no interpreter, noexec mount or no shebang)]
[ERROR: Can&apos;t apply mode for the scripts]
Restoring initial state for the &apos;scripts&apos; unit
Applying &apos;.reset&apos; mode of the scripts unit................................[DONE]
	- [WARNING: Previous scripts mode not stated]
Set mode failed

Скрипт не выполняется (файл /root/test_s1_DO отсутствует), код возврата 1.

6. Дополнительная информация:
Регрессия возникла в версии 0.25.0 при исправлении OVE-20261127-0015 (защита от гонок при выполнении скриптов).
При анализе системных вызовов через strace обнаружено:
[pid  4512] execveat(3, , [&quot;/etc/control++/scripts/test_s1/d&quot;...], ..., AT_EMPTY_PATH) = -1 ENOENT (No such file or directory)
[pid  4512] exit_group(204)

В ядре Linux механизм binfmt_script (fs/binfmt_script.c) возвращает ENOENT при вызове execveat с флагом AT_EMPTY_PATH, так как дескриптор без имени в VFS помечается флагом BINPRM_FLAGS_PATH_INACCESSIBLE и ядро не может передать путь к файлу интерпретатору (bash/sh/python).
При подстановке скомпилированного ELF-бинарника (например, /bin/true вместо do) execveat(..., AT_EMPTY_PATH) отрабатывает успешно:
Applying &apos;test_s1&apos; mode of the scripts unit...............................[DONE]
Mode set OK

Таким образом, в 0.25.0 полностью заблокировано исполнение любых интерпретируемых шелл-скриптов в юните scripts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>305555</commentid>
    <comment_count>1</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2026-11-30 21:59:45 +0300</bug_when>
    <thetext>control++-0.25.1-alt1 -&gt; sisyphus:

Mon Nov 30 2026 Alexey Appolonov &lt;alexey@altlinux&gt; 0.25.1-alt1
- Fix a regression of OVE-20261127-0015: Scripts with a shebang don&apos;t run
  (Closes: #61720);
- Corrected samples of the scripts.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>