[lxc-devel] [lxd/master] shared/idmap: Workaround Go tip change

stgraber on Github lxc-bot at linuxcontainers.org
Thu Dec 6 01:18:08 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20181206/269ec59c/attachment.bin>
-------------- next part --------------
From 0d30baebd4d83ba3c2e84f94984dcd31e7a7ba59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Wed, 5 Dec 2018 19:03:24 -0500
Subject: [PATCH] shared/idmap: Workaround Go tip change
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 shared/idmap/shift_linux.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/shared/idmap/shift_linux.go b/shared/idmap/shift_linux.go
index 79c97d23f3..3aee917148 100644
--- a/shared/idmap/shift_linux.go
+++ b/shared/idmap/shift_linux.go
@@ -218,13 +218,13 @@ func ShiftACL(path string, shiftIds func(uid int64, gid int64) (int64, int64)) e
 	return nil
 }
 
-func shiftAclType(path string, aclType _Ctype_acl_type_t, shiftIds func(uid int64, gid int64) (int64, int64)) error {
+func shiftAclType(path string, aclType int, shiftIds func(uid int64, gid int64) (int64, int64)) error {
 	// Convert the path to something usable with cgo
 	cpath := C.CString(path)
 	defer C.free(unsafe.Pointer(cpath))
 
 	// Read the current ACL set for the requested type
-	acl := C.acl_get_file(cpath, aclType)
+	acl := C.acl_get_file(cpath, C.uint(aclType))
 	if acl == nil {
 		return nil
 	}
@@ -290,7 +290,7 @@ func shiftAclType(path string, aclType _Ctype_acl_type_t, shiftIds func(uid int6
 
 	// Update the on-disk ACLs to match
 	if update {
-		ret := C.acl_set_file(cpath, aclType, newAcl)
+		ret := C.acl_set_file(cpath, C.uint(aclType), newAcl)
 		if ret == -1 {
 			return fmt.Errorf("Failed to change ACLs on %s", path)
 		}


More information about the lxc-devel mailing list