Skip to content

Commit 395f459

Browse files
committed
Fixes some typos in some messages.
1 parent e96010e commit 395f459

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Management-Utilities/Workload-Factory-API-Samples/volume_cifs_share_create

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Where: refresh_token - Is a refresh token used to obtain an access token needed
3232
aws_region - is the AWS region where the FSx file systems are located
3333
filesystem_id - is the AWS file system ID of the FSx file system where the volume resides
3434
volume_ID - is the AWS volume ID of the volume where you want to create the cifs share.
35-
cifs_share_name - is the name of the share to create
35+
cifs_share_name - is the name of the share to create. Only alphanumeric characters, underscores and dashes are allowed.
3636
3737
Instead of passing parameters on the command line, you can set the
3838
following environment variables:
@@ -84,12 +84,12 @@ done
8484
#
8585
# Declare an array of required options and the error message to display if they are not set.
8686
declare -A required_options
87-
required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to run this script. It can be obtain from this web page:
87+
required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh token is required to run this script. It can be obtain from this web page:
8888
https://services.cloud.netapp.com/refresh-token\n\n'
8989
required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script.
9090
You can get the list of accounts you have access to by running the "list_bluexp_accts" script
9191
found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n'
92-
required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to delete is required.
92+
required_options["CREDENTIALS_ID"]='Error: A Worload Factory Credential ID is required to run this script.
9393
You can get a list of credentials by running the "list_credentials" script
9494
found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n'
9595
required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n'
@@ -120,6 +120,11 @@ run_curl GET "$token" "https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUN
120120
cifsShares=$(jq -r '.cifsShares' $tmpout)
121121
#
122122
# Create a new share definition.
123+
# Check that the CIFS_SHARE_NAME only contains allowed characters (alphanumeric, underscores and dashes).
124+
if [[ ! "$CIFS_SHARE_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then
125+
echo "Error: The CIFS share name can only contain alphanumeric characters, underscores and dashes." >&2
126+
exit 1
127+
fi
123128
newShare='{"name":"'$CIFS_SHARE_NAME'","path":"'/$CIFS_SHARE_NAME'","acls":[{"userOrGroup":"Everyone","permission":"full_control","type":"windows"}]}'
124129
#
125130
# Add the new share to the existing ones.

0 commit comments

Comments
 (0)