cmd/cli: cleanup more ctrld generated files

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
This commit is contained in:
Cuong Manh Le
2024-08-07 15:51:11 +07:00
committed by Cuong Manh Le
parent 905f2d08c5
commit 18a19a3aa2
4 changed files with 87 additions and 9 deletions
+4
View File
@@ -9,3 +9,7 @@ import (
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))
}