Skip to content

Commit

Permalink
refactor(File): 잘못된 호출 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
limehee committed Oct 1, 2024
1 parent 6549677 commit 51910f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/stempo/api/global/util/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public static void setFilePermissions(File file, String savePath, String baseDir
if (os.contains("win")) {
setReadOnlyPermissionsWindows(file, savePath, baseDirectory);
} else {
FileUtil.setReadOnlyPermissionsUnix(savePath, baseDirectory);
setReadOnlyPermissionsUnix(savePath, baseDirectory);
}
} catch (Exception e) {
throw new FilePermissionException("Failed to set file permissions: " + LogSanitizerUtil.sanitizeForLog(savePath));
Expand All @@ -144,7 +144,7 @@ public static void setFilePermissions(File file, String savePath, String baseDir
* @throws FilePermissionException 파일 권한 설정에 실패한 경우 발생
*/
public static void setReadOnlyPermissionsWindows(File file, String savePath, String baseDirectory) {
FileUtil.validateFilePath(file.getPath(), baseDirectory);
validateFilePath(file.getPath(), baseDirectory);
if (!file.setReadOnly()) {

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
This path depends on a
user-provided value
.
throw new FilePermissionException("Failed to set file read-only: " + LogSanitizerUtil.sanitizeForLog(savePath));
}
Expand All @@ -157,7 +157,7 @@ public static void setReadOnlyPermissionsWindows(File file, String savePath, Str
* @throws IOException 권한 설정 실패 시 발생
*/
public static void setReadOnlyPermissionsUnix(String filePath, String baseDirectory) throws IOException {
FileUtil.validateFilePath(filePath, baseDirectory);
validateFilePath(filePath, baseDirectory);
Path path = Paths.get(filePath);

// POSIX 파일 권한을 소유자에게만 읽기 권한을 부여하도록 설정
Expand Down

0 comments on commit 51910f2

Please sign in to comment.