Index: head/sysutils/google-compute-engine-oslogin/Makefile =================================================================== --- head/sysutils/google-compute-engine-oslogin/Makefile (revision 516442) +++ head/sysutils/google-compute-engine-oslogin/Makefile (revision 516443) @@ -1,51 +1,44 @@ # $FreeBSD$ PORTNAME= google-compute-engine-oslogin -DISTVERSION= 1.5.3 -PORTREVISION= 2 +DISTVERSION= 20191018.00 CATEGORIES= sysutils MAINTAINER= ports@FreeBSD.org COMMENT= OS Login Guest Environment for Google Compute Engine LICENSE= APACHE20 -LICENSE_FILE= ${WRKSRC}/../../LICENSE +LICENSE_FILE= ${WRKSRC}/packaging/debian/copyright LIB_DEPENDS= libcurl.so:ftp/curl \ libjson-c.so:devel/json-c RUN_DEPENDS= gsed:textproc/gsed \ ${LOCALBASE}/lib/pam_mkhomedir.so:security/pam_mkhomedir USES= compiler:c++11-lang gmake localbase:ldflags USE_LDCONFIG= yes USE_GITHUB= yes GH_ACCOUNT= GoogleCloudPlatform -GH_PROJECT= compute-image-packages -GH_TAGNAME= 20190522 +GH_PROJECT= guest-oslogin +GH_TAGNAME= 5a710bb -MAKE_ARGS= JSON_INCLUDE_PATH=${LOCALBASE}/include/json-c \ - BIN_INSTALL_PATH=/bin \ - PAM_INSTALL_PATH=/lib \ - AUTHKEYS_INSTALL_PATH=/bin \ - NSS_LIBRARY_SONAME=nss_oslogin.so.1 +PLIST_SUB+= DISTVERSION=${DISTVERSION} -WRKSRC_SUBDIR= packages/google-compute-engine-oslogin +MAKE_ARGS= CPPFLAGS="-Iinclude -I${LOCALBASE}/include/json-c -I${LOCALBASE}/include" \ + LDLIBS="-lcurl -ljson-c -L${LOCALBASE}/lib" \ + DESTDIR=${STAGEDIR}${PREFIX} \ + PREFIX=${PREFIX} \ + LIBDIR=${PREFIX}/lib \ + PAMDIR=${PREFIX}/lib \ + MANDIR=${PREFIX}/man -PLIST_SUB= DISTVERSION=${DISTVERSION} - -post-patch: - @${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 - ${LN} -sf libnss_cache_${PORTNAME}-${DISTVERSION}.so ${STAGEDIR}${PREFIX}/lib/nss_cache_oslogin.so.1 + ${LN} -sf libnss_oslogin-${DISTVERSION}.so ${STAGEDIR}${PREFIX}/lib/nss_oslogin.so.1 + ${LN} -sf libnss_cache_oslogin-${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/libnss_cache_google-compute-engine-oslogin-${DISTVERSION}.so \ + ${STAGEDIR}${PREFIX}/lib/libnss_oslogin-${DISTVERSION}.so \ + ${STAGEDIR}${PREFIX}/lib/libnss_cache_oslogin-${DISTVERSION}.so \ ${STAGEDIR}${PREFIX}/lib/pam_oslogin_admin.so \ ${STAGEDIR}${PREFIX}/lib/pam_oslogin_login.so .include Index: head/sysutils/google-compute-engine-oslogin/distinfo =================================================================== --- head/sysutils/google-compute-engine-oslogin/distinfo (revision 516442) +++ head/sysutils/google-compute-engine-oslogin/distinfo (revision 516443) @@ -1,3 +1,3 @@ -TIMESTAMP = 1559044433 -SHA256 (GoogleCloudPlatform-compute-image-packages-1.5.3-20190522_GH0.tar.gz) = 8cfb338c3c768ea7e76e479728a1438b2f10b0df13bddd70c9fbcbfc1273efd6 -SIZE (GoogleCloudPlatform-compute-image-packages-1.5.3-20190522_GH0.tar.gz) = 132314 +TIMESTAMP = 1571819820 +SHA256 (GoogleCloudPlatform-guest-oslogin-20191018.00-5a710bb_GH0.tar.gz) = e2416461d61b1f4a81cf13a883ea2922271d09882c951eec61c1d3ca398c927e +SIZE (GoogleCloudPlatform-guest-oslogin-20191018.00-5a710bb_GH0.tar.gz) = 36556 Index: head/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control =================================================================== --- head/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control (revision 516442) +++ head/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control (nonexistent) @@ -1,103 +0,0 @@ ---- bin/google_oslogin_control.orig 2019-06-14 12:36:44 UTC -+++ bin/google_oslogin_control -@@ -154,6 +154,7 @@ modify_pam_config() ( - pam_account_oslogin="account optional pam_oslogin_admin.so" - pam_account_admin="account requisite pam_oslogin_login.so" - pam_session_homedir="session optional pam_mkhomedir.so" -+ pam_account_su="account optional pam_oslogin_login.so" - fi - - local added_config="" -@@ -201,6 +202,11 @@ modify_pam_config() ( - # Get location of system-remote-login. - insert=$($sed -rn "/^auth\s+include\s+system-remote-login/=" "$pam_sshd_config") - # TODO: find su_insert point for arch linux. -+ elif is_freebsd; then -+ # Get location of the first auth occurrence. -+ insert=$($sed -rn '/^auth/=' "$pam_sshd_config" | head -1) -+ # Get location of the first account occurrence. -+ su_insert=$($sed -rn '/^account/=' "$pam_su_config" | head -1) - fi - - added_config="$added_comment" -@@ -223,7 +229,7 @@ modify_pam_config() ( - # Insert su blocker at top of `su:account` stack. - if [ -n "$su_insert" ] && ! grep -qE "$pam_account_su" "$pam_su_config"; then - added_su_config="${added_comment}\n${pam_account_su}" -- sed -i"" "${su_insert}i ${added_su_config}" "$pam_su_config" -+ $sed -i"" "${su_insert}i ${added_su_config}" "$pam_su_config" - fi - - # Append account modules at end of `sshd:account` stack. -@@ -314,16 +320,24 @@ restart_sshd() { - return 0 - fi - echo "Restarting SSHD" -- for svc in "ssh" "sshd"; do -- restart_service "$svc" -- done -+ if is_freebsd; then -+ restart_service "sshd" -+ else -+ for svc in "ssh" "sshd"; do -+ restart_service "$svc" -+ done -+ fi - } - - restart_svcs() { - echo "Restarting optional services." -- for svc in "nscd" "unscd" "systemd-logind" "cron" "crond"; do -- restart_service "$svc" -- done -+ if is_freebsd; then -+ restart_service "cron" -+ else -+ for svc in "nscd" "unscd" "systemd-logind" "cron" "crond"; do -+ restart_service "$svc" -+ done -+ fi - } - - setup_google_dirs() { -@@ -347,18 +361,34 @@ remove_google_dirs() { - } - - activate() { -- for func in modify_sshd_conf modify_nsswitch_conf \ -- modify_pam_config setup_google_dirs restart_svcs restart_sshd \ -- modify_group_conf; do -+ if is_freebsd; then -+ # In FreeBSD there is no pam_group config file similar to -+ # /etc/security/group.conf. -+ funcs="modify_sshd_conf modify_nsswitch_conf modify_pam_config \ -+ setup_google_dirs restart_svcs restart_sshd" -+ else -+ funcs="modify_sshd_conf modify_nsswitch_conf modify_pam_config \ -+ setup_google_dirs restart_svcs restart_sshd modify_group_conf" -+ fi -+ -+ for func in "$funcs"; do - $func - [ $? -eq 0 ] || return 1 - done - } - - deactivate() { -- for func in remove_google_dirs restore_nsswitch_conf \ -- restore_sshd_conf restore_pam_config restart_svcs restart_sshd \ -- restore_group_conf; do -+ if is_freebsd; then -+ # In FreeBSD there is no pam_group config file similar to -+ # /etc/security/group.conf. -+ funcs="remove_google_dirs restore_nsswitch_conf restore_sshd_conf \ -+ restore_pam_config restart_svcs restart_sshd" -+ else -+ funcs="remove_google_dirs restore_nsswitch_conf restore_sshd_conf \ -+ restore_pam_config restart_svcs restart_sshd restore_group_conf" -+ fi -+ -+ for func in "$funcs"; do - $func - done - } Property changes on: head/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/google-compute-engine-oslogin/files/patch-google__oslogin__control =================================================================== --- head/sysutils/google-compute-engine-oslogin/files/patch-google__oslogin__control (nonexistent) +++ head/sysutils/google-compute-engine-oslogin/files/patch-google__oslogin__control (revision 516443) @@ -0,0 +1,21 @@ +--- google_oslogin_control.orig 2019-10-18 20:10:43 UTC ++++ google_oslogin_control +@@ -39,7 +39,8 @@ modify_nsswitch_conf() { + + if ! grep -q '^passwd:.*oslogin' "$nss_config"; then + $sed -i"" '/^passwd:/ s/$/ cache_oslogin oslogin/' "$nss_config" +- $sed -i"" '/^group:/ s/$/ cache_oslogin oslogin/' "$nss_config" ++ # OsLogin for group database is still not supported for FreeBSD ++ # $sed -i"" '/^group:/ s/$/ cache_oslogin oslogin/' "$nss_config" + fi + + if is_freebsd && grep -q '^passwd:.*compat' "$nss_config"; then +@@ -51,7 +52,7 @@ restore_nsswitch_conf() { + local nss_config="${1:-${nss_config}}" + + $sed -i"" '/^passwd:/ s/ cache_oslogin oslogin//' "$nss_config" +- $sed -i"" '/^group:/ s/ cache_oslogin oslogin//' "$nss_config" ++ # $sed -i"" '/^group:/ s/ cache_oslogin oslogin//' "$nss_config" + if is_freebsd; then + $sed -i"" '/^passwd:/ s/files/compat/' "$nss_config" + fi Property changes on: head/sysutils/google-compute-engine-oslogin/files/patch-google__oslogin__control ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/google-compute-engine-oslogin/files/patch-src_Makefile =================================================================== --- head/sysutils/google-compute-engine-oslogin/files/patch-src_Makefile (nonexistent) +++ head/sysutils/google-compute-engine-oslogin/files/patch-src_Makefile (revision 516443) @@ -0,0 +1,29 @@ +--- src/Makefile.orig 2019-10-23 08:18:46 UTC ++++ src/Makefile +@@ -70,17 +70,21 @@ install: all + install -d $(DESTDIR)$(PAMDIR) + install -d $(DESTDIR)$(BINDIR) + install -d $(DESTDIR)$(MANDIR)/man8 +- install -m 0644 -t $(DESTDIR)$(LIBDIR) $(NSS_OSLOGIN) $(NSS_CACHE_OSLOGIN) ++ install -m 0644 $(NSS_CACHE_OSLOGIN) $(DESTDIR)$(LIBDIR) ++ install -m 0644 $(NSS_OSLOGIN) $(DESTDIR)$(LIBDIR) + ln -sf $(NSS_OSLOGIN) $(DESTDIR)$(LIBDIR)/$(NSS_OSLOGIN_SONAME) + ln -sf $(NSS_CACHE_OSLOGIN) $(DESTDIR)$(LIBDIR)/$(NSS_CACHE_OSLOGIN_SONAME) +- install -m 0644 -t $(DESTDIR)$(PAMDIR) $(PAM_ADMIN) $(PAM_LOGIN) +- install -m 0755 -t $(DESTDIR)$(BINDIR) $(BINARIES) $(TOPDIR)/google_oslogin_control +- install -m 0644 -t $(DESTDIR)$(MANDIR)/man8 $(TOPDIR)/man/nss-oslogin.8 $(TOPDIR)/man/nss-cache-oslogin.8 ++ install -m 0644 $(PAM_LOGIN) $(DESTDIR)$(PAMDIR) ++ install -m 0644 $(PAM_ADMIN) $(DESTDIR)$(PAMDIR) ++ install -m 0755 $(TOPDIR)/google_oslogin_control $(DESTDIR)$(BINDIR) ++ install -m 0755 $(BINARIES) $(DESTDIR)$(BINDIR) ++ install -m 0644 $(TOPDIR)/man/nss-cache-oslogin.8 $(DESTDIR)$(MANDIR)/man8 ++ install -m 0644 $(TOPDIR)/man/nss-oslogin.8 $(DESTDIR)$(MANDIR)/man8 + gzip -9 $(DESTDIR)$(MANDIR)/man8/nss-oslogin.8 + gzip -9 $(DESTDIR)$(MANDIR)/man8/nss-cache-oslogin.8 + ln -sf nss-oslogin.8.gz $(DESTDIR)$(MANDIR)/man8/$(NSS_OSLOGIN_SONAME).8.gz + ln -sf nss-cache-oslogin.8.gz $(DESTDIR)$(MANDIR)/man8/$(NSS_CACHE_OSLOGIN_SONAME).8.gz + ifdef INSTALL_SELINUX + install -d $(DESTDIR)/usr/share/selinux/packages +- install -m 0644 -t $(DESTDIR)/usr/share/selinux/packages $(TOPDIR)/selinux/oslogin.pp ++ install -m 0644 $(TOPDIR)/selinux/oslogin.pp $(DESTDIR)/usr/share/selinux/packages + endif Property changes on: head/sysutils/google-compute-engine-oslogin/files/patch-src_Makefile ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/google-compute-engine-oslogin/files/patch-src_nss_nss__cache__oslogin.c =================================================================== --- head/sysutils/google-compute-engine-oslogin/files/patch-src_nss_nss__cache__oslogin.c (nonexistent) +++ head/sysutils/google-compute-engine-oslogin/files/patch-src_nss_nss__cache__oslogin.c (revision 516443) @@ -0,0 +1,11 @@ +--- src/nss/nss_cache_oslogin.c.orig 2019-10-23 07:01:45 UTC ++++ src/nss/nss_cache_oslogin.c +@@ -439,7 +439,7 @@ DECLARE_NSS_METHOD_TABLE(methods, + { NSDB_PASSWD, "getgrent_r", __nss_compat_getgrent_r, + (void*)_nss_cache_oslogin_getgrent_r }, + { NSDB_PASSWD, "endgrent", __nss_compat_endgrent, +- (void*)_nss_cache_oslogin_endgrent }, ++ (void*)_nss_cache_endgrent }, + { NSDB_PASSWD, "setgrent", __nss_compat_setgrent, + (void*)_nss_cache_oslogin_setgrent }, + ) Property changes on: head/sysutils/google-compute-engine-oslogin/files/patch-src_nss_nss__cache__oslogin.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/google-compute-engine-oslogin/files/patch-src_nss_nss__oslogin.cc =================================================================== --- head/sysutils/google-compute-engine-oslogin/files/patch-src_nss_nss__oslogin.cc (nonexistent) +++ head/sysutils/google-compute-engine-oslogin/files/patch-src_nss_nss__oslogin.cc (revision 516443) @@ -0,0 +1,11 @@ +--- src/nss/nss_oslogin.cc.orig 2019-10-23 06:43:42 UTC ++++ src/nss/nss_oslogin.cc +@@ -225,7 +225,7 @@ enum nss_status _nss_oslogin_initgroups_dyn(const char + if (p_file == NULL) + return NSS_STATUS_NOTFOUND; + struct passwd *userp; +- while ((userp = fgetpwent(p_file)) != NULL) ++ while ((userp = getpwent()) != NULL) + if (strcmp(userp->pw_name, user) == 0) + return NSS_STATUS_NOTFOUND; + fclose(p_file); Property changes on: head/sysutils/google-compute-engine-oslogin/files/patch-src_nss_nss__oslogin.cc ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/google-compute-engine-oslogin/pkg-descr =================================================================== --- head/sysutils/google-compute-engine-oslogin/pkg-descr (revision 516442) +++ head/sysutils/google-compute-engine-oslogin/pkg-descr (revision 516443) @@ -1,19 +1,19 @@ This package enables Google Cloud OS Login features on Google Compute Engine instances. The OS Login package has the following components: - Authorized Keys Command to fetch SSH keys from the user's OS Login profile and make them available to sshd. - NSS Module provides support for making OS Login user and group information available to the system, using NSS (Name Service Switch) functionality. - PAM Module provides authorization and authentication support allowing the system to use data stored in Google Cloud IAM permissions to control both, the ability to log into an instance, and to perform operations as root (sudo). - Utils provides common code to support the components listed above. In addition to the main components, there are also utilities for packaging and installing these components: - bin contains a shell script for (de)activating the package components. -WWW: https://github.com/GoogleCloudPlatform/compute-image-packages/tree/master/packages/google-compute-engine-oslogin +WWW: https://github.com/GoogleCloudPlatform/guest-oslogin Index: head/sysutils/google-compute-engine-oslogin/pkg-plist =================================================================== --- head/sysutils/google-compute-engine-oslogin/pkg-plist (revision 516442) +++ head/sysutils/google-compute-engine-oslogin/pkg-plist (revision 516443) @@ -1,9 +1,15 @@ 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/libnss_cache_oslogin-%%DISTVERSION%%.so +lib/libnss_cache_oslogin.so.2 +lib/libnss_oslogin-%%DISTVERSION%%.so +lib/libnss_oslogin.so.2 lib/nss_cache_oslogin.so.1 +lib/nss_oslogin.so.1 lib/pam_oslogin_admin.so lib/pam_oslogin_login.so +man/man8/libnss_cache_oslogin.so.2.8.gz +man/man8/libnss_oslogin.so.2.8.gz +man/man8/nss-cache-oslogin.8.gz +man/man8/nss-oslogin.8.gz