Commit f07726048d599acd6bac438e304645a78db753c0

Authored by Marcin Nowakowski
Committed by Michal Marek
1 parent d8ecc5cd8e

Fix handling of backlash character in LINUX_COMPILE_BY name

When using a domain login, `whoami` returns the login in
user\domain format. This leads to either warnings on unrecognised
escape sequences or escaped characters being generated for the user.
This patch ensures that any backslash is escaped to a double-backslash
to make sure the name is preserved correctly. This patch does not
enforce escaping on the KBUILD_BUILD_USER variable, as this is something
the user has control of and can escape if required.

Signed-off-by: Marcin Nowakowski <marcin.nowakowski.000@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -43,7 +43,7 @@
43 43 TIMESTAMP=$KBUILD_BUILD_TIMESTAMP
44 44 fi
45 45 if test -z "$KBUILD_BUILD_USER"; then
46   - LINUX_COMPILE_BY=`whoami`
  46 + LINUX_COMPILE_BY=$(whoami | sed 's/\\/\\\\/')
47 47 else
48 48 LINUX_COMPILE_BY=$KBUILD_BUILD_USER
49 49 fi