Fix compatibility with procps 4.
Negative UIDs are no longer allowed. Use a very high one instead.
Taken from upstream:
https://github.com/ganeti/ganeti/commit/9cd67e6a81c66ed326d68ea8c3241d14eea6550b
diff --git a/test/py/ganeti.uidpool_unittest.py b/test/py/ganeti.uidpool_unittest.py
index b2f5bc5cf2..2d9227cbf5 100755
--- a/test/py/ganeti.uidpool_unittest.py
+++ b/test/py/ganeti.uidpool_unittest.py
@@ -106,23 +106,24 @@ def testRequestUnusedUid(self):
# Check with a single, known unused user-id
#
- # We use "-1" here, which is not a valid user-id, so it's
- # guaranteed that it's unused.
- uid = uidpool.RequestUnusedUid(set([-1]))
- self.assertEqualValues(uid.GetUid(), -1)
+ # We use 2^30+42 here, which is a valid UID, but unlikely to be used on
+ # most systems (even as a subuid).
+ free_uid = 2**30 + 42
+ uid = uidpool.RequestUnusedUid(set([free_uid]))
+ self.assertEqualValues(uid.GetUid(), free_uid)
# Check uid-pool exhaustion
#
- # uid "-1" is locked now, so RequestUnusedUid is expected to fail
+ # free_uid is locked now, so RequestUnusedUid is expected to fail
self.assertRaises(errors.LockError,
uidpool.RequestUnusedUid,
- set([-1]))
+ set([free_uid]))
# Check unlocking
uid.Unlock()
# After unlocking, "-1" should be available again
- uid = uidpool.RequestUnusedUid(set([-1]))
- self.assertEqualValues(uid.GetUid(), -1)
+ uid = uidpool.RequestUnusedUid(set([free_uid]))
+ self.assertEqualValues(uid.GetUid(), free_uid)
if __name__ == "__main__":
uild/linux-container.scm'>
linux-container: 'container-excursion' forks to join the PID namespace....Fixes <https://issues.guix.gnu.org/61156>.
* gnu/build/linux-container.scm (container-excursion): Add extra call to
'primitive-fork' and invoke THUNK in the child process.
* tests/containers.scm ("container-excursion"): Remove extra
'primitive-fork' call, now unnecessary.
("container-excursion*, /proc"): New test.
Ludovic Courtès
2023-01-30
container: Correctly report exit status....* gnu/build/linux-container.scm (container-excursion): Return the raw
status value.
* tests/containers.scm ("container-excursion, same namespaces"): Add
'status:exit-val' call.
* guix/scripts/container/exec.scm (guix-container-exec): Correctly
handle the different cases.
linux-container: 'container-excursion*' marks its FDs as FD_CLOEXEC....Fixes <https://issues.guix.gnu.org/57827>.
Reported by Mathieu Othacehe <othacehe@gnu.org>.
Fixes a regression introduced with the Shepherd 0.9.2 upgrade in
1ba0e38267c9ff8bb476285091be6e297bbf136e, whereby IN and OUT would no
longer be closed when 'fork+exec-command/container' would call
'exec-command*' as part of the THUNK passed to 'container-excursion*'.
This is because the Shepherd 0.9.2 assumes file descriptors are properly
marked as O_CLOEXEC and, consequently, 'exec-command' no longer run the
close(2) loop prior to 'exec'.
* gnu/build/linux-container.scm (container-excursion*): Add calls to
'fcntl'.