From 9745288600d6b08166f874de29c30972681a64a6 Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Tue, 9 Sep 2014 08:43:50 -0700 Subject: [PATCH] app-emulation/open-vm-tools: read passwords from shadow database --- ...6-1770165-0004-auth-Read-from-shadow.patch | 50 +++++++++++++++++++ ... => open-vm-tools-9.4.6.1770165-r1.ebuild} | 1 + 2 files changed, 51 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/app-emulation/open-vm-tools/files/open-vm-tools-9.4.6-1770165-0004-auth-Read-from-shadow.patch rename sdk_container/src/third_party/coreos-overlay/app-emulation/open-vm-tools/{open-vm-tools-9.4.6.1770165.ebuild => open-vm-tools-9.4.6.1770165-r1.ebuild} (98%) diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/open-vm-tools/files/open-vm-tools-9.4.6-1770165-0004-auth-Read-from-shadow.patch b/sdk_container/src/third_party/coreos-overlay/app-emulation/open-vm-tools/files/open-vm-tools-9.4.6-1770165-0004-auth-Read-from-shadow.patch new file mode 100644 index 0000000000..5d2005c2a6 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/open-vm-tools/files/open-vm-tools-9.4.6-1770165-0004-auth-Read-from-shadow.patch @@ -0,0 +1,50 @@ +From 7071154a3700a7b826b0d56f0cc8f4ae05b55fd1 Mon Sep 17 00:00:00 2001 +From: Oliver Kurth +Date: Tue, 9 Sep 2014 08:58:34 -0700 +Subject: [PATCH] auth: Read from shadow password if needed + +--- + lib/auth/authPosix.c | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +diff --git a/lib/auth/authPosix.c b/lib/auth/authPosix.c +index beec4ee..6a3da65 100644 +--- a/lib/auth/authPosix.c ++++ b/lib/auth/authPosix.c +@@ -20,6 +20,7 @@ + #include + #include + #include // for access, crypt, etc. ++#include + + #include "vmware.h" + #include "vm_version.h" +@@ -341,10 +342,23 @@ + } + + if (*pwd->pw_passwd != '\0') { +- char *namep = (char *) crypt(pass, pwd->pw_passwd); ++ const char *pw = pwd->pw_passwd; ++ const char *namep; + +- if (strcmp(namep, pwd->pw_passwd) != 0) { +- // Incorrect password ++ if(strcmp(pwd->pw_passwd, "x") == 0) { ++ struct spwd *sp = getspnam(user); ++ if (sp) { ++ pw = sp->sp_pwdp; ++ } ++ } ++ ++ namep = (char *) crypt(pass, pw); ++ if (namep) { ++ if (strcmp(namep, pw) != 0) { ++ // Incorrect password ++ return NULL; ++ } ++ } else { + return NULL; + } + +-- +1.8.5.5 diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/open-vm-tools/open-vm-tools-9.4.6.1770165.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/open-vm-tools/open-vm-tools-9.4.6.1770165-r1.ebuild similarity index 98% rename from sdk_container/src/third_party/coreos-overlay/app-emulation/open-vm-tools/open-vm-tools-9.4.6.1770165.ebuild rename to sdk_container/src/third_party/coreos-overlay/app-emulation/open-vm-tools/open-vm-tools-9.4.6.1770165-r1.ebuild index a91ba8defc..fe44b41633 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/open-vm-tools/open-vm-tools-9.4.6.1770165.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/open-vm-tools/open-vm-tools-9.4.6.1770165-r1.ebuild @@ -39,6 +39,7 @@ PATCHES=( "${FILESDIR}/${MY_P}-0001-configure-Add-options-for-fuse-and-hgfs.patch" "${FILESDIR}/${MY_P}-0002-configure-Fix-USE_SLASH_PROC-conditional.patch" "${FILESDIR}/${MY_P}-0003-scripts-Remove-ifup.patch" + "${FILESDIR}/${MY_P}-0004-auth-Read-from-shadow.patch" ) #pkg_setup() {