https://bugs.documentfoundation.org/show_bug.cgi?id=153714

            Bug ID: 153714
           Summary: Silent failure to encrypt with password when
                    libnssckbi.so fails to be dynamically loaded
           Product: LibreOffice
           Version: 7.5.0.3 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: filters and storage
          Assignee: [email protected]
          Reporter: [email protected]

Hi,

Using LibreOffice 7.5.0.3 on Guix System, which is built using system
libraries, and which doesn't use the File Hierarchy Standard (FHS) layout, it
was discovered that the encrypt with password feature (in the Save dialog box)
did not work [0].

[0]  https://issues.guix.gnu.org/59292

Instead, what happens is that the file is saved unencrypted, without any
indication of a problem to the user (!).

Debugging the cause when as follow:

1. Using strace, I found that libnssckbi.so was not resolved:
```
[pid  2594] openat(AT_FDCWD,
"/home/maxim/.thunderbird/sjp3hftb.default/libnssckbi.so", O_RDONLY|O_CLOEXEC)
= -1 ENOENT (No such file or directory)
[pid  2594] openat(AT_FDCWD, "/proc/sys/crypto/fips_enabled", O_RDONLY) = -1
ENOENT (No such file or directory)
[pid  2594] openat(AT_FDCWD,
"/gnu/store/rrid5nx9cbrq0flkhc1rv4b5hk4w70ib-nspr-4.34/lib/libnssckbi.so",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  2594] openat(AT_FDCWD,
"/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libnssckbi.so",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  2594] openat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libnssckbi.so",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  2594] openat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../tls/x86_64/x86_64/libnssckbi.so",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  2594] newfstatat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../tls/x86_64/x86_64",
0x7ffead11c5b0, 0) = -1 ENOENT (No such file or directory)
[pid  2594] openat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../tls/x86_64/libnssckbi.so",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  2594] newfstatat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../tls/x86_64",
0x7ffead11c5b0, 0) = -1 ENOENT (No such file or directory)
[pid  2594] openat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../tls/x86_64/libnssckbi.so",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  2594] newfstatat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../tls/x86_64",
0x7ffead11c5b0, 0) = -1 ENOENT (No such file or directory)
[pid  2594] openat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../tls/libnssckbi.so",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  2594] newfstatat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../tls",
0x7ffead11c5b0, 0) = -1 ENOENT (No such file or directory)
[pid  2594] openat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../x86_64/x86_64/libnssckbi.so",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  2594] newfstatat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../x86_64/x86_64",
0x7ffead11c5b0, 0) = -1 ENOENT (No such file or directory)
[pid  2594] openat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../x86_64/libnssckbi.so",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  2594] newfstatat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../x86_64",
0x7ffead11c5b0, 0) = -1 ENOENT (No such file or directory)
[pid  2594] openat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../x86_64/libnssckbi.so",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  2594] newfstatat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../x86_64",
0x7ffead11c5b0, 0) = -1 ENOENT (No such file or directory)
[pid  2594] openat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../libnssckbi.so",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  2594] newfstatat(AT_FDCWD,
"/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../..",
{st_mode=S_IFDIR|0555, st_size=1762, ...}, 0) = 0
[pid  2594] openat(AT_FDCWD,
"/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libnssckbi.so",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  2594] openat(AT_FDCWD,
"/gnu/store/3kb0qgqw9x0x82kgygj927z28wc1m6yy-libreoffice-7.5.0.3/lib/libreoffice/program/../share/config/soffice.cfg/uui/ui/password.ui",
O_RDONLY) = 21
[pid  2594] newfstatat(21, "", {st_mode=S_IFREG|0444, st_size=7723, ...},
AT_EMPTY_PATH) = 0
[pid  2594] access("/.flatpak-info", F_OK) = -1 ENOENT (No such file or
directory)
```
2. Enabling the '--enable-sal-log' configure flag and running LibreOffice with
SAL_LOG=+INFO, I saw the following relevant output:
```
info:sal.bootstrap:8927:8927:sal/rtl/bootstrap.cxx:857: expandMacros called
with: libnssckbi.so
info:sal.bootstrap:8927:8927:sal/rtl/bootstrap.cxx:985: expandMacros result:
libnssckbi.so
info:xmlsecurity.xmlsec:8927:8927:xmlsecurity/source/xmlsec/nss/nssinitializer.cxx:471:
FAILED to load the new root certificate module Root Certs for
OpenOffice.orgcontained in libnssckbi.so
warn:legacy.osl:8927:8927:comphelper/source/misc/storagehelper.cxx:406: Can not
create SHA256 digest!
warn:package.xstor:8927:8927:package/source/xstor/owriteablestream.cxx:1138:
Can't write encryption related properties com.sun.star.uno.RuntimeException
message: "No expected key is provided! at
/tmp/guix-build-libreoffice-7.5.0.3.drv-0/libreoffice-7.5.0.3/package/source/zippackage/ZipPackageStream.cxx:243"
info:package.xstor:8927:8927:package/source/xstor/xstorage.cxx:2274: Rethrow
com.sun.star.io.IOException message: "No expected key is provided! at
/tmp/guix-build-libreoffice-7.5.0.3.drv-0/libreoffice-7.5.0.3/package/source/zippackage/ZipPackageStream.cxx:243
at
/tmp/guix-build-libreoffice-7.5.0.3.drv-0/libreoffice-7.5.0.3/package/source/xstor/owriteablestream.cxx:1140"
```

So there appears to be an actual error, which is ignored.

LibreOffice should perhaps link directly to that `libnssckbi.so` instead of
attempting to dynamically load it, as it already knows where a system NSS is
from configure time.  Guix would then add an entry to the RUNPATH baked in the
ELF via its custom ld wrapper script and things would "just works".

My current workaround is to add the following before the oosplash exec call in
the soffice.sh script:

```
export
LD_LIBARY_PATH=/gnu/store/9qyvv4iwnxj8i8687w7cw7ibhz77n2vm-nss-3.81/lib/nss${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
```

Thanks for LibreOffice!

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to