samba 4.6.4への update

sorry Japanese only
PAGE作成日 2017/05/28
最終更新日 2017/05/28
page size = Mbyte


WannaCryというファイルを暗号化してしまうウィルスが windowsの方ではやって世界的な問題になりましたが、linuxで動いている sambaにも同様の問題があると言うことで、最新版へ updateしました

以前は vine linux 6.2に標準で付いていたのを apt-getで installしたと思います。(随分前のことなので忘れました)

今回、vine linuxの方を見ても sambaの最新版は準備されていないようなので、本家sambaの方からソースファイルを downloadしてきてインストールしました

エラーが沢山出たのでメモを残します

samba 4.6.4を install
sambaは sourceを downloadして自分で install
https://www.samba.org/samba/download/
より samba-latest.tar.gzを download

tar zxvf samba-latest.tar.gz
2017/5/26日時点の最新verは 4.6.4だった

------------------------------------------------------------------------

configureしたら

samba Python development headers not found

これは検索したら python-develを installしたら解消したと書かれている所もありましたが、私の所は解消しなかったので

pythonを srcより installしました

https://www.python.org/より

ver 2.7.13を downloadしました

configure

make

make install

------------------------------------------------------------------------

今度は以下エラー

python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

検索したら、ライブラリーが参照できてないとかで

ln -s /usr/local/lib/libpython2.7.so.1.0 /lib64/

を実行

しかしこの python、/ に lib64作るとかなんなの

------------------------------------------------------------------------

sambaに戻って configureしたら次のエラーは、

error: Building the AD DC requires GnuTLS (eg libgnutls-dev, gnutls-devel) for ldaps:// support and for the BackupKey protocol

apt-cache search tls

としたら、

gnutls - GNU TLS ライブラリ

gnutls-devel - GnuTLS の開発用ファイル

gnutls-guile - Guile bindings for the GNUTLS library

があったので install

apt-get install gnutls gnutls-devel gnutls-guile gnutls-utils

------------------------------------------------------------------------

sanbaにもどって configureしたら

Checking simple C program : /tmp/samba/samba-4.6.4/lib/replace/../../buildtools/wafsamba/wscript:316: error: the configuration failed (see '/tmp/samba/samba-4.6.4/bin/config.log')

bin/config.logを見ると

[2/2] Linking default/testprog

/usr/bin/ld: BFD version 2.22 internal error, aborting at reloc.c line 443 in bfd_get_reloc_size

/usr/bin/ld: Please report this bug.

collect2: エラー: ld はステータス 1 で終了しました

/usr/bin/ldでエラーが出てる様子

簡単な hello.cをコンパイルかけても同じエラーが出ました

調べても解決しないんで自力で色々やった所、

apt-get install binutils binutils-devel

を行って解決

/usr/bin/ldのコマンドが古いまま gccの verを新しくしたのが原因のようでした

------------------------------------------------------------------------

sambaにもどって configureしたら次は

/tmp/samba/samba-4.6.4/source3/wscript:507: error: ACL support not found. Try installing libacl1-dev or libacl-devel. Otherwise, use --without-acl-support to build without ACL support. ACL support is required to change permissions from Windows clients.

[root@vine62 tmp]# apt-cache search libacl

と検索した所 2個引っかかった

libacl - Dynamic library for access control list support

libacl-devel - Access control list static libraries and headers.

ので installを行いました

[root@vine62 tmp]# apt-get install libacl libacl-devel

------------------------------------------------------------------------

次は

/tmp/samba/samba-4.6.4/source3/wscript:703: error: LDAP support not found. Try installing libldap2-dev or openldap-devel. Otherwise, use --without-ldap to build without LDAP support. LDAP support is required for the LDAP passdb backend, LDAP idmap backends and ADS. ADS support improves communication with Active Directory domain controllers.

[root@vine62 tmp]# apt-get install openldap openldap-devel

を実施しました

無事 sambaの configureは通るようになりました

------------------------------------------------------------------------

次は make

/usr/bin/ld: default/source3/utils/regedit_38.o: シンボル 'stdscr' への未定義参照です

/lib64/libtinfo.so.5: error adding symbols: DSO missing from command line

