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

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

    <bug>
          <bug_id>33427</bug_id>
          
          <creation_ts>2017-04-28 11:29:35 +0300</creation_ts>
          <short_desc>Некорректно указаны пути к модулям ldb</short_desc>
          <delta_ts>2018-03-16 22:24:53 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Distributions</classification>
          <product>Branch p8</product>
          <component>samba</component>
          <version>не указана</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>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andrey Pinchuk">zoros</reporter>
          <assigned_to name="Evgeny Sinelnikov">sin</assigned_to>
          <cc>aen</cc>
    
    <cc>cas</cc>
    
    <cc>gkot</cc>
    
    <cc>lav</cc>
    
    <cc>sin</cc>
          
          <qa_contact name="qa-p8@altlinux.org">qa-p8</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>163480</commentid>
    <comment_count>0</comment_count>
    <who name="Andrey Pinchuk">zoros</who>
    <bug_when>2017-04-28 11:29:35 +0300</bug_when>
    <thetext>ALT 8.1 Server. При вводе машины в домен samba dc:

# net ads join -U Administrator
Enter Administrator&apos;s password:

ldb: unable to stat module /usr/lib64/samba/ldb : Нет такого файла или каталога

Сами модули лежат в /usr/lib64/ldb</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>163866</commentid>
    <comment_count>1</comment_count>
    <who name="Evgeny Sinelnikov">sin</who>
    <bug_when>2017-05-31 03:45:27 +0300</bug_when>
    <thetext>Эту проблему когда уже решали:
https://bugzilla.altlinux.org/show_bug.cgi?id=31243

В целом, причина проблемы в том, что библиотека libldb собрана отдельно и с самой samba не связана ничем, кроме зависимостей.

При этом, необходимые костыли прибиты только для bash&apos;а в файле /etc/bashrc.d/ldb-modules.sh и лежат в пакете ldb-tools:

$ cat /etc/bashrc.d/ldb-modules.sh

if [ -d /usr/lib64/ldb/modules/ldb -a -d /usr/lib64/samba-dc/ldb ]; then
     export LDB_MODULES_PATH=/usr/lib64/ldb/modules/ldb:/usr/lib64/samba-dc/ldb
elif [ -d /usr/lib64/ldb/modules/ldb ]; then
     export LDB_MODULES_PATH=/usr/lib64/ldb/modules/ldb
elif [ -d /usr/lib64/samba-dc/ldb ]; then
     export LDB_MODULES_PATH=/usr/lib64/samba-dc/ldb
else
     unset LDB_LIBRARY_PATH
fi

Сама проблема эта известна:
https://bugzilla.redhat.com/show_bug.cgi?id=1337569
https://lists.fedorahosted.org/pipermail/sssd-users/2014-August/001992.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>164297</commentid>
    <comment_count>2</comment_count>
    <who name="Evgeny Sinelnikov">sin</who>
    <bug_when>2017-06-20 19:45:16 +0300</bug_when>
    <thetext>В общем, я придумал как выпилить все уродливые костыли и сделать дистрибутивное решение. Кроме того, и это самого главное, на клиентах теперь можно будет установить библиотеки от samba-DC и полноценно работать с ldb-tools на рабочих станциях. Для этого достаточно установить к пакету ldb-tools паект libldb-modules-DC.

[sin@tor RPMS.hasher]$ sudo rpm -U libldb-1.1.29-alt2.M80P.1.x86_64.rpm --replacepkgs --replacefiles 
[sin@tor RPMS.hasher]$ ldbsearch --help                                                              
Usage: [OPTION...]
  -H, --url=URL                   database URL
  -b, --basedn=DN                 base DN
  -e, --editor=PROGRAM            external editor
  -s, --scope=SCOPE               search scope
  -v, --verbose                   increase verbosity
      --trace                     enable tracing
  -i, --interactive               input from stdin
  -r, --recursive                 recursive delete
      --modules-path=PATH         modules path
      --num-searches=INT          number of test searches
      --num-records=INT           number of test records
  -a, --all                       (|(objectClass=*)(distinguishedName=*))
      --nosync                    non-synchronous transactions
  -S, --sorted                    sort attributes
  -o=OPTION                       ldb_connect option
      --controls=STRING           controls
      --show-binary               display binary LDIF
      --paged                     use a paged search
      --show-deleted              show deleted objects
      --show-recycled             show recycled objects
      --show-deactivated-link     show deactivated links
      --reveal                    reveal ldb internals
      --relax                     pass relax control
      --cross-ncs                 search across NC boundaries
      --extended-dn               show extended DNs

