Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAIL: test-token 6 /token/not-writable #288

Closed
noloader opened this issue Apr 2, 2020 · 4 comments · Fixed by #292
Closed

FAIL: test-token 6 /token/not-writable #288

noloader opened this issue Apr 2, 2020 · 4 comments · Fixed by #292

Comments

@noloader
Copy link

noloader commented Apr 2, 2020

Hi Everyone,

I'm building GnuTLS on an old PowerMac. One of the distant dependencies is P11-Kit. P11-Kit is being built from the 0.23.19 release tarball. The issue is also present in 0.23.20 release tarball.

make check is showing one failure:

$ make check
...
PASS: test-token 1 /token/load
PASS: test-token 2 /token/flags
PASS: test-token 3 /token/path
PASS: test-token 4 /token/label
PASS: test-token 5 /token/slot
FAIL: test-token 6 /token/not-writable
# test-token: assertion failed (!p11_token_is_writable (token))
# test-token: in test_not_writable() at test-token.c:244
PASS: test-token 7 /token/writable-no-exist
PASS: test-token 8 /token/writable-exists
PASS: test-token 9 /token/load-found
PASS: test-token 10 /token/load-already
...
# TOTAL: 761
# PASS:  760
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

I have not noticed the failure on other platforms, but I may have missed it. There's a massive wall of text when the script runs so I probably miss a lot of things I should tend to.

Please let me know what else you would like to help resolve the issue.

Also see Compiling issue on fresh linux from scratch built, which appears to be the same issue on LFS.

@noloader
Copy link
Author

noloader commented Apr 2, 2020

Here are the latest logs from the 0.23.20 build.

Here are the options used to build 0.20.23. All prerequisites are built and installed in /usr/local. All prerequisites are built with the same options.

Common flags and options:

  BITNESS: 32-bits
   PREFIX: /usr/local
   LIBDIR: /usr/local/lib

 AUTOCONF_BUILD: powerpc-apple-darwin9.8.0
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
       CPPFLAGS: -I/usr/local/include -DNDEBUG
         CFLAGS: -g2 -O2 -fPIC -pthread
       CXXFLAGS: -g2 -O2 -fPIC -pthread
        LDFLAGS: -L/usr/local/lib -Wl,-rpath,@loader_path/../lib -Wl,-rpath,/usr/local/lib
         LDLIBS: -ldl -lpthread

@ueno
Copy link
Member

ueno commented Apr 13, 2020

The test assumes that the normal user cannot write anything to /. Perhaps we could tighten the check by actually trying to write, in addition to getuid() != 0.

@noloader
Copy link
Author

noloader commented Apr 13, 2020

Thanks @ueno . I could not figure out what that test was trying to do. I thought / was the root of some virtual filesystem tree.

Something else that might be helpful is a chmod a-w. Due to Busybox you have to use the letters, and not the octal codes. After the test is complete chmod a+w and then delete the file.

ueno added a commit to ueno/p11-kit that referenced this issue Apr 13, 2020
Instead of assuming a normal user cannot write to "/", this creates an
unwritable directly and checks if it is writable; otherwise the test
case is skipped.

Reported by Jeffrey Walton in:
p11-glue#288
@ueno
Copy link
Member

ueno commented Apr 13, 2020

Something else that might be helpful is a chmod a-w.

Yes, in #292 I tried to emulate the similar.

ueno added a commit to ueno/p11-kit that referenced this issue Apr 20, 2020
Instead of assuming a normal user cannot write to "/", this creates an
unwritable directly and checks if it is writable; otherwise the test
case is skipped.

Reported by Jeffrey Walton in:
p11-glue#288
@ueno ueno closed this as completed in #292 Apr 20, 2020
ueno added a commit that referenced this issue Apr 20, 2020
Instead of assuming a normal user cannot write to "/", this creates an
unwritable directly and checks if it is writable; otherwise the test
case is skipped.

Reported by Jeffrey Walton in:
#288
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants