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 7ADC9200BB6 for ; Fri, 21 Oct 2016 07:33:02 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 79828160AF5; Fri, 21 Oct 2016 05:33:02 +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 C9A8A160AF2 for ; Fri, 21 Oct 2016 07:33:01 +0200 (CEST) Received: (qmail 55938 invoked by uid 500); 21 Oct 2016 05:32:59 -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 55483 invoked by uid 500); 21 Oct 2016 05:32:59 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 55421 invoked by uid 99); 21 Oct 2016 05:32:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Oct 2016 05:32:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 084B12C0D52 for ; Fri, 21 Oct 2016 05:32:59 +0000 (UTC) Date: Fri, 21 Oct 2016 05:32:59 +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: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 21 Oct 2016 05:33:02 -0000 [ https://issues.apache.org/jira/browse/CLOUDSTACK-9498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15594126#comment-15594126 ] ASF GitHub Bot commented on CLOUDSTACK-9498: -------------------------------------------- Github user blueorangutan commented on the issue: https://github.com/apache/cloudstack/pull/1680 @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. > VR CsFile search utility methods fail when search string has char *, + etc > -------------------------------------------------------------------------- > > Key: CLOUDSTACK-9498 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9498 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the default.) > 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 *, + etc. > 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, that has chars *, +, . etc that are also happen to be express wild card / match 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 user murali * abcd++efgh## * > 2016-09-12 13:55:48,976 CsFile.py load:39 Reading file /etc/ppp/chap-secrets > 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 configuring 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 = 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/debian/config/opt/cloud/bin/cs/CsFile.py > 2 https://github.com/apache/cloudstack/blob/master/systemvm/patches/debian/config/opt/cloud/bin/configure.py#L572 -- This message was sent by Atlassian JIRA (v6.3.4#6332)