Does the shell spec clearly indicate what characters can make a valid
environment variable? I don't remember at this time...
Reviewed-by: Jaben Carsey <jaben.car...@intel.com>
From: Qiu, Shumin
Sent: Monday, December 29, 2014 4:29 PM
To: Carsey, Jaben
Cc: edk2-devel@lists.sourceforge.net
Subject: [edk2] [Patch] ShellPkg: Check the unrecognized environment variable
name before it is removed from command line.
Importance: High
Hi Jaben,
Please help review the attached patch?
Shell seems fail to parse the '%' in command line. We test the following 4
cases:
1)Execute echo "* %c %d *" in the command line, the output is "* %c %d *".
2)Script file a.nsh with the content: echo "* %c %d *", execute the a.nsh, the
output is "* " "d *"
3)Script file a.nsh with the content: echo %1, execute a.nsh "* %c %d *", the
output is "* " "d *"
4)Script file a.nsh with the content: echo %1, script b.nsh with the
content:a.nsh "* %c %d *", execute b.nsh, the output is "*"
The root cause is Shell treat '%c %' as an unrecognized environment variable,
and replace it with a null string (""). The patch add code to check the name of
an unrecognized environment variable, if it's a valid C style identifier then
we do the remove.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin....@intel.com<mailto:shumin....@intel.com>>
Thanks
Shumin
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel