feat: 任务周期备份配置文件发送ftp备份
This commit is contained in:
@@ -331,7 +331,7 @@ func (s *FileController) File(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 检查路径是否在允许的目录范围内
|
||||
allowedPaths := []string{"/var/log", "/tmp", "/usr/local/omc/backup"}
|
||||
allowedPaths := []string{"/var/log", "/tmp", "/usr/local/omc/backup", "/usr/local/etc/omc"}
|
||||
allowed := false
|
||||
for _, p := range allowedPaths {
|
||||
if strings.HasPrefix(querys.Path, p) {
|
||||
@@ -382,7 +382,7 @@ func (s *FileController) Remove(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 检查路径是否在允许的目录范围内
|
||||
allowedPaths := []string{"/tmp", "/usr/local/omc/backup"}
|
||||
allowedPaths := []string{"/tmp", "/usr/local/omc/backup", "/usr/local/etc/omc"}
|
||||
allowed := false
|
||||
for _, p := range allowedPaths {
|
||||
if strings.HasPrefix(querys.Path, p) {
|
||||
|
||||
Reference in New Issue
Block a user