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

Fix compilation on 32bit architectures such as i386, armhf #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

siretart
Copy link

@siretart siretart commented Oct 20, 2024

On those architectures, the tests fail to build with an overflow error:

src/github.com/cyphar/filepath-securejoin/mkdir_linux_test.go:254:8: constant 2147484159 overflows int FAIL
github.com/cyphar/filepath-securejoin [build failed]

Turns out that FileMode is defined as an uint32 in the os.fs package. Since MkdirAll is intended as a replacement for os.MkdirAll, it makes sense to use the same types for all arguments, and that means os.FileMode for the mode parameter.

On those architectures, the tests fail to build with an overflow error:

src/github.com/cyphar/filepath-securejoin/mkdir_linux_test.go:254:8: constant 2147484159 overflows int
FAIL	github.com/cyphar/filepath-securejoin [build failed]

Turns out that FileMode is defined as an uint32 in the os.fs package.
Since `MkdirAll` is intended as a replacement for os.MkdirAll, it makes
sense to use the same types for all arguments, and that means os.FileMode
for the mode parameter.

Signed-off-by: Reinhard Tartler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant