fix FTBFS on i686
authorDmitry Smirnov <onlyjob@debian.org>
Sun, 26 Jan 2020 09:24:01 +0000 (09:24 +0000)
committerDmitry Smirnov <onlyjob@debian.org>
Sun, 26 Jan 2020 09:24:01 +0000 (09:24 +0000)
Last-Update: 2018-06-16
Forwarded: https://github.com/opencontainers/runc/pull/1821
Bug-Upstream: https://github.com/opencontainers/runc/issues/941

src/github.com/opencontainers/runc/libcontainer/user/user_test.go:448:36: constant 2147483648 overflows int

Gbp-Pq: Name test--fix_TestGetAdditionalGroups.patch

libcontainer/user/user.go
libcontainer/user/user_test.go

index 7b912bbf8b44fef879ac7b47c0d6a03e00ee1224..38cadedf505bb7ae228e257f3c1adf786f62ffc7 100644 (file)
@@ -473,7 +473,7 @@ func GetAdditionalGroups(additionalGroups []string, group io.Reader) ([]int, err
                                return nil, fmt.Errorf("Unable to find group %s", ag)
                        }
                        // Ensure gid is inside gid range.
-                       if gid < minId || gid > maxId {
+                       if gid < minId || gid >= maxId {
                                return nil, ErrRange
                        }
                        gidMap[gid] = struct{}{}
index 24ee559e13a48a5dc21490e308eab593d07593b0..a4aabdc0be0b4524f64515c14c11733fd358f2ba 100644 (file)
@@ -445,7 +445,7 @@ this is just some garbage data
        if utils.GetIntSize() > 4 {
                tests = append(tests, foo{
                        // groups with too large id
-                       groups:   []string{strconv.Itoa(1 << 31)},
+                       groups:   []string{strconv.Itoa( 1<<31 -1 )},
                        expected: nil,
                        hasError: true,
                })