bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: REGRESSION: shellshock patch rejects valid function names


From: Eduardo A . Bustamante López
Subject: Re: REGRESSION: shellshock patch rejects valid function names
Date: Fri, 26 Sep 2014 09:48:34 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

Well, what did you expect? You're relying on undocumented features.

Relevant sections from the manual:

Definition of 'name':
|      name   A word consisting only of alphanumeric characters and 
underscores, and beginning with an alphabetic character or  an
|             underscore.  Also referred to as an identifier.

Definition of shell functions:
|   Shell Function Definitions
|       A  shell function is an object that is called like a simple command and 
executes a compound command with a new set of posi‐
|       tional parameters.  Shell functions are declared as follows:
|
|       name () compound-command [redirection]
|       function name [()] compound-command [redirection]
|              This defines a function named name.  The reserved word function 
is optional.  If the function reserved word is  sup‐
|              plied,  the  parentheses  are optional.  The body of the 
function is the compound command compound-command (see Com‐
|              pound Commands above).  That command is usually a list of 
commands between { and }, but may be  any  command  listed
|              under Compound Commands above.  compound-command is executed 
whenever name is specified as the name of a simple com‐
|              mand.  When in posix mode, name may not be the name of one of 
the POSIX special builtins.  Any redirections (see RE‐
|              DIRECTION  below) specified when a function is defined are 
performed when the function is executed.  The exit status
|              of a function definition is zero unless a syntax error occurs or 
a readonly function  with  the  same  name  already
|              exists.   When  executed, the exit status of a function is the 
exit status of the last command executed in the body.
|              (See FUNCTIONS below.)

It's common knowledge that if you rely on undocumented stuff, your
code will eventually break, like it did now. It's not a regression
though, nowhere in the manual you'll find that colons are allowed in
function names.

So, fix your scripts, perhaps?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]