Date: Wed, 13 Jun 2018 13:12:45 +0000 (UTC) From: Steve Wills <swills@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r472316 - in head/sysutils/google-compute-engine-oslogin: . files Message-ID: <201806131312.w5DDCjkJ029243@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: swills Date: Wed Jun 13 13:12:44 2018 New Revision: 472316 URL: https://svnweb.freebsd.org/changeset/ports/472316 Log: sysutils/google-compute-engine-oslogin: fix oslogin and update to 1.3.0 PR: 228949 Submitted by: Helen Koike <helen.koike@collabora.com> (maintainer) MFH: 2018Q2 Added: head/sysutils/google-compute-engine-oslogin/files/patch-libnss__cache__oslogin_nss__cache__oslogin.c (contents, props changed) head/sysutils/google-compute-engine-oslogin/files/patch-nss__cache_nss__cache.cc (contents, props changed) Modified: head/sysutils/google-compute-engine-oslogin/Makefile (contents, props changed) head/sysutils/google-compute-engine-oslogin/distinfo (contents, props changed) head/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control (contents, props changed) head/sysutils/google-compute-engine-oslogin/files/patch-nss__module_nss__oslogin.cc (contents, props changed) head/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__admin.cc (contents, props changed) head/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__login.cc (contents, props changed) head/sysutils/google-compute-engine-oslogin/files/patch-utils_oslogin__utils.cc (contents, props changed) head/sysutils/google-compute-engine-oslogin/pkg-plist (contents, props changed) Modified: head/sysutils/google-compute-engine-oslogin/Makefile ============================================================================== --- head/sysutils/google-compute-engine-oslogin/Makefile Wed Jun 13 13:10:57 2018 (r472315) +++ head/sysutils/google-compute-engine-oslogin/Makefile Wed Jun 13 13:12:44 2018 (r472316) @@ -1,7 +1,7 @@ # $FreeBSD$ PORTNAME= google-compute-engine-oslogin -DISTVERSION= 1.1.5 +DISTVERSION= 1.3.0 CATEGORIES= sysutils MAINTAINER= helen.koike@collabora.com @@ -25,7 +25,7 @@ USE_GCC= any USE_GITHUB= yes GH_ACCOUNT= GoogleCloudPlatform GH_PROJECT= compute-image-packages -GH_TAGNAME= 20180227 +GH_TAGNAME= 20180611 MAKE_ARGS= JSON_INCLUDE_PATH=${LOCALBASE}/include/json-c \ BIN_INSTALL_PATH=/bin \ PAM_INSTALL_PATH=/lib \ @@ -42,6 +42,7 @@ post-patch: post-install: ${LN} -sf libnss_${PORTNAME}-${DISTVERSION}.so ${STAGEDIR}${PREFIX}/lib/nss_oslogin.so.1 + ${LN} -sf libnss_cache_${PORTNAME}-${DISTVERSION}.so ${STAGEDIR}${PREFIX}/lib/nss_cache_oslogin.so.1 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/google_authorized_keys \ ${STAGEDIR}${PREFIX}/lib/libnss_google-compute-engine-oslogin-${DISTVERSION}.so \ ${STAGEDIR}${PREFIX}/lib/pam_oslogin_admin.so \ Modified: head/sysutils/google-compute-engine-oslogin/distinfo ============================================================================== --- head/sysutils/google-compute-engine-oslogin/distinfo Wed Jun 13 13:10:57 2018 (r472315) +++ head/sysutils/google-compute-engine-oslogin/distinfo Wed Jun 13 13:12:44 2018 (r472316) @@ -1,3 +1,3 @@ -TIMESTAMP = 1522046585 -SHA256 (GoogleCloudPlatform-compute-image-packages-1.1.5-20180227_GH0.tar.gz) = 80e8c8059273f76e82343993a0282c51b633ba8c8dc5a14664919ee1b9e0fbaf -SIZE (GoogleCloudPlatform-compute-image-packages-1.1.5-20180227_GH0.tar.gz) = 135485 +TIMESTAMP = 1528807879 +SHA256 (GoogleCloudPlatform-compute-image-packages-1.3.0-20180611_GH0.tar.gz) = f71bdc6d01cff014bb4d066096be9a6e067fd3028c730cc4c9557001ec99ab6e +SIZE (GoogleCloudPlatform-compute-image-packages-1.3.0-20180611_GH0.tar.gz) = 143678 Modified: head/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control ============================================================================== --- head/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control Wed Jun 13 13:10:57 2018 (r472315) +++ head/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control Wed Jun 13 13:12:44 2018 (r472316) @@ -1,6 +1,6 @@ ---- bin/google_oslogin_control.orig 2018-02-27 22:53:04 UTC +--- bin/google_oslogin_control.orig 2018-06-11 17:16:50 UTC +++ bin/google_oslogin_control -@@ -65,22 +65,24 @@ overwrite_file() { +@@ -65,24 +65,26 @@ overwrite_file() { remove_from_config() { config=$1 @@ -9,7 +9,11 @@ } remove_from_nss_config() { +- sed -i '/^passwd:/ s/ cache_oslogin oslogin//' ${nss_config}.new +- sed -i '/^passwd:/ s/ cache oslogin//' ${nss_config}.new - sed -i '/^passwd:/ s/ oslogin//' ${nss_config}.new ++ gsed -i '/^passwd:/ s/ cache_oslogin oslogin//' ${nss_config}.new ++ gsed -i '/^passwd:/ s/ cache oslogin//' ${nss_config}.new + gsed -i '/^passwd:/ s/ oslogin//' ${nss_config}.new } @@ -23,14 +27,14 @@ add_to_nss_config() { remove_from_nss_config -- sed -i '/^passwd:/ s/$/ oslogin/' ${nss_config}.new -+ gsed -i '/^passwd:/ s/$/ oslogin/' ${nss_config}.new +- sed -i '/^passwd:/ s/$/ cache_oslogin oslogin/' ${nss_config}.new ++ gsed -i '/^passwd:/ s/$/ cache_oslogin oslogin/' ${nss_config}.new + # Replace compat by files (as compat cannot be used with other sources) + gsed -i '/^passwd:/ s/compat/files/' ${nss_config}.new } add_to_pam_config() { -@@ -97,9 +99,9 @@ ${pam_homedir} +@@ -99,9 +101,9 @@ ${pam_homedir} " echo "${added_config}$(cat ${pam_config}.new)" > ${pam_config}.new else @@ -43,7 +47,7 @@ fi } -@@ -113,7 +115,7 @@ restart_service() { +@@ -115,7 +117,7 @@ restart_service() { fi fi if which service > /dev/null 2>&1; then Added: head/sysutils/google-compute-engine-oslogin/files/patch-libnss__cache__oslogin_nss__cache__oslogin.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/google-compute-engine-oslogin/files/patch-libnss__cache__oslogin_nss__cache__oslogin.c Wed Jun 13 13:12:44 2018 (r472316) @@ -0,0 +1,46 @@ +--- libnss_cache_oslogin/nss_cache_oslogin.c.orig 2018-06-11 17:16:50 UTC ++++ libnss_cache_oslogin/nss_cache_oslogin.c +@@ -16,6 +16,7 @@ + + #include "nss_cache_oslogin.h" + ++#include <nsswitch.h> + #include <sys/mman.h> + + // Locking implementation: use pthreads. +@@ -32,7 +33,7 @@ static pthread_mutex_t mutex = PTHREAD_M + + static FILE *p_file = NULL; + static char p_filename[NSS_CACHE_OSLOGIN_PATH_LENGTH] = +- "/etc/oslogin_passwd.cache"; ++ "/usr/local/etc/oslogin_passwd.cache"; + #ifdef BSD + extern int fgetpwent_r(FILE *, struct passwd *, char *, size_t, + struct passwd **); +@@ -435,3 +436,26 @@ enum nss_status _nss_cache_oslogin_getpw + + return ret; + } ++ ++NSS_METHOD_PROTOTYPE(__nss_compat_getpwnam_r); ++NSS_METHOD_PROTOTYPE(__nss_compat_getpwuid_r); ++NSS_METHOD_PROTOTYPE(__nss_compat_getpwent_r); ++NSS_METHOD_PROTOTYPE(__nss_compat_setpwent); ++NSS_METHOD_PROTOTYPE(__nss_compat_endpwent); ++ ++static ns_mtab methods[] = { ++ { NSDB_PASSWD, "getpwnam_r", __nss_compat_getpwnam_r, (void*)_nss_cache_oslogin_getpwnam_r }, ++ { NSDB_PASSWD, "getpwuid_r", __nss_compat_getpwuid_r, (void*)_nss_cache_oslogin_getpwuid_r }, ++ { NSDB_PASSWD, "getpwent_r", __nss_compat_getpwent_r, (void*)_nss_cache_oslogin_getpwent_r }, ++ { NSDB_PASSWD, "endpwent", __nss_compat_endpwent, (void*)_nss_cache_oslogin_endpwent }, ++ { NSDB_PASSWD, "setpwent", __nss_compat_setpwent, (void*)_nss_cache_oslogin_setpwent }, ++}; ++ ++ns_mtab * ++nss_module_register (const char *name, unsigned int *size, ++ nss_module_unregister_fn *unregister) ++{ ++ *size = sizeof (methods) / sizeof (methods[0]); ++ *unregister = NULL; ++ return (methods); ++} Added: head/sysutils/google-compute-engine-oslogin/files/patch-nss__cache_nss__cache.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/google-compute-engine-oslogin/files/patch-nss__cache_nss__cache.cc Wed Jun 13 13:12:44 2018 (r472316) @@ -0,0 +1,13 @@ +--- nss_cache/nss_cache.cc.orig 2018-06-11 17:16:50 UTC ++++ nss_cache/nss_cache.cc +@@ -31,8 +31,8 @@ using oslogin_utils::MutexLock; + using oslogin_utils::NssCache; + + // File paths for the nss cache file. +-static const char kDefaultFilePath[] = "/etc/oslogin_passwd.cache"; +-static const char kDefaultBackupFilePath[] = "/etc/oslogin_passwd.cache.bak"; ++static const char kDefaultFilePath[] = "/usr/local/etc/oslogin_passwd.cache"; ++static const char kDefaultBackupFilePath[] = "/usr/local/etc/oslogin_passwd.cache.bak"; + + // Local NSS Cache size. This affects the maximum number of passwd entries per + // http request. Modified: head/sysutils/google-compute-engine-oslogin/files/patch-nss__module_nss__oslogin.cc ============================================================================== --- head/sysutils/google-compute-engine-oslogin/files/patch-nss__module_nss__oslogin.cc Wed Jun 13 13:10:57 2018 (r472315) +++ head/sysutils/google-compute-engine-oslogin/files/patch-nss__module_nss__oslogin.cc Wed Jun 13 13:12:44 2018 (r472316) @@ -1,4 +1,4 @@ ---- nss_module/nss_oslogin.cc.orig 2018-02-27 22:53:04 UTC +--- nss_module/nss_oslogin.cc.orig 2018-06-11 17:16:50 UTC +++ nss_module/nss_oslogin.cc @@ -16,6 +16,7 @@ #include <errno.h> @@ -8,10 +8,13 @@ #include <pthread.h> #include <pwd.h> #include <sys/types.h> -@@ -150,4 +151,27 @@ int _nss_oslogin_getpwent_r(struct passw - } - return NSS_STATUS_SUCCESS; - } +@@ -103,4 +104,30 @@ int _nss_oslogin_getpwnam_r(const char * + // nss_getpwent_r() is intentionally left unimplemented. This functionality is + // now covered by the nss_cache binary and nss_cache module. + ++void _nss_oslogin_getpwent_r() {} ++void _nss_oslogin_endpwent() {} ++void _nss_oslogin_setpwent() {} + +NSS_METHOD_PROTOTYPE(__nss_compat_getpwnam_r); +NSS_METHOD_PROTOTYPE(__nss_compat_getpwuid_r); Modified: head/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__admin.cc ============================================================================== --- head/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__admin.cc Wed Jun 13 13:10:57 2018 (r472315) +++ head/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__admin.cc Wed Jun 13 13:12:44 2018 (r472316) @@ -1,4 +1,4 @@ ---- pam_module/pam_oslogin_admin.cc.orig 2018-02-27 22:53:04 UTC +--- pam_module/pam_oslogin_admin.cc.orig 2018-06-11 17:16:50 UTC +++ pam_module/pam_oslogin_admin.cc @@ -14,7 +14,6 @@ Modified: head/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__login.cc ============================================================================== --- head/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__login.cc Wed Jun 13 13:10:57 2018 (r472315) +++ head/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__login.cc Wed Jun 13 13:12:44 2018 (r472316) @@ -1,4 +1,4 @@ ---- pam_module/pam_oslogin_login.cc.orig 2018-02-27 22:53:04 UTC +--- pam_module/pam_oslogin_login.cc.orig 2018-06-11 17:16:50 UTC +++ pam_module/pam_oslogin_login.cc @@ -14,7 +14,6 @@ Modified: head/sysutils/google-compute-engine-oslogin/files/patch-utils_oslogin__utils.cc ============================================================================== --- head/sysutils/google-compute-engine-oslogin/files/patch-utils_oslogin__utils.cc Wed Jun 13 13:10:57 2018 (r472315) +++ head/sysutils/google-compute-engine-oslogin/files/patch-utils_oslogin__utils.cc Wed Jun 13 13:12:44 2018 (r472316) @@ -1,6 +1,6 @@ ---- utils/oslogin_utils.cc.orig 2018-02-27 22:53:04 UTC +--- utils/oslogin_utils.cc.orig 2018-06-11 17:16:50 UTC +++ utils/oslogin_utils.cc -@@ -222,7 +222,14 @@ bool ValidatePasswd(struct passwd* resul +@@ -255,7 +255,14 @@ bool ValidatePasswd(struct passwd* resul } } if (strlen(result->pw_shell) == 0) { Modified: head/sysutils/google-compute-engine-oslogin/pkg-plist ============================================================================== --- head/sysutils/google-compute-engine-oslogin/pkg-plist Wed Jun 13 13:10:57 2018 (r472315) +++ head/sysutils/google-compute-engine-oslogin/pkg-plist Wed Jun 13 13:12:44 2018 (r472316) @@ -1,6 +1,9 @@ bin/google_authorized_keys bin/google_oslogin_control +bin/google_oslogin_nss_cache +lib/libnss_cache_google-compute-engine-oslogin-%%DISTVERSION%%.so lib/libnss_google-compute-engine-oslogin-%%DISTVERSION%%.so lib/nss_oslogin.so.1 +lib/nss_cache_oslogin.so.1 lib/pam_oslogin_admin.so lib/pam_oslogin_login.so
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806131312.w5DDCjkJ029243>