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

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

    <bug>
          <bug_id>48499</bug_id>
          
          <creation_ts>2023-11-18 18:23:50 +0300</creation_ts>
          <short_desc>Не открывает файл конфигурации используя sudo</short_desc>
          <delta_ts>2023-11-27 17:23:34 +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>howdy</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>NOTABUG</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="Evgeny Shesteperov">alimektor</reporter>
          <assigned_to name="Leontiy Volodin">lvol</assigned_to>
          <cc>golubevan</cc>
    
    <cc>lvol</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>237475</commentid>
    <comment_count>0</comment_count>
    <who name="Evgeny Shesteperov">alimektor</who>
    <bug_when>2023-11-18 18:23:50 +0300</bug_when>
    <thetext>Версия

-   howdy-3.0.0-alt10.beta1.gitc5b1766

Шаги воспроизведения

    # apt-get install -y howdy sudo vim-console
    # sed -i &apos;s|# WHEEL_USERS ALL=(ALL:ALL) ALL|WHEEL_USERS ALL=(ALL:ALL) ALL|g&apos; /etc/sudoers
    $ EDITOR=vim sudo howdy config

Ожидаемый результат: открытие файла конфигурации /etc/howdy/config.ini в
редакторе по умолчанию (в данном случае vim).

Фактический результат: ошибка, что нет Nano

    Открытие config.ini в редакторе по умолчанию
    Traceback (most recent call last):
      File &quot;/usr/libexec/howdy/cli.py&quot;, line 102, in &lt;module&gt;
        import cli.config
      File &quot;/usr/libexec/howdy/cli/config.py&quot;, line 23, in &lt;module&gt;
        subprocess.call([editor, paths_factory.config_file_path()])
      File &quot;/usr/lib64/python3.9/subprocess.py&quot;, line 349, in call
        with Popen(*popenargs, **kwargs) as p:
      File &quot;/usr/lib64/python3.9/subprocess.py&quot;, line 951, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File &quot;/usr/lib64/python3.9/subprocess.py&quot;, line 1821, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: &apos;/usr/bin/nano&apos;

Игнорирует $EDITOR. Если запускать, например, так, то всё работает:

    # EDITOR=vim howdy config --user test</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>237914</commentid>
    <comment_count>1</comment_count>
    <who name="Anton Golubev">golubevan</who>
    <bug_when>2023-11-27 17:23:34 +0300</bug_when>
    <thetext>Скорее всего у вас окружение не пробрасывается в sudo. Либо запускайте sudo -E, либо поправьте /etc/sudoers

# sed -i &apos;s|#Defaults:WHEEL_USERS !env_reset|Defaults:WHEEL_USERS !env_reset|g&apos;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>