mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
While at it, implement function to open log file on Windows for sharing delete. So the log file could be backup correctly. This may fix #303
16 lines
246 B
Go
16 lines
246 B
Go
//go:build !windows
|
|
|
|
package cli
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
func hasElevatedPrivilege() (bool, error) {
|
|
return os.Geteuid() == 0, nil
|
|
}
|
|
|
|
func openLogFile(path string, flags int) (*os.File, error) {
|
|
return os.OpenFile(path, flags, os.FileMode(0o600))
|
|
}
|