diff options
author | kkm <kkm@smartaction.com> | 2017-01-24 17:51:07 -0800 |
---|---|---|
committer | kkm <kkm@smartaction.com> | 2017-01-26 19:14:34 -0800 |
commit | 3c8f84786e7700d678a09d2060838ec2a4815b7d (patch) | |
tree | f70f1ea67a6f7e8c9c2b16e935eb2aed79f088c9 /build_tools/make_build_h | |
parent | 3410000948f406a2e4bba33842345c40eb9bee20 (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/make_build_h')
-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}" |