FreeBSD Bugzilla – Attachment 194197 Details for
Bug 228949
sysutils/google-compute-engine-oslogin: fix oslogin and update to 1.3.0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch (git format) sysutils/google-compute-engine-oslogin to version 1.3.0
0002-sysutils-google-compute-engine-oslogin-Update-1.1.5-.patch (text/plain), 11.54 KB, created by
Helen Koike
on 2018-06-12 15:03:58 UTC
(
hide
)
Description:
Patch (git format) sysutils/google-compute-engine-oslogin to version 1.3.0
Filename:
MIME Type:
Creator:
Helen Koike
Created:
2018-06-12 15:03:58 UTC
Size:
11.54 KB
patch
obsolete
>From 3596dc5b389e8f9d70b0ac7055a5b7bbcb70272c Mon Sep 17 00:00:00 2001 >From: Helen Koike <helen.koike@collabora.com> >Date: Tue, 12 Jun 2018 13:23:27 +0000 >Subject: [PATCH] sysutils/google-compute-engine-oslogin: Update 1.1.5 -> > 1.3.0 > >--- > .../google-compute-engine-oslogin/Makefile | 5 +- > .../google-compute-engine-oslogin/distinfo | 6 +-- > .../files/patch-bin_google__oslogin__control | 16 ++++--- > ...bnss__cache__oslogin_nss__cache__oslogin.c | 46 +++++++++++++++++++ > .../files/patch-nss__cache_nss__cache.cc | 13 ++++++ > .../files/patch-nss__module_nss__oslogin.cc | 13 ++++-- > .../patch-pam__module_pam__oslogin__admin.cc | 2 +- > .../patch-pam__module_pam__oslogin__login.cc | 2 +- > .../files/patch-utils_oslogin__utils.cc | 4 +- > .../google-compute-engine-oslogin/pkg-plist | 3 ++ > 10 files changed, 90 insertions(+), 20 deletions(-) > create mode 100644 sysutils/google-compute-engine-oslogin/files/patch-libnss__cache__oslogin_nss__cache__oslogin.c > create mode 100644 sysutils/google-compute-engine-oslogin/files/patch-nss__cache_nss__cache.cc > >diff --git a/sysutils/google-compute-engine-oslogin/Makefile b/sysutils/google-compute-engine-oslogin/Makefile >index 9f786226989e..8f4d04f5fb99 100644 >--- a/sysutils/google-compute-engine-oslogin/Makefile >+++ b/sysutils/google-compute-engine-oslogin/Makefile >@@ -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 \ >diff --git a/sysutils/google-compute-engine-oslogin/distinfo b/sysutils/google-compute-engine-oslogin/distinfo >index 8915356e67b6..92f45032aeec 100644 >--- a/sysutils/google-compute-engine-oslogin/distinfo >+++ b/sysutils/google-compute-engine-oslogin/distinfo >@@ -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 >diff --git a/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control b/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control >index 42b8a20dc577..0294fea503ca 100644 >--- a/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control >+++ b/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control >@@ -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 >diff --git a/sysutils/google-compute-engine-oslogin/files/patch-libnss__cache__oslogin_nss__cache__oslogin.c b/sysutils/google-compute-engine-oslogin/files/patch-libnss__cache__oslogin_nss__cache__oslogin.c >new file mode 100644 >index 000000000000..70e8adb10c78 >--- /dev/null >+++ b/sysutils/google-compute-engine-oslogin/files/patch-libnss__cache__oslogin_nss__cache__oslogin.c >@@ -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); >++} >diff --git a/sysutils/google-compute-engine-oslogin/files/patch-nss__cache_nss__cache.cc b/sysutils/google-compute-engine-oslogin/files/patch-nss__cache_nss__cache.cc >new file mode 100644 >index 000000000000..798158742160 >--- /dev/null >+++ b/sysutils/google-compute-engine-oslogin/files/patch-nss__cache_nss__cache.cc >@@ -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. >diff --git a/sysutils/google-compute-engine-oslogin/files/patch-nss__module_nss__oslogin.cc b/sysutils/google-compute-engine-oslogin/files/patch-nss__module_nss__oslogin.cc >index fdf9f363ee31..b21a6b04f04c 100644 >--- a/sysutils/google-compute-engine-oslogin/files/patch-nss__module_nss__oslogin.cc >+++ b/sysutils/google-compute-engine-oslogin/files/patch-nss__module_nss__oslogin.cc >@@ -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); >diff --git a/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__admin.cc b/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__admin.cc >index 2195f5f76f45..be094874af55 100644 >--- a/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__admin.cc >+++ b/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__admin.cc >@@ -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 @@ > >diff --git a/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__login.cc b/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__login.cc >index d27b6ae04dab..083462a403ea 100644 >--- a/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__login.cc >+++ b/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__login.cc >@@ -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 @@ > >diff --git a/sysutils/google-compute-engine-oslogin/files/patch-utils_oslogin__utils.cc b/sysutils/google-compute-engine-oslogin/files/patch-utils_oslogin__utils.cc >index fa74bacf80a0..2ad4215a9d1e 100644 >--- a/sysutils/google-compute-engine-oslogin/files/patch-utils_oslogin__utils.cc >+++ b/sysutils/google-compute-engine-oslogin/files/patch-utils_oslogin__utils.cc >@@ -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) { >diff --git a/sysutils/google-compute-engine-oslogin/pkg-plist b/sysutils/google-compute-engine-oslogin/pkg-plist >index 52fa576559ea..d4fe240eac5d 100644 >--- a/sysutils/google-compute-engine-oslogin/pkg-plist >+++ b/sysutils/google-compute-engine-oslogin/pkg-plist >@@ -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 >-- >2.17.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
helen.koike
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 228949
:
194195
|
194196
| 194197 |
194199