From 7c8e2a388e06d692c4f00274135caed04dbd5cb0 Mon Sep 17 00:00:00 2001 From: Mark van Holsteijn Date: Thu, 5 Aug 2021 15:34:00 +0200 Subject: [PATCH] bumped to release 0.4.6 --- .release | 4 ++-- main.go | 2 +- umask.go | 9 +++++++++ umask_windows.go | 10 ++++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 umask.go create mode 100644 umask_windows.go diff --git a/.release b/.release index 9cdc6db..26cac6c 100644 --- a/.release +++ b/.release @@ -1,2 +1,2 @@ -release=0.4.5 -tag=v0.4.5 +release=0.4.6 +tag=v0.4.6 diff --git a/main.go b/main.go index 7f2fb17..30f0f4b 100644 --- a/main.go +++ b/main.go @@ -117,7 +117,7 @@ func (m *Main) initialize() { log.Printf("INFO: setting umask to %04o\n", mask) } - syscall.Umask(int(mask)) + setUmask(int(mask)) } m.client, m.clientError = secretmanager.NewClient(m.ctx, option.WithCredentials(m.credentials)) } diff --git a/umask.go b/umask.go new file mode 100644 index 0000000..0c51213 --- /dev/null +++ b/umask.go @@ -0,0 +1,9 @@ +// +build !windows + +package main + +import "syscall" + +func setUmask(mask int) int { + return syscall.Umask(mask) +} diff --git a/umask_windows.go b/umask_windows.go new file mode 100644 index 0000000..611277c --- /dev/null +++ b/umask_windows.go @@ -0,0 +1,10 @@ +//build +windows + +package main + +import "log" + +func setUmask(mask int) int { + log.Printf("INFO: umask %04d is not supported on Windows\n", mask) + return 0 +}