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

bad test checking for default group [patch] #95

Closed
LocutusOfBorg opened this issue Jul 16, 2019 · 8 comments
Closed

bad test checking for default group [patch] #95

LocutusOfBorg opened this issue Jul 16, 2019 · 8 comments

Comments

@LocutusOfBorg
Copy link

Hello, some build environments (e.g. launchpad builders) don't have a default group, so we have a failure in


ERROR: sharing_allowed_test
===========================

Unable to determine my default group nameERROR sharing_allowed_test (exit status: 99)

https://launchpadlibrarian.net/433273991/buildlog_ubuntu-eoan-amd64.globus-gridftp-server_13.11-2_BUILDING.txt.gz

we patched the source to not fail on that test...
Is it possible to have some upstream workaround or to disable that test?
this is the "patch"
http://launchpadlibrarian.net/433274011/globus-gridftp-server_13.11-2_13.11-2ubuntu1.diff.gz

--- globus-gridftp-server-13.8.orig/test/sharing_allowed_test.c
+++ globus-gridftp-server-13.8/test/sharing_allowed_test.c
@@ -128,7 +128,7 @@ int main()
     if (grent == NULL)
     {
         fprintf(stderr, "Unable to determine my default group name");
-        exit(99);
+        exit(77);
     }
     my_default_group = strdup(grent->gr_name);
     if (my_default_group == NULL)
@msalle
Copy link
Member

msalle commented Jul 16, 2019

Hi, I actually think there are two issues.
Firstly, there might not be any secondary gids, in which case getgroups() in line 126 will return 0 and my_groups[0] should not be used (it will probably be 0). It could also return a -1 on error, and also then my_groups[0] should not be used.
Secondly, there might be secondary gids, but the mapping from gid to a group name might not exist for various reasons. The latter case will give grent == NULL, your scenario.

@LocutusOfBorg
Copy link
Author

So, is it ok to patch this?

@msalle
Copy link
Member

msalle commented Jul 16, 2019

I agree it needs fixing in the test. Probably by using getgid() instead of my_groups[0] in case rc==0 and producing a real error in case rc==-1.
I'll try to make a pull request, but it might take some days.

@msalle
Copy link
Member

msalle commented Jul 16, 2019

Ok, here is #96
Assuming launchpad does actually provide groupnames (otherwise it's a launchpad bug I'd say), I think this should fix your issue.

@LocutusOfBorg
Copy link
Author

Looks like it didn't work...

umask 077; /usr/bin/openssl genrsa -out testcred.key 2048
:
Generating RSA private key, 2048 bit long modulus (2 primes)
....+++++
..............+++++
e is 65537 (0x010001)
/usr/bin/openssl req -subj "/CN=test" -new -key testcred.key -out testcred.req -config testcred.cnf
Can't load /sbuild-nonexistent/.rnd into RNG
4396691720992:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:98:Filename=/sbuild-nonexistent/.rnd
Cannot write random bytes:
4396691720992:error:24070079:random number generator:RAND_write_file:Cannot open file:../crypto/rand/randfile.c:233:Filename=/sbuild-nonexistent/.rnd
umask 022; /usr/bin/openssl x509 -passin pass:globus -req -days 365 -in testcred.req -CA testcred.cacert -CAkey testcred.cakey -out testcred.cert
Signature ok
subject=CN = test
Getting CA Private Key
make[5]: Entering directory '/<<PKGBUILDDIR>>/test'
PASS: ipc-test
PASS: cmp_alias_ent_test
PASS: error_response_test
ERROR: sharing_allowed_test
PASS: setup-chroot-test
======================================================
   globus_gridftp_server 13.11: test/test-suite.log
======================================================

# TOTAL: 5
# PASS:  4
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 1

.. contents:: :depth: 2

ERROR: sharing_allowed_test
===========================

Unable to determine my default group name (gid 110)
ERROR sharing_allowed_test (exit status: 99)

============================================================================
Testsuite summary for globus_gridftp_server 13.11
============================================================================
# TOTAL: 5
# PASS:  4
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 1
============================================================================
See test/test-suite.log
Please report to https://github.com/gridcf/gct/issues

@msalle
Copy link
Member

msalle commented Jul 17, 2019

I would say that if launchpad doesn't provide a groupname for gid 110, that's a bug in the launchpad build environment. There actually is already an open bug for that: https://bugs.launchpad.net/launchpad-buildd/+bug/1820348
I suggest for the time being you could disable the test in your packaging on launchpad?

@LocutusOfBorg
Copy link
Author

thanks, I reported my bug too, and marked as duplicate of that one...
Msalle for now the test is already disabled, thanks! I think we can close this upstream issue

@fscheiner
Copy link
Member

fscheiner commented Feb 26, 2021

Fixed in GCT v6.2.20190906.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants