brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] brooklyn-library pull request: Fix sed command that update the MyS...
Date Mon, 30 May 2016 14:47:14 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/brooklyn-library/pull/34#discussion_r65081208
  
    --- Diff: software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNodeEffectors.java
---
    @@ -75,7 +75,7 @@ public Void call(ConfigBag parameters) {
                 DynamicTasks.queue(
                         SshTasks.newSshExecTaskFactory(machine, 
                                         "cd "+entity().getAttribute(MySqlNode.RUN_DIR),
    -                                    "sed -i'' -e 's@^\\(\\s*password\\s*=\\s*\\).*$@\\1"
+ newPass.replace("\\", "\\\\") + "@g' mymysql.cnf")
    +                                    "sed -i.bak 's/\\(password.*\\)=.*/\\1= " + newPass.replace("\\",
"\\\\") + "/' mymysql.cnf")
    --- End diff --
    
    @tbouron Won't this replace lines containing the following as well?
    ```
    passwordMine=xxx
    passwordOld=yyy
    passwordDontChange=zzz
    ```
    
    What about `password=se!=scret`. I think it will match greedily here, so won't do the
replacement right?
    
    Is the change fixing the case for passwords containing `@`? Could you add some more details
in the commit message.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message