Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EF7A6200BC6 for ; Sun, 20 Nov 2016 16:37:59 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EDF9B160B18; Sun, 20 Nov 2016 15:37:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4D451160AFE for ; Sun, 20 Nov 2016 16:37:59 +0100 (CET) Received: (qmail 28798 invoked by uid 500); 20 Nov 2016 15:37:58 -0000 Mailing-List: contact issues-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list issues@cloudstack.apache.org Received: (qmail 28786 invoked by uid 500); 20 Nov 2016 15:37:58 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 28782 invoked by uid 99); 20 Nov 2016 15:37:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Nov 2016 15:37:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 629EC2C2B10 for ; Sun, 20 Nov 2016 15:37:58 +0000 (UTC) Date: Sun, 20 Nov 2016 15:37:58 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CLOUDSTACK-9498) VR CsFile search utility methods fail when search string has char *, + etc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 20 Nov 2016 15:38:00 -0000 [ https://issues.apache.org/jira/browse/CLOUDSTACK-9498?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D15681337#comment-15681337 ]=20 ASF GitHub Bot commented on CLOUDSTACK-9498: -------------------------------------------- Github user blueorangutan commented on the issue: https://github.com/apache/cloudstack/pull/1680 =20 Packaging result: =E2=9C=94centos6 =E2=9C=94centos7 =E2=9C=94debian. JI= D-197 > VR CsFile search utility methods fail when search string has char *, + et= c > -------------------------------------------------------------------------= - > > Key: CLOUDSTACK-9498 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-949= 8 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the defa= ult.)=20 > Affects Versions: 4.6.2, 4.7.1, 4.8.0, 4.8.1, 4.9.0 > Reporter: Murali Reddy > Assignee: Murali Reddy > Fix For: 4.10.0.0, 4.9.1.0, 4.8.2.0 > > > VR CsFile search utility methods fail when search string has char *, + et= c. > These utility methods in CsFile [1] uses python regular expression module= to search a string in a file. However, if caller passes a search string, t= hat has chars *, +, . etc that are also happen to be express wild card / ma= tch expression in regular expression results in exceptions from python 're'= module. > For instance searching for VPN user [2] passes "username * password *" as= search string, if password has chars the interfer with regular expression = metacharecters then search will result in exception. > 2016-09-12 13:55:48,976 configure.py add_l2tp_ipsec_user:569 Adding vpn u= ser murali * abcd++efgh## * > 2016-09-12 13:55:48,976 CsFile.py load:39 Reading file /etc/ppp/chap-secr= ets > 2016-09-12 13:55:48,976 CsFile.py searchString:140 Searching for murali *= abcd++efgh## * string > 2016-09-12 13:55:48,976 configure.py main:1020 Exception while configurin= g router > Traceback (most recent call last): > File "/opt/cloud/bin/configure.py", line 965, in main > vpnuser.process() > File "/opt/cloud/bin/configure.py", line 559, in process > self.add_l2tp_ipsec_user(user, userconfig) > File "/opt/cloud/bin/configure.py", line 572, in add_l2tp_ipsec_user > userfound =3D file.searchString(userSearchEntry, '#') > File "/opt/cloud/bin/cs/CsFile.py", line 146, in searchString > if re.search(search, line): > File "/usr/lib/python2.7/re.py", line 142, in search > return _compile(pattern, flags).search(string) > File "/usr/lib/python2.7/re.py", line 242, in _compile > raise error, v # invalid expression > 1 https://github.com/apache/cloudstack/blob/master/systemvm/patches/debia= n/config/opt/cloud/bin/cs/CsFile.py > 2 https://github.com/apache/cloudstack/blob/master/systemvm/patches/debia= n/config/opt/cloud/bin/configure.py#L572 -- This message was sent by Atlassian JIRA (v6.3.4#6332)