collect2: エラー: ld はステータス 1 で終了しました

Waf: Leaving directory `/tmp/samba/samba-4.6.4/bin'

Build failed: -> task failed (err #1):

{task: cc_link regedit_38.o,regedit_samba3_38.o,regedit_wrap_38.o,regedit_treeview_38.o,regedit_valuelist_38.o,regedit_dialog_38.o,regedit_hexedit_38.o,regedit_list_38.o -> samba-regedit}

make: *** [all] エラー 1

configure --enable-pthreadpool NO

しかし configureの最後の行が

Unable to find build target matching NO

と表示されたけどいいのだろうか?

makeやったけどエラーに変化無し

configureは元に戻して、stdscrってのを調べたら

nucursesってのが関係していたので、それの develを入れてみる

[root@vine62 samba-4.6.4]# apt-get install ncurses-devel

は既に入ってるとなったので

[root@vine62 samba-4.6.4]# apt-get install compat32-ncurses-devel

ダメ、sambaの makeで同様のエラー

調べると、pythonにも cursesライブラリってのがあるらしい

python作成で間違ったのか?

gccも新しくなったし、pythonを再度作成し直してみる

せっかくなので pythonの configure時

configure --enable-optimizations

と行った

ダメ、sambaの makeで同様のエラー

問題のライブラリは、/usr/include内にある

-rw-r--r-- 1 root root 79946 3月 27 2011 /usr/include/curses.h

のようなので、これの元のファイル ncursesの srcファイルの最新版を download

wget ftp://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz

tar zxvfして、configureして makeして、curses.hだけを /usr/includeへコピー

-rw-r--r-- 1 root root 78720 5月 28 15:22 /usr/include/curses.h

sambaに戻って実行したが、ダメ、sambaの makeで同様のエラー

さっき makeまでやった ncursesを make installする

pythonも configure、make、make install

sambaに戻って、間違って make cleanやらず makeだけやったら以下のエラー

/usr/bin/ld: 互換性のないを /usr/lib/libncurses.so スキップしました (-lncurses を探索している時)

/usr/bin/ld: /usr/lib/libncurses.a(lib_beep.o): 再配置 R_X86_64_32 (`.rodata.str1.1' に対する) は共有オブジェクト作成時には 使用できません。-fPIC を付けて再コンパイルしてください。

/usr/lib/libncurses.a: error adding symbols: 不正な値です

collect2: エラー: ld はステータス 1 で終了しました

Waf: Leaving directory `/tmp/samba/samba-4.6.4/bin'

Build failed: -> task failed (err #1):

{task: cc_link regedit_38.o,regedit_samba3_38.o,regedit_wrap_38.o,regedit_treeview_38.o,regedit_valuelist_38.o,regedit_dialog_38.o,regedit_hexedit_38.o,regedit_list_38.o -> samba-regedit}

make: *** [all] エラー 1

ん?少しエラーの内容が変わりました

期待して make clean後、念入りに configureして make

/usr/bin/ld: /usr/lib/libncurses.a(lib_beep.o): 再配置 R_X86_64_32 (`.rodata.str1.1' に対する) は共有オブジェクト作成時には 使用できません。-fPIC を付けて再コンパイルしてください。

/usr/lib/libncurses.a: error adding symbols: 不正な値です

collect2: エラー: ld はステータス 1 で終了しました

Waf: Leaving directory `/tmp/samba/samba-4.6.4/bin'

Build failed: -> task failed (err #1):

{task: cc_link regedit_38.o,regedit_samba3_38.o,regedit_wrap_38.o,regedit_treeview_38.o,regedit_valuelist_38.o,regedit_dialog_38.o,regedit_hexedit_38.o,regedit_list_38.o -> samba-regedit}

make: *** [all] エラー 1

だめ

nncursesに戻って色々戦う

どこかのページで -fPICは --enable-sharedを付けると良いとあった

configure --enable-shared

とやって make、make install

/usr/lib/libncurses.a

のサイズは変化無かったけど、sambaに戻って

configure、make、make install 通った!

sambaの binができあがりました

1日目 4時間戦って飽きて、2日目 3時間戦って sambaのバイナリできあがりました

2938
戻る