Bug 33427 - Некорректно указаны пути к модулям ldb
Summary: Некорректно указаны пути к модулям ldb
Status: CLOSED FIXED
Alias: None
Product: Branch p8
Classification: Distributions
Component: samba (show other bugs)
Version: не указана
Hardware: all Linux
: P3 normal
Assignee: Evgeny Sinelnikov
QA Contact: qa-p8@altlinux.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-28 11:29 MSK by Andrey Pinchuk
Modified: 2018-03-16 22:24 MSK (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Pinchuk 2017-04-28 11:29:35 MSK
ALT 8.1 Server. При вводе машины в домен samba dc:

# net ads join -U Administrator
Enter Administrator's password:

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

Сами модули лежат в /usr/lib64/ldb
Comment 1 Evgeny Sinelnikov 2017-05-31 03:45:27 MSK
Эту проблему когда уже решали:
https://bugzilla.altlinux.org/show_bug.cgi?id=31243

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

При этом, необходимые костыли прибиты только для bash'а в файле /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
Comment 2 Evgeny Sinelnikov 2017-06-20 19:45:16 MSK
В общем, я придумал как выпилить все уродливые костыли и сделать дистрибутивное решение. Кроме того, и это самого главное, на клиентах теперь можно будет установить библиотеки от 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: невозможно получить доступ к '/usr/lib64/samba-dc/ldb': Нет такого файла или каталога

[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'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
Comment 3 Repository Robot 2017-06-20 21:35:55 MSK
libldb-1.1.29-alt2.S1 -> sisyphus:

Tue Jun 20 2017 Evgeny Sinelnikov <sin@altlinux.ru> 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)
Comment 4 Vitaly Lipatov 2017-11-02 17:24:38 MSK
(В ответ на комментарий №3)
> libldb-1.1.29-alt2.S1 -> sisyphus:
> 
> Tue Jun 20 2017 Evgeny Sinelnikov <sin@altlinux.ru> 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)

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

# rpm -q libldb
libldb-1.1.29-alt2.S1.x86_64
Comment 5 Evgeny Sinelnikov 2017-11-02 17:35:28 MSK
В чистом окружении (не в p8, ни на сизифе) это не воспроизводится. Нужны подробности.
Comment 6 Vitaly Lipatov 2017-11-02 17:51:31 MSK
(В ответ на комментарий №5)
> В чистом окружении (не в p8, ни на сизифе) это не воспроизводится. Нужны
> подробности.
Взяли чистую 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
Comment 7 Georgy A Bystrenin 2018-02-07 03:28:56 MSK
(В ответ на комментарий №6)
> (В ответ на комментарий №5)
> > В чистом окружении (не в p8, ни на сизифе) это не воспроизводится. Нужны
> > подробности.
> Взяли чистую p8 и обновили до Сизифа.
> 
> Вопрос: производилось ли воспроизведение через полное создание через полное
> создание среды с помощью vagrand? Можно увидеть конкретный скрипт, по которому
> это происходило?

Используемый нами стенд с сервером клиентом ALT -
 https://github.com/mastersin/samba-stand
Comment 8 Repository Robot 2018-03-16 22:24:53 MSK
libldb-1.1.29-alt3.M70C.1 -> c7.1:

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

Tue Jun 20 2017 Evgeny Sinelnikov <sin@altlinux.ru> 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 <sin@altlinux.ru> 1.1.29-alt1.M70C.1
- Update to new release for samba-4.6.0

Fri Sep 09 2016 Evgeny Sinelnikov <sin@altlinux.ru> 1.1.27-alt1
- Update to new release for samba-4.5.0

Wed Dec 16 2015 Andrey Cherepanov <cas@altlinux> 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 <cas@altlinux> 1.1.23-alt1
- 1.1.23
- Enable tests

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