Skip to content

Commit

Permalink
update regex for chmod
Browse files Browse the repository at this point in the history
  • Loading branch information
v-kkhuang committed Dec 18, 2023
1 parent aad99d5 commit 4c30039
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1190,8 +1190,8 @@ public Message chmod(
if (StringUtils.isEmpty(filePermission)) {
return Message.error(MessageFormat.format(PARAMETER_NOT_BLANK, filePermission));
} else {
Matcher matcher = Pattern.compile("[0-7]{3}").matcher(filePermission);
if (matcher.matches()) {
Matcher matcher = Pattern.compile("^[0-7]{3}$").matcher(filePermission.trim());
if (!matcher.matches()) {
return Message.error(MessageFormat.format(PERMISSION_FORMAT_ERROR, filePermission));
}
}
Expand Down

0 comments on commit 4c30039

Please sign in to comment.