Help options:
  -?, --help                      Show this help message
      --usage                     Display brief usage message
[sin@tor RPMS.hasher]$ ls /usr/lib64/samba-dc/ldb
ls: невозможно получить доступ к &apos;/usr/lib64/samba-dc/ldb&apos;: Нет такого файла или каталога

[sin@tor RPMS.hasher]$ sudo rpm -U libldb-modules-DC-4.6.5-alt2.M80P.1.x86_64.rpm 
[sin@tor RPMS.hasher]$ ls -d /usr/lib64/samba-dc/ldb                              
/usr/lib64/samba-dc/ldb

[sin@tor RPMS.hasher]$ ldbsearch --help                                           
Usage: [OPTION...]
  -H, --url=URL                               database URL
  -b, --basedn=DN                             base DN
  -e, --editor=PROGRAM                        external editor
  -s, --scope=SCOPE                           search scope
  -v, --verbose                               increase verbosity
      --trace                                 enable tracing
  -i, --interactive                           input from stdin
  -r, --recursive                             recursive delete
      --modules-path=PATH                     modules path
      --num-searches=INT                      number of test searches
      --num-records=INT                       number of test records
  -a, --all                                   (|(objectClass=*)(distinguishedName=*))
      --nosync                                non-synchronous transactions
  -S, --sorted                                sort attributes
  -o=OPTION                                   ldb_connect option
      --controls=STRING                       controls
      --show-binary                           display binary LDIF
      --paged                                 use a paged search
      --show-deleted                          show deleted objects
      --show-recycled                         show recycled objects
      --show-deactivated-link                 show deactivated links
      --reveal                                reveal ldb internals
      --relax                                 pass relax control
      --cross-ncs                             search across NC boundaries
      --extended-dn                           show extended DNs

Help options:
  -?, --help                                  Show this help message
      --usage                                 Display brief usage message

Common Samba options:
  -d, --debuglevel=DEBUGLEVEL                 Set debug level
      --debug-stderr                          Send debug output to STDERR
  -s, --configfile=CONFIGFILE                 Use alternative configuration
                                              file
      --option=name=value                     Set smb.conf option from command
                                              line
  -l, --log-basename=LOGFILEBASE              Basename for log/debug files
      --leak-report                           enable talloc leak reporting on
                                              exit
      --leak-report-full                      enable full talloc leak
                                              reporting on exit

Authentication options:
  -U, --user=[DOMAIN/]USERNAME[%PASSWORD]     Set the network username
  -N, --no-pass                               Don&apos;t ask for a password
      --password=STRING                       Password
  -A, --authentication-file=FILE              Get the credentials from a file
  -P, --machine-pass                          Use stored machine account
                                              password
      --simple-bind-dn=STRING                 DN to use for a simple bind
  -k, --kerberos=STRING                       Use Kerberos, -k [yes|no]
      --krb5-ccache=STRING                    Credentials cache location for
                                              Kerberos
  -S, --sign                                  Sign connection to prevent
                                              modification in transit
  -e, --encrypt                               Encrypt connection for privacy

Connection options:
  -R, --name-resolve=NAME-RESOLVE-ORDER       Use these name resolution
                                              services only
  -O, --socket-options=SOCKETOPTIONS          socket options to use
  -n, --netbiosname=NETBIOSNAME               Primary netbios name
  -S, --signing=on|off|required               Set the client signing state
  -W, --workgroup=WORKGROUP                   Set the workgroup name
      --realm=REALM                           Set the realm name
  -i, --scope=SCOPE                           Use this Netbios scope
  -m, --maxprotocol=MAXPROTOCOL               Set max protocol level

Version options:
  -V, --version                               Print version</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>164304</commentid>
    <comment_count>3</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2017-06-20 21:35:55 +0300</bug_when>
    <thetext>libldb-1.1.29-alt2.S1 -&gt; sisyphus:

