浏览代码

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>
Marcin Nowakowski 14 年之前
父节点
当前提交
f07726048d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scripts/mkcompile_h

+ 1 - 1
scripts/mkcompile_h

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