fix: potential file inclusion via variable

This commit is contained in:
lilong.129
2025-04-28 21:09:39 +08:00
parent 7132eec39e
commit da5042f0a4
6 changed files with 7 additions and 7 deletions

View File

@@ -701,7 +701,7 @@ func (ad *ADBDriver) StopCaptureLog() (result interface{}, err error) {
return pointRes, nil
}
reader, err := os.OpenFile(files[0], os.O_RDONLY, 0o666)
reader, err := os.OpenFile(files[0], os.O_RDONLY, 0o600)
if err != nil {
log.Info().Msg("open File error")
return pointRes, nil

View File

@@ -970,7 +970,7 @@ func (wd *WDADriver) StartCaptureLog(identifier ...string) error {
func (wd *WDADriver) PushImage(localPath string) error {
log.Info().Str("localPath", localPath).Msg("WDADriver.PushImage")
localFile, err := os.OpenFile(localPath, os.O_RDONLY, 0o666)
localFile, err := os.OpenFile(localPath, os.O_RDONLY, 0o600)
if err != nil {
return err
}