summaryrefslogtreecommitdiff
path: root/build_tools
diff options
context:
space:
mode:
authorkkm <kkm@smartaction.com>2017-01-24 17:51:07 -0800
committerKirill Katsnelson <kkm@smartaction.com>2017-01-26 21:17:20 -0600
commit138cd8d01944fb5bdff6b47fc641e29d4c0c5139 (patch)
tree46964b84e75ae4145f77f9bb12a365002ac50f7f /build_tools
parent10631bb209ff4edd7f0c0ff203e4c846059d899c (diff)
make_build_h: handle backslashes 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
Diffstat (limited to 'build_tools')
-rwxr-xr-xbuild_tools/make_build_h10
1 files changed, 5 insertions, 5 deletions
diff --git a/build_tools/make_build_h b/build_tools/make_build_h
index a7cb6fe2e..2c8895e7a 100755
--- a/build_tools/make_build_h
+++ b/build_tools/make_build_h
@@ -1,13 +1,13 @@
#!/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
/*
- * build.h
+ * build.h
* Automatically generated
*/
#define BUILD_HOSTNAME "${HOSTNAME}"