Tue Jun 20 2017 Evgeny Sinelnikov &lt;sin@altlinux.ru&gt; 1.1.29-alt2.S1
- Remove hacks with ldb samba modules path search via LDB_LIBRARY_PATH
  by additional --with-samba-modulesdir configure option (closes: #33427)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>166875</commentid>
    <comment_count>4</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2017-11-02 17:24:38 +0300</bug_when>
    <thetext>(В ответ на комментарий №3)
&gt; libldb-1.1.29-alt2.S1 -&gt; sisyphus:
&gt; 
&gt; Tue Jun 20 2017 Evgeny Sinelnikov &lt;sin@altlinux.ru&gt; 1.1.29-alt2.S1
&gt; - Remove hacks with ldb samba modules path search via LDB_LIBRARY_PATH
&gt;   by additional --with-samba-modulesdir configure option (closes: #33427)

# net ads join -k
ldb: unable to stat module /usr/lib64/samba/ldb : Нет такого файла или каталога
Using short domain name -- ETERSOFT
Joined &apos;RX-CI-CLIENT&apos; to dns domain &apos;etersoft.ru&apos;

# rpm -q libldb
libldb-1.1.29-alt2.S1.x86_64</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>166878</commentid>
    <comment_count>5</comment_count>
    <who name="Evgeny Sinelnikov">sin</who>
    <bug_when>2017-11-02 17:35:28 +0300</bug_when>
    <thetext>В чистом окружении (не в p8, ни на сизифе) это не воспроизводится. Нужны подробности.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>166881</commentid>
    <comment_count>6</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2017-11-02 17:51:31 +0300</bug_when>
    <thetext>(В ответ на комментарий №5)
&gt; В чистом окружении (не в p8, ни на сизифе) это не воспроизводится. Нужны
&gt; подробности.
Взяли чистую p8 и обновили до Сизифа.

Вопрос: производилось ли воспроизведение через полное создание через полное создание среды с помощью vagrand? Можно увидеть конкретный скрипт, по которому это происходило?

Вопрос: должен ли существовать каталог /usr/lib64/samba/ldb или модули должны искаться в другом месте?

Как эта бага была решена, из описания
- Remove hacks with ldb samba modules path search via LDB_LIBRARY_PATH
  by additional --with-samba-modulesdir configure option (closes: #33427)
совершенно не ясно.

Тут вроде всё красиво:
# strings /usr/lib64/libldb.so.1.1.29 | grep ldb/modules
/usr/lib64/ldb/modules/ldb
/usr/lib64/ldb/modules/ldb:/usr/lib64/samba-dc/ldb</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>168849</commentid>
    <comment_count>7</comment_count>
    <who name="Georgy A Bystrenin">gkot</who>
    <bug_when>2018-02-07 03:28:56 +0300</bug_when>
    <thetext>(В ответ на комментарий №6)
&gt; (В ответ на комментарий №5)
&gt; &gt; В чистом окружении (не в p8, ни на сизифе) это не воспроизводится. Нужны
&gt; &gt; подробности.
&gt; Взяли чистую p8 и обновили до Сизифа.
&gt; 
&gt; Вопрос: производилось ли воспроизведение через полное создание через полное
&gt; создание среды с помощью vagrand? Можно увидеть конкретный скрипт, по которому
&gt; это происходило?

Используемый нами стенд с сервером клиентом ALT -
 https://github.com/mastersin/samba-stand</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>169699</commentid>
    <comment_count>8</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2018-03-16 22:24:53 +0300</bug_when>
    <thetext>libldb-1.1.29-alt3.M70C.1 -&gt; c7.1:

Sat Jul 15 2017 Evgeny Sinelnikov &lt;sin@altlinux.ru&gt; 1.1.29-alt3.M70C.1
- Rebuild with universal build tag (aka ubt macros) for p7 and c7

Tue Jun 20 2017 Evgeny Sinelnikov &lt;sin@altlinux.ru&gt; 1.1.29-alt2.M70C.1
- Remove hacks with ldb samba modules path search via LDB_LIBRARY_PATH
  by additional --with-samba-modulesdir configure option (closes: #33427)

Tue Mar 07 2017 Evgeny Sinelnikov &lt;sin@altlinux.ru&gt; 1.1.29-alt1.M70C.1
- Update to new release for samba-4.6.0

Fri Sep 09 2016 Evgeny Sinelnikov &lt;sin@altlinux.ru&gt; 1.1.27-alt1
- Update to new release for samba-4.5.0

Wed Dec 16 2015 Andrey Cherepanov &lt;cas@altlinux&gt; 1.1.24-alt1
- 1.1.24
- Security fixes:
  - CVE-2015-5330 (Remote memory read in Samba LDAP server)
  - CVE-2015-3223 (Denial of service in Samba Active Directory server)

Fri Nov 13 2015 Andrey Cherepanov &lt;cas@altlinux&gt; 1.1.23-alt1
- 1.1.23
- Enable tests

Wed Nov 11 2015 Andrey Cherepanov &lt;cas@altlinux&gt; 1.1.21-alt1.1
- Fix path to samba_dsdb.so module (exists only in samba-DC)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>