2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00

fix: 修改权限不使用sudo

This commit is contained in:
耗子
2024-10-25 02:43:33 +08:00
parent 5dce30523b
commit 2225e59ca6

View File

@@ -25,13 +25,13 @@ func Mkdir(path string, permission os.FileMode) error {
// Chmod 修改文件/目录权限
func Chmod(path string, permission os.FileMode) error {
cmd := exec.Command("sudo", "chmod", "-R", fmt.Sprintf("%o", permission), path)
cmd := exec.Command("chmod", "-R", fmt.Sprintf("%o", permission), path)
return cmd.Run()
}
// Chown 修改文件或目录所有者
func Chown(path, user, group string) error {
cmd := exec.Command("sudo", "chown", "-R", user+":"+group, path)
cmd := exec.Command("chown", "-R", user+":"+group, path)
return cmd.Run()
}