[Home]

Summary:ASTERISK-15638: [patch] [regression] system() dialplan function fails (-1 returned) when argument is single quoted
Reporter:rbosch (rbosch)Labels:
Date Opened:2010-02-16 12:30:28.000-0600Date Closed:2010-03-11 14:29:33.000-0600
Priority:MinorRegression?Yes
Status:Closed/CompleteComponents:Applications/app_system
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20100310__issue16842.diff.txt
Description:The system() dialplan fails to execute a command that is passed and quoted with single quoted (e.g. system('ls -l /tmp')).  Previous versions of asterisk allowed the single quote.  

Should allow single quotes for compatibility.

****** ADDITIONAL INFORMATION ******

May be related to change in app_system.c where

ast_str_get_encoded_str(&buf, 0, (char *) data);

was added?  Not sure...not a c programmer.
Comments:By: Leif Madsen (lmadsen) 2010-03-11 09:55:44.000-0600

A patch exists for testing by the original reporter. When filing issues that you expect to be resolved, please do your best to be responsive so issues can be fixed quickly.

By: rbosch (rbosch) 2010-03-11 10:01:42.000-0600

Patch fixes the problem.  Single quotes work fine with system() call now.

By: Digium Subversion (svnbot) 2010-03-11 14:25:03.000-0600

Repository: asterisk
Revision: 251877

U   trunk/apps/app_system.c

------------------------------------------------------------------------
r251877 | tilghman | 2010-03-11 14:25:02 -0600 (Thu, 11 Mar 2010) | 8 lines

If the argument to the system application is quoted, ensure we remove the quotes before trying to execute.

(closes issue ASTERISK-15638)
Reported by: ip-rob
Patches:
      20100310__issue16842.diff.txt uploaded by tilghman (license 14)
Tested by: ip-rob

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=251877

By: Digium Subversion (svnbot) 2010-03-11 14:27:29.000-0600

Repository: asterisk
Revision: 251878

_U  branches/1.6.1/
U   branches/1.6.1/apps/app_system.c

------------------------------------------------------------------------
r251878 | tilghman | 2010-03-11 14:27:29 -0600 (Thu, 11 Mar 2010) | 15 lines

Merged revisions 251877 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r251877 | tilghman | 2010-03-11 14:25:02 -0600 (Thu, 11 Mar 2010) | 8 lines
 
 If the argument to the system application is quoted, ensure we remove the quotes before trying to execute.
 
 (closes issue ASTERISK-15638)
  Reported by: ip-rob
  Patches:
        20100310__issue16842.diff.txt uploaded by tilghman (license 14)
  Tested by: ip-rob
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=251878

By: Digium Subversion (svnbot) 2010-03-11 14:27:37.000-0600

Repository: asterisk
Revision: 251879

_U  branches/1.6.2/
U   branches/1.6.2/apps/app_system.c

------------------------------------------------------------------------
r251879 | tilghman | 2010-03-11 14:27:37 -0600 (Thu, 11 Mar 2010) | 15 lines

Merged revisions 251877 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r251877 | tilghman | 2010-03-11 14:25:02 -0600 (Thu, 11 Mar 2010) | 8 lines
 
 If the argument to the system application is quoted, ensure we remove the quotes before trying to execute.
 
 (closes issue ASTERISK-15638)
  Reported by: ip-rob
  Patches:
        20100310__issue16842.diff.txt uploaded by tilghman (license 14)
  Tested by: ip-rob
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=251879

By: Digium Subversion (svnbot) 2010-03-11 14:29:32.000-0600

Repository: asterisk
Revision: 251882

_U  branches/1.6.0/
U   branches/1.6.0/apps/app_system.c

------------------------------------------------------------------------
r251882 | tilghman | 2010-03-11 14:29:32 -0600 (Thu, 11 Mar 2010) | 15 lines

Merged revisions 251877 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r251877 | tilghman | 2010-03-11 14:25:02 -0600 (Thu, 11 Mar 2010) | 8 lines
 
 If the argument to the system application is quoted, ensure we remove the quotes before trying to execute.
 
 (closes issue ASTERISK-15638)
  Reported by: ip-rob
  Patches:
        20100310__issue16842.diff.txt uploaded by tilghman (license 14)
  Tested by: ip-rob
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=251882