Skip to content

Commit

Permalink
Reject UserInfo values that do not satisfy validate_name
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Mar 19, 2024
1 parent 9ef2fb2 commit 8f66253
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/engine/sim_engine/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ impl Pool for SimPool {
uuid: DevUuid,
user_info: Option<&str>,
) -> StratisResult<RenameAction<DevUuid>> {
user_info.map(validate_name).transpose()?;
Ok(self.get_mut_blockdev_internal(uuid).map_or_else(
|| RenameAction::NoSource,
|(_, b)| {
Expand Down
1 change: 1 addition & 0 deletions src/engine/strat_engine/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,7 @@ impl Pool for StratPool {
uuid: DevUuid,
user_info: Option<&str>,
) -> StratisResult<RenameAction<DevUuid>> {
user_info.map(validate_name).transpose()?;
let result = self.backstore.set_blockdev_user_info(uuid, user_info);
match result {
Ok(Some(uuid)) => {
Expand Down

0 comments on commit 8f66253

Please sign in to comment.