2 – matoken's meme https://matoken.org/blog Tue, 18 Mar 2025 09:49:48 +0000 ja hourly 1 https://wordpress.org/?v=6.7.2 Debian sidでEncFSが動かなくなった https://matoken.org/blog/2025/03/18/encfs-stopped-working-on-debian-sid/ https://matoken.org/blog/2025/03/18/encfs-stopped-working-on-debian-sid/#respond Tue, 18 Mar 2025 09:42:09 +0000 https://matoken.org/blog/?p=4467

Debian sid amd64環境で暗号化ファイルシステムのEncFSが Segmentation fault を返すようになり動かなくなりました.
One-Time PasswordのTOTP(Time-based One-time Password)の共有シークレットを書いたファイルをEncFSの領域に置いてoathtoolを使ったscriptでOTPを出力しているので困ります.

$ encfs ${HOME}/Nextcloud_matoken@files.matoken.org/Documents/encfs ${HOME}/fuse/encfs
Segmentation fault

とりあえず別の端末では動いたのでそちらでしのぎつつ原因を調べます.

はじめencfsコマンドのタイムスタンプが3/10なので最近の更新で壊れたのかなと思いましたがよく見ると去年の3/10なので関係なさそうです.

$ ls -l `which encfs`
-rwxr-xr-x 1 root root 57184 Mar 10  2024 /usr/bin/encfs

COREを履くようにして,gdbで確認すると /lib/x86_64-linux-gnu/libtinyxml2.so.10 が怪しそうです.

$ ulimit -c unlimited
$ encfs ${HOME}/Nextcloud_matoken@files.matoken.org/Documents/encfs ${HOME}/fuse/encfs
Segmentation fault (コアダンプ)
$ gdb encfs core.2007082
GNU gdb (Debian 16.2-7) 16.2
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from encfs...
(No debugging symbols found in encfs)
[New LWP 2007082]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/bin/encfs /home/matoken/Nextcloud_matoken@files.matoken.org/Documents/encfs /home/matoken/fuse/encfs'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f9f83f536ce in tinyxml2::XMLDocument::Identify(char*, tinyxml2::XMLNode**, bool) () from /lib/x86_64-linux-gnu/libtinyxml2.so.10
(gdb) backtrace
#0  0x00007f9f83f536ce in tinyxml2::XMLDocument::Identify(char*, tinyxml2::XMLNode**, bool) () from /lib/x86_64-linux-gnu/libtinyxml2.so.10
#1  0x00007f9f83f54646 in tinyxml2::XMLNode::ParseDeep(char*, tinyxml2::StrPair*, int*) () from /lib/x86_64-linux-gnu/libtinyxml2.so.10
#2  0x00007f9f83f522e7 in tinyxml2::XMLDocument::Parse(char const*, unsigned long) () from /lib/x86_64-linux-gnu/libtinyxml2.so.10
#3  0x00007f9f84060a1f in encfs::XmlReader::load(char const*) () from /usr/lib/encfs/libencfs.so.1.9
#4  0x00007f9f8404ded6 in encfs::readV6Config(char const*, encfs::EncFSConfig*, encfs::ConfigInfo*) () from /usr/lib/encfs/libencfs.so.1.9
#5  0x00007f9f8404c0d7 in encfs::readConfig_load(encfs::ConfigInfo*, char const*, encfs::EncFSConfig*) () from /usr/lib/encfs/libencfs.so.1.9
#6  0x00007f9f8404c508 in encfs::readConfig(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, encfs::EncFSConfig*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/lib/encfs/libencfs.so.1.9
#7  0x00007f9f8405a459 in encfs::initFS(encfs::EncFS_Context*, std::shared_ptr<encfs::EncFS_Opts> const&) () from /usr/lib/encfs/libencfs.so.1.9
#8  0x000055a7bd21ca92 in main ()

パッケージを確認すると libtinyxml2-10 のようです.

$ apt-file search -x /lib/x86_64-linux-gnu/libtinyxml2.so.10$
libtinyxml2-10: /usr/lib/x86_64-linux-gnu/libtinyxml2.so.10

http://packages.debian.org/libtinyxml2-10 から辿って古いバージョンのパッケージを入手したいと思いましたがこのときは 503 が帰ってきて利用できませんでした.
パッケージリポジトリでディレクトリを辿り https://ftp.debian.org/debian/pool/main/t/tinyxml2/ を見て libtinyxml2-10_10.0.0+dfsg-2+b2_amd64.deb を入手,インストールすることでEncFSが動くようになりました.

$ w3m -dump https://ftp.debian.org/debian/pool/main/t/tinyxml2/ | grep -E libtinyxml2 | grep amd64 | grep -v dev
[ ]         libtinyxml2-6a_7.0.0+dfsg-1_amd64.deb         2018-11-14 18:47  29K
[ ]         libtinyxml2-8_8.0.0+dfsg-2_amd64.deb          2020-05-14 06:28  30K
[ ]         libtinyxml2-9_9.0.0+dfsg-3.1_amd64.deb        2022-05-17 07:13  31K
[ ]         libtinyxml2-10_10.0.0+dfsg-2+b2_amd64.deb     2024-10-29 09:17  30K
[ ]         libtinyxml2-10_10.1.0+dfsg-1_amd64.deb        2025-03-14 06:57  30K
$ wget https://ftp.debian.org/debian/pool/main/t/tinyxml2/libtinyxml2-10_10.0.0+dfsg-2+b2_amd64.deb
$ sudo apt install ./libtinyxml2-10_10.0.0+dfsg-2+b2_amd64.deb

EncFSコマンドも動くようになりました :)

$ encfs ${HOME}/Nextcloud_matoken@files.matoken.org/Documents/encfs ${HOME}/fuse/encfs
EncFS Password:
$ ls ${HOME}/fuse/encfs/
secret-file
$ fusermount -u ${HOME}/fuse/encfs
$ 2auth-cli.sh word
EncFs Password:
matoken.org/blog(wordpress) : 209062

BTSしておこうと思ったら報告済でした.こっちを先に見たほうが解決まで早かったですね.

]]>
https://matoken.org/blog/2025/03/18/encfs-stopped-working-on-debian-sid/feed/ 0