Add support of Unix socket (#912)
Reviewed-on: https://kolaente.dev/vikunja/api/pulls/912 Reviewed-by: konrad <konrad@kola-entertainments.de> Co-authored-by: andreymal <andriyano-31@mail.ru> Co-committed-by: andreymal <andriyano-31@mail.ru>
This commit is contained in:
25
pkg/utils/umask_unix.go
Normal file
25
pkg/utils/umask_unix.go
Normal file
@ -0,0 +1,25 @@
|
||||
// Vikunja is a to-do list application to facilitate your life.
|
||||
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public Licensee as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public Licensee for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public Licensee
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// +build !windows
|
||||
|
||||
package utils
|
||||
|
||||
import "golang.org/x/sys/unix"
|
||||
|
||||
func Umask(mask int) int {
|
||||
return unix.Umask(mask)
|
||||
}
|
24
pkg/utils/umask_windows.go
Normal file
24
pkg/utils/umask_windows.go
Normal file
@ -0,0 +1,24 @@
|
||||
// Vikunja is a to-do list application to facilitate your life.
|
||||
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public Licensee as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public Licensee for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public Licensee
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// +build windows
|
||||
|
||||
package utils
|
||||
|
||||
// Windows doesn't provide the umask syscall, so there is a no-op stub.
|
||||
func Umask(mask int) int {
|
||||
return 077
|
||||
}
|
Reference in New Issue
Block a user