single or double quote in job env value, and the quote is not the last character in the value, causes qsub -V to lose env variable value as well as other variables when execjob_launch hook is present

Description

Given a system with execjob_launch hook enabled.

The problem is that an embedded single quote or double quote that does not appear as the LAST character in the environment value, causes that environment to not get set. Also any environment variables after that (to be processed next) get "eaten" up by mom parsing. This results in other environment variables to get unset.

The following will trigget this problem:
export hello='happy days"are"here to stay'
export bello="happy'days"
export dello="the days'are here now'then"
export iello='nothing compares" to you'
qsub -V -I
% echo $dello
<-- empty as well as environment variables after that
% echo $PBS_MOMPORT
<-- empty

% echo $LESSCLOSE
lessclose.sh %s %s <-- not empty due environment variable processed before $dello

Looking at the mom hooks's *.out file under /var/spool/pbs/mom_priv/hooks/tmp, with the hook's debug=t, one sees:
LESSCLOSE=lessclose.sh %s %s,USE_FAM=,dello=the days'are here now'then,PBS_MOMPORT=15003,...


The following will not trigger the problem as the single or double quote is the LAST character in the value...

export gello='"'
export nello='the way that was"'
export pello='"music makes the people"'
export fello="'"
export mello="the way it is'"
export pello="'music makes the people come together'"

Acceptance Criteria

None

Status

Assignee

Unassigned

Reporter

Al Bayucan

Severity

None

OS

None

Start Date

None

Pull Request URL

None

Story Points

1

Components

Priority

Low
Configure