From 3c15a7a05bd7673d2ca4650dd1525df408d20728 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 2 Jun 2020 17:09:21 -0700 Subject: travis.yml: build 32-bit binary Don't let people check in code that breaks 32-bit builds. Update https://github.com/google/fscrypt/issues/233 --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1a1686d..8cd01d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,6 +46,13 @@ jobs: - <<: *build go: 1.11.x + - name: Build and Unit Tests (32-bit) + before_install: + - sudo apt-get -y install gcc-multilib libpam0g-dev:i386 + script: + - GO111MODULE=on go get github.com/google/fscrypt/cmd/fscrypt + - CGO_ENABLED=1 GOARCH=386 make + - name: Integration Tests sudo: required before_install: sudo apt-get -y install e2fsprogs -- cgit v1.2.3 From 3b075f2fda880256b3d9de2e6197a224adc0a39f Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 2 Jun 2020 17:17:54 -0700 Subject: cmd/fscrypt: fix 32-bit build statfs.Bsize actually has platform-dependent type, despite the Go documentation listing it as int64. Fix the build for 32-bit platforms by casting it to int64. Resolves https://github.com/google/fscrypt/issues/233 --- cmd/fscrypt/errors.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/fscrypt/errors.go b/cmd/fscrypt/errors.go index 8bdab6e..10d744a 100644 --- a/cmd/fscrypt/errors.go +++ b/cmd/fscrypt/errors.go @@ -117,8 +117,8 @@ func suggestEnablingEncryption(mnt *filesystem.Mount) string { if err := unix.Statfs(mnt.Path, &statfs); err != nil { return "" } - pagesize := int64(os.Getpagesize()) - if statfs.Bsize != pagesize && !util.IsKernelVersionAtLeast(5, 5) { + pagesize := os.Getpagesize() + if int64(statfs.Bsize) != int64(pagesize) && !util.IsKernelVersionAtLeast(5, 5) { return fmt.Sprintf(`This filesystem uses a block size (%d) other than the system page size (%d). Ext4 encryption didn't support this case until kernel v5.5. -- cgit v1.2.3