[Asterisk-code-review] make build h: handle backslashed in external strings (asterisk[master])

Kirill Katsnelson asteriskteam at digium.com
Wed Jan 25 23:08:07 CST 2017


Kirill Katsnelson has uploaded a new change for review. ( https://gerrit.asterisk.org/4828 )

Change subject: make_build_h: handle backslashed in external strings
......................................................................

make_build_h: handle backslashed in external strings

LikewiseOpen creates user names with a backslash in them. A gentle
massage with sed(1) allows such strings to be inserted into build.h
properly quoted. I am also adding the same for host name and other
strings used in the script that are more or less user-controlled.

ASTERISK-26754

Change-Id: Iac5ef2b67a68ee58f35ddbf86bb818ba6eabecae
---
M build_tools/make_build_h
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/28/4828/1

diff --git a/build_tools/make_build_h b/build_tools/make_build_h
index a7cb6fe..06db45d 100755
--- a/build_tools/make_build_h
+++ b/build_tools/make_build_h
@@ -1,9 +1,9 @@
 #!/bin/sh
-HOSTNAME=`uname -n`
-KERNEL=`uname -r`
-MACHINE=`uname -m`
+HOSTNAME=`uname -n | sed 's/\\\\/\\\\\\\\/g'`
+KERNEL=`uname -r   | sed 's/\\\\/\\\\\\\\/g'`
+MACHINE=`uname -m  | sed 's/\\\\/\\\\\\\\/g'`
 OS=`uname -s`
-USER=`id | awk -F")" '{print $1}'| awk -F"(" '{print $2}'`
+USER=`id | awk -F")" '{print $1}'| awk -F"(" '{print $2}' | sed 's/\\\\/\\\\\\\\/g'`
 DATE=`date -u "+%Y-%m-%d %H:%M:%S"`
 cat << END
 /*

-- 
To view, visit https://gerrit.asterisk.org/4828
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac5ef2b67a68ee58f35ddbf86bb818ba6eabecae
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Kirill Katsnelson <kkm at smartaction.com>



More information about the asterisk-code-review mailing list