mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 06:47:20 +08:00
fix: 修改权限不使用sudo
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user