Yes.  I agree with you.  Thanks for reminding me.

From: Qiu, Shumin
Sent: Monday, December 29, 2014 5:32 PM
To: Carsey, Jaben
Cc: [email protected]
Subject: RE: [edk2] [Patch] ShellPkg: Check the unrecognized environment 
variable name before it is removed from command line.
Importance: High

Hi Jaben,
Shell Spec 2.1 [3.6.1 - Environment Variables] "Each environment variable has a 
case-sensitive name (a C-style identifier) and a string value." So is the 
"C-style identifier" a restriction to the environment variable name?

-Shumin
From: Carsey, Jaben
Sent: Tuesday, December 30, 2014 8:59 AM
To: Qiu, Shumin
Cc: [email protected]<mailto:[email protected]>; 
Carsey, Jaben
Subject: RE: [edk2] [Patch] ShellPkg: Check the unrecognized environment 
variable name before it is removed from command line.

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 
<[email protected]<mailto:[email protected]>>

From: Qiu, Shumin
Sent: Monday, December 29, 2014 4:29 PM
To: Carsey, Jaben
Cc: [email protected]<mailto:[email protected]>
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 <[email protected]<mailto:[email protected]>>

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to