diff options
author | Steve Wills <swills@FreeBSD.org> | 2018-11-23 19:43:44 +0000 |
---|---|---|
committer | Steve Wills <swills@FreeBSD.org> | 2018-11-23 19:43:44 +0000 |
commit | 7d4313e17080784c8a98dedaa96c842c86b4ac6f (patch) | |
tree | 96f72f1638c5b09dadeb9e396d3c00e29da46056 /sysutils | |
parent | cad6fef0d4a27528ef2fca065defc3dc5b66ec8c (diff) | |
download | ports-7d4313e17080784c8a98dedaa96c842c86b4ac6f.tar.gz ports-7d4313e17080784c8a98dedaa96c842c86b4ac6f.zip |
Notes
Diffstat (limited to 'sysutils')
10 files changed, 67 insertions, 55 deletions
diff --git a/sysutils/google-compute-engine-oslogin/Makefile b/sysutils/google-compute-engine-oslogin/Makefile index 703d1e5aa100..73ace27336c7 100644 --- a/sysutils/google-compute-engine-oslogin/Makefile +++ b/sysutils/google-compute-engine-oslogin/Makefile @@ -1,8 +1,7 @@ # $FreeBSD$ PORTNAME= google-compute-engine-oslogin -DISTVERSION= 1.3.0 -PORTREVISION= 3 +DISTVERSION= 1.3.1 CATEGORIES= sysutils MAINTAINER= helen.koike@collabora.com @@ -21,7 +20,8 @@ USE_LDCONFIG= yes USE_GITHUB= yes GH_ACCOUNT= GoogleCloudPlatform GH_PROJECT= compute-image-packages -GH_TAGNAME= 20180611 +GH_TAGNAME= 20181011 + MAKE_ARGS= JSON_INCLUDE_PATH=${LOCALBASE}/include/json-c \ BIN_INSTALL_PATH=/bin \ PAM_INSTALL_PATH=/lib \ @@ -33,8 +33,10 @@ WRKSRC_SUBDIR= google_compute_engine_oslogin PLIST_SUB= DISTVERSION=${DISTVERSION} post-patch: - @${REINPLACE_CMD} -e 's|/etc/sudoers.d|${PREFIX}/etc/sudoers.d|g ; \ - s|/usr/bin|${PREFIX}/bin|g' ${WRKSRC}/bin/google_oslogin_control + @${REINPLACE_CMD} -e 's!%%PREFIX%%!${PREFIX}!' \ + ${WRKSRC}/bin/google_oslogin_control \ + ${WRKSRC}/libnss_cache_oslogin/nss_cache_oslogin.c \ + ${WRKSRC}/nss_cache/nss_cache.cc post-install: ${LN} -sf libnss_${PORTNAME}-${DISTVERSION}.so ${STAGEDIR}${PREFIX}/lib/nss_oslogin.so.1 diff --git a/sysutils/google-compute-engine-oslogin/distinfo b/sysutils/google-compute-engine-oslogin/distinfo index 92f45032aeec..b2ee48b887d7 100644 --- a/sysutils/google-compute-engine-oslogin/distinfo +++ b/sysutils/google-compute-engine-oslogin/distinfo @@ -1,3 +1,3 @@ -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 +TIMESTAMP = 1539895280 +SHA256 (GoogleCloudPlatform-compute-image-packages-1.3.1-20181011_GH0.tar.gz) = c9fb44fb8c4bbde108a2aeba44f11938c7840256ca078804ec3c720a47e79144 +SIZE (GoogleCloudPlatform-compute-image-packages-1.3.1-20181011_GH0.tar.gz) = 147405 diff --git a/sysutils/google-compute-engine-oslogin/files/patch-Makefile b/sysutils/google-compute-engine-oslogin/files/patch-Makefile deleted file mode 100644 index 695061d09c6d..000000000000 --- a/sysutils/google-compute-engine-oslogin/files/patch-Makefile +++ /dev/null @@ -1,20 +0,0 @@ ---- Makefile.orig 2018-06-11 17:16:50 UTC -+++ Makefile -@@ -96,7 +96,7 @@ $(NSS): $(NSS_LIBRARY_SOURCE) $(UTILS) - $(NSS_SRC) $(UTILS) $(LIBS) - - $(NSS_CACHE_BIN): $(NSS_CACHE_SRC) $(UTILS_SRC) -- $(CXX) $(LDFLAGS) $(INCLUDE_FLAGS) -o $(NSS_CACHE_BIN) $(NSS_CACHE_SRC) $(UTILS_SRC) $(LIBS) -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(INCLUDE_FLAGS) -o $(NSS_CACHE_BIN) $(NSS_CACHE_SRC) $(UTILS_SRC) $(LIBS) - - $(LIBNSS_CACHE_OSLOGIN_NAME): $(LIBNSS_CACHE_OBJ) $(LIBNSS_COMPAT_OBJ) - $(CXX) $(LIBNSS_SO_FLAGS) -o $(LIBNSS_CACHE_OSLOGIN_NAME) $(LIBNSS_CACHE_OBJ) $(LIBNSS_COMPAT_OBJ) -@@ -122,7 +122,7 @@ $(PAM_ADMIN_OBJ): $(PAM_ADMIN_SRC) - $(CXX) $(CXXFLAGS) -c $(PAM_ADMIN_SRC) -o $(PAM_ADMIN_OBJ) - - $(AUTHKEYS_BIN): $(AUTHKEYS_SRC) $(UTILS_SRC) -- $(CXX) $(LDFLAGS) $(INCLUDE_FLAGS) -o $(AUTHKEYS_BIN) $(AUTHKEYS_SRC) $(UTILS_SRC) $(LIBS) -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(INCLUDE_FLAGS) -o $(AUTHKEYS_BIN) $(AUTHKEYS_SRC) $(UTILS_SRC) $(LIBS) - - $(UTILS): $(UTILS_SRC) - $(CXX) $(CXXFLAGS) $(INCLUDE_FLAGS) -c $(UTILS_SRC) -o $(UTILS) 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 0294fea503ca..e36aa94a7be2 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,5 +1,23 @@ ---- bin/google_oslogin_control.orig 2018-06-11 17:16:50 UTC +--- bin/google_oslogin_control.orig 2018-10-11 16:53:23 UTC +++ bin/google_oslogin_control +@@ -20,7 +20,7 @@ sshd_config="/etc/ssh/sshd_config" + el_release_file="/etc/redhat-release" + sudoers_dir="/var/google-sudoers.d" + users_dir="/var/google-users.d" +-sudoers_file="/etc/sudoers.d/google-oslogin" ++sudoers_file="%%PREFIX%%/etc/sudoers.d/google-oslogin" + + usage() { + echo "Usage: ${script_name} {activate|deactivate|status} [--norestartsshd]" +@@ -31,7 +31,7 @@ usage() { + } + + added_comment="# Added by Google Compute Engine OS Login." +-sshd_command="AuthorizedKeysCommand /usr/bin/google_authorized_keys" ++sshd_command="AuthorizedKeysCommand %%PREFIX%%/bin/google_authorized_keys" + sshd_user="AuthorizedKeysCommandUser root" + pam_login="account requisite pam_oslogin_login.so" + pam_admin="account optional pam_oslogin_admin.so" @@ -65,24 +65,26 @@ overwrite_file() { remove_from_config() { 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 index 70e8adb10c78..52cc76b7ada9 100644 --- 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 @@ -1,4 +1,4 @@ ---- libnss_cache_oslogin/nss_cache_oslogin.c.orig 2018-06-11 17:16:50 UTC +--- libnss_cache_oslogin/nss_cache_oslogin.c.orig 2018-10-11 16:53:23 UTC +++ libnss_cache_oslogin/nss_cache_oslogin.c @@ -16,6 +16,7 @@ @@ -8,19 +8,20 @@ #include <sys/mman.h> // Locking implementation: use pthreads. -@@ -32,7 +33,7 @@ static pthread_mutex_t mutex = PTHREAD_M +@@ -32,7 +33,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZ static FILE *p_file = NULL; static char p_filename[NSS_CACHE_OSLOGIN_PATH_LENGTH] = - "/etc/oslogin_passwd.cache"; -+ "/usr/local/etc/oslogin_passwd.cache"; ++ "%%PREFIX%%/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 +@@ -434,4 +435,27 @@ enum nss_status _nss_cache_oslogin_getpwnam_r(const ch + NSS_CACHE_OSLOGIN_UNLOCK(); return ret; - } ++} + +NSS_METHOD_PROTOTYPE(__nss_compat_getpwnam_r); +NSS_METHOD_PROTOTYPE(__nss_compat_getpwuid_r); @@ -43,4 +44,4 @@ + *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 index 798158742160..a1da710d0bf1 100644 --- 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 @@ -6,8 +6,8 @@ // 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"; ++static const char kDefaultFilePath[] = "%%PREFIX%%/etc/oslogin_passwd.cache"; ++static const char kDefaultBackupFilePath[] = "%%PREFIX%%/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 b21a6b04f04c..ec257fa73e78 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-06-11 17:16:50 UTC +--- nss_module/nss_oslogin.cc.orig 2018-10-11 16:53:23 UTC +++ nss_module/nss_oslogin.cc @@ -16,6 +16,7 @@ #include <errno.h> @@ -8,7 +8,7 @@ #include <pthread.h> #include <pwd.h> #include <sys/types.h> -@@ -103,4 +104,30 @@ int _nss_oslogin_getpwnam_r(const char * +@@ -103,4 +104,30 @@ int _nss_oslogin_getpwnam_r(const char *name, struct p // nss_getpwent_r() is intentionally left unimplemented. This functionality is // now covered by the nss_cache binary and nss_cache module. 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 be094874af55..d63b4d7ab827 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-06-11 17:16:50 UTC +--- pam_module/pam_oslogin_admin.cc.orig 2018-10-11 16:53:23 UTC +++ pam_module/pam_oslogin_admin.cc @@ -14,7 +14,6 @@ @@ -8,7 +8,7 @@ #include <security/pam_modules.h> #include <sys/stat.h> #include <sys/types.h> -@@ -47,7 +46,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand +@@ -48,7 +47,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, in int pam_result = PAM_SUCCESS; const char *user_name; if ((pam_result = pam_get_user(pamh, &user_name, NULL)) != PAM_SUCCESS) { @@ -17,7 +17,7 @@ return pam_result; } string str_user_name(user_name); -@@ -77,7 +76,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand +@@ -82,7 +81,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, in if (HttpGet(url.str(), &response, &http_code) && http_code == 200 && ParseJsonToAuthorizeResponse(response)) { if (!file_exists) { 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 083462a403ea..2d8f07226c6e 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-06-11 17:16:50 UTC +--- pam_module/pam_oslogin_login.cc.orig 2018-10-11 16:53:23 UTC +++ pam_module/pam_oslogin_login.cc @@ -14,7 +14,6 @@ @@ -8,7 +8,7 @@ #include <security/pam_modules.h> #include <sys/stat.h> #include <sys/types.h> -@@ -45,7 +44,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand +@@ -46,7 +45,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, in int pam_result = PAM_PERM_DENIED; const char *user_name; if ((pam_result = pam_get_user(pamh, &user_name, NULL)) != PAM_SUCCESS) { @@ -17,7 +17,7 @@ return pam_result; } string str_user_name(user_name); -@@ -88,7 +87,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand +@@ -93,7 +92,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, in chown(users_filename.c_str(), 0, 0); chmod(users_filename.c_str(), S_IRUSR | S_IWUSR | S_IRGRP); } @@ -26,7 +26,7 @@ "Granting login permission for organization user %s.", user_name); pam_result = PAM_SUCCESS; -@@ -96,7 +95,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand +@@ -101,7 +100,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, in if (file_exists) { remove(users_filename.c_str()); } 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 2ad4215a9d1e..543906671bbc 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,18 +1,29 @@ ---- utils/oslogin_utils.cc.orig 2018-06-11 17:16:50 UTC +--- utils/oslogin_utils.cc.orig 2018-11-13 21:29:55 UTC +++ utils/oslogin_utils.cc -@@ -255,7 +255,14 @@ bool ValidatePasswd(struct passwd* resul +@@ -23,8 +23,7 @@ + #include <iostream> + #include <sstream> + +-#ifdef __GNUC__ +-#if __GNUC__ > 4 || \ ++#if defined(__clang__) || __GNUC__ > 4 || \ + (__GNUC__ == 4 && (__GNUC_MINOR__ > 9 || \ + (__GNUC_MINOR__ == 9 && \ + __GNUC_PATCHLEVEL__ > 0))) +@@ -34,7 +33,6 @@ + #include <boost/regex.hpp> + #define Regex boost + #endif +-#endif + + #include "oslogin_utils.h" + +@@ -279,7 +277,7 @@ bool ValidatePasswd(struct passwd* result, BufferManag } } if (strlen(result->pw_shell) == 0) { - if (!buf->AppendString("/bin/bash", &result->pw_shell, errnop)) { + if (!buf->AppendString("/bin/sh", &result->pw_shell, errnop)) { -+ return false; -+ } -+ } -+ -+ // If shell is set to /bin/bash, fallback to /bin/sh -+ if (strcmp(result->pw_shell, "/bin/bash") == 0 ) { -+ if (!buf->AppendString("/bin/sh", &result->pw_shell, errnop)) { return false; } } |