Print more YAML compatible special chars for jobid.
Currently they are any of ".@-_:/".
Test-Parameters: trivial
Fixes:
338381574b ("LU-11407 tgt: cleanup job_stats output printing")
Signed-off-by: Lei Feng <flei@whamcloud.com>
Change-Id: Ic3272b73c95b76ad3171cc7a368a18f804b9aa3e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49998
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
for (c = job->js_jobid, end = job->js_jobid + sizeof(job->js_jobid);
c < end && *c != '\0';
c++, joblen++) {
- if (!isalnum(*c) &&
- *c != '.' && *c != '@' && *c != '-' && *c != '_') {
+ if (!isalnum(*c) && strchr(".@-_:/", *c) == NULL) {
quote = "\"";
snprintf(escaped + joblen, sizeof(escaped), "\\x%02X",
(unsigned char)*c);