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

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

    <bug>
          <bug_id>53382</bug_id>
          
          <creation_ts>2025-03-10 15:56:45 +0300</creation_ts>
          <short_desc>Для указания `db_password` требуется редактировать скрипт из пакета, в отличие от `db_user` и `db_name`</short_desc>
          <delta_ts>2025-03-10 16:23:16 +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>bacula15</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="Artem Varaksa">varaksaaa</reporter>
          <assigned_to name="Alexei Takaseev">taf</assigned_to>
          <cc>taf</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>260740</commentid>
    <comment_count>0</comment_count>
    <who name="Artem Varaksa">varaksaaa</who>
    <bug_when>2025-03-10 15:56:45 +0300</bug_when>
    <thetext>Шаги
====

0. # export BACULA=15 POSTGRESQL=17
1. # apt-get install -y mt-st postgresql$POSTGRESQL-server bacula$BACULA-{common,console,storage,client,director-{common,postgresql}}

Фактический результат
=====================

`db_password` задается в скрипте всегда - не изменяя скрипт, не пустой пароль задать нельзя.

&gt; # cat /usr/share/bacula/scripts/grant_postgresql_privileges
&gt; ...
&gt; db_user=${db_user:-bacula}
&gt; bindir=/usr/bin
&gt; PATH=&quot;$PATH:$bindir&quot;
&gt; db_name=${db_name:-bacula}
&gt; db_password=
&gt; if [ &quot;$db_password&quot; != &quot;&quot; ]; then
&gt;    pass=&quot;password &apos;$db_password&apos;&quot;
&gt; fi

При этом `db_user` и `db_name` задать можно.

# export db_user=1 db_name=2 db_password=3 &amp;&amp; sh -x /usr/share/bacula/scripts/grant_postgresql_privileges
&gt; + db_user=1
&gt; + bindir=/usr/bin
&gt; + PATH=/root/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/games:/usr/bin
&gt; + db_name=2
&gt; + db_password=
&gt; ...

Примечание: запускаю так для демонстрации ошибки, обычно необходимо запускать скрипт *_bacula_* (https://bugzilla.altlinux.org/53381).

Ожидаемый результат
===================

&gt; # cat /usr/share/bacula/scripts/grant_postgresql_privileges
&gt; ...
&gt; db_password=${db_password:-}
&gt; ...

Воспроизводимость
=================

Воспроизводится на виртуальных машинах:

[p11+375453] [sisyphus] ALT Server 11.0 beta20250213 x86_64
bacula15-common-15.0.2-alt2.x86_64
postgresql17-server-17.4-alt1.x86_64

[p11] ALT Server 11.0 beta20250213 x86_64
bacula13-common-13.0.4-alt2.x86_64
postgresql17-server-17.4-alt1.x86_64</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260741</commentid>
    <comment_count>1</comment_count>
    <who name="Artem Varaksa">varaksaaa</who>
    <bug_when>2025-03-10 16:00:26 +0300</bug_when>
    <thetext>Аналогично для grant_mysql_privileges.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260745</commentid>
    <comment_count>2</comment_count>
    <who name="Alexei Takaseev">taf</who>
    <bug_when>2025-03-10 16:23:16 +0300</bug_when>
    <thetext>Это не баг, а документированное поведение: https://www.altlinux.org/%D0%9D%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B0_Bacula_9_%2B_Baculum_9_%D0%B4%D0%BB%D1%8F_PostgreSQL_9.6#%D0%A3%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0_Bacula</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>