Skip to content

Commit

Permalink
Minor adjustment of restricted chars and addition of restricted char …
Browse files Browse the repository at this point in the history
…check for manual ctag adjustment
  • Loading branch information
gransom committed Jun 25, 2024
1 parent 5550487 commit 20fadce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/api/marfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ int marfs_setctag( marfs_ctxt ctxt, const char* ctag ) {
LOG( LOG_INFO, "EXIT - Failure w/ \"%s\"\n", strerror(errno) );
return -1;
}
if ( restrictedchars_check( ctag ) ) {
LOG( LOG_ERR, "Received a ctag string containing restricted characters\n" );
errno = EINVAL;
LOG( LOG_INFO, "EXIT - Failure w/ \"%s\"\n", strerror(errno) );
return -1;
}
// duplicate the client string
char* newctag = strdup( ctag );
if ( newctag == NULL ) {
Expand Down
2 changes: 1 addition & 1 deletion src/general_include/restrictedchars.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ GNU licenses can be found at http://www.gnu.org/licenses/.
// NOTE: This file is intended for direct, inline inclusion in other SRC files


#define RESTRICTEDCHARS_STRING "/()|#"
#define RESTRICTEDCHARS_STRING "/()|#^*"

// parse over a provided string to check for restricted chars
int restrictedchars_check( const char* str ) {
Expand Down

0 comments on commit 20fadce

Please sign in to comment.