diff options
author | kkm <kkm@smartaction.com> | 2017-01-24 17:51:07 -0800 |
---|---|---|
committer | Kirill Katsnelson <kkm@smartaction.com> | 2017-01-26 21:17:11 -0600 |
commit | e12fb3ffc1aaadfaf925de1f6b8f43629e5352e5 (patch) | |
tree | ce8e1c60996e8a55ef235c2881b5214778f5ea8f /build_tools | |
parent | 75ef430f2f2814f0c9f8029a0a7768e1a3a25ce7 (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-x | build_tools/make_build_h | 10 |
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}" |