View | Details | Raw Unified | Return to bug 228949 | Differences between
and this patch

Collapse All | Expand All

(-)b/sysutils/google-compute-engine-oslogin/Makefile (-2 / +3 lines)
Lines 1-7 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTNAME=	google-compute-engine-oslogin
3
PORTNAME=	google-compute-engine-oslogin
4
DISTVERSION=	1.1.5
4
DISTVERSION=	1.3.0
5
CATEGORIES=	sysutils
5
CATEGORIES=	sysutils
6
6
7
MAINTAINER=	helen.koike@collabora.com
7
MAINTAINER=	helen.koike@collabora.com
Lines 25-31 USE_GCC= any Link Here
25
USE_GITHUB=	yes
25
USE_GITHUB=	yes
26
GH_ACCOUNT=	GoogleCloudPlatform
26
GH_ACCOUNT=	GoogleCloudPlatform
27
GH_PROJECT=	compute-image-packages
27
GH_PROJECT=	compute-image-packages
28
GH_TAGNAME=	20180227
28
GH_TAGNAME=	20180611
29
MAKE_ARGS=	JSON_INCLUDE_PATH=${LOCALBASE}/include/json-c \
29
MAKE_ARGS=	JSON_INCLUDE_PATH=${LOCALBASE}/include/json-c \
30
		BIN_INSTALL_PATH=/bin \
30
		BIN_INSTALL_PATH=/bin \
31
		PAM_INSTALL_PATH=/lib \
31
		PAM_INSTALL_PATH=/lib \
Lines 42-47 post-patch: Link Here
42
42
43
post-install:
43
post-install:
44
	${LN} -sf libnss_${PORTNAME}-${DISTVERSION}.so ${STAGEDIR}${PREFIX}/lib/nss_oslogin.so.1
44
	${LN} -sf libnss_${PORTNAME}-${DISTVERSION}.so ${STAGEDIR}${PREFIX}/lib/nss_oslogin.so.1
45
	${LN} -sf libnss_cache_${PORTNAME}-${DISTVERSION}.so ${STAGEDIR}${PREFIX}/lib/nss_cache_oslogin.so.1
45
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/google_authorized_keys \
46
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/google_authorized_keys \
46
		${STAGEDIR}${PREFIX}/lib/libnss_google-compute-engine-oslogin-${DISTVERSION}.so \
47
		${STAGEDIR}${PREFIX}/lib/libnss_google-compute-engine-oslogin-${DISTVERSION}.so \
47
		${STAGEDIR}${PREFIX}/lib/pam_oslogin_admin.so \
48
		${STAGEDIR}${PREFIX}/lib/pam_oslogin_admin.so \
(-)b/sysutils/google-compute-engine-oslogin/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1522046585
1
TIMESTAMP = 1528807879
2
SHA256 (GoogleCloudPlatform-compute-image-packages-1.1.5-20180227_GH0.tar.gz) = 80e8c8059273f76e82343993a0282c51b633ba8c8dc5a14664919ee1b9e0fbaf
2
SHA256 (GoogleCloudPlatform-compute-image-packages-1.3.0-20180611_GH0.tar.gz) = f71bdc6d01cff014bb4d066096be9a6e067fd3028c730cc4c9557001ec99ab6e
3
SIZE (GoogleCloudPlatform-compute-image-packages-1.1.5-20180227_GH0.tar.gz) = 135485
3
SIZE (GoogleCloudPlatform-compute-image-packages-1.3.0-20180611_GH0.tar.gz) = 143678
(-)b/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control (-6 / +10 lines)
Lines 1-6 Link Here
1
--- bin/google_oslogin_control.orig	2018-02-27 22:53:04 UTC
1
--- bin/google_oslogin_control.orig	2018-06-11 17:16:50 UTC
2
+++ bin/google_oslogin_control
2
+++ bin/google_oslogin_control
3
@@ -65,22 +65,24 @@ overwrite_file() {
3
@@ -65,24 +65,26 @@ overwrite_file() {
4
 
4
 
5
 remove_from_config() {
5
 remove_from_config() {
6
   config=$1
6
   config=$1
Lines 9-15 Link Here
9
 }
9
 }
10
 
10
 
11
 remove_from_nss_config() {
11
 remove_from_nss_config() {
12
-  sed -i '/^passwd:/ s/ cache_oslogin oslogin//' ${nss_config}.new
13
-  sed -i '/^passwd:/ s/ cache oslogin//' ${nss_config}.new
12
-  sed -i '/^passwd:/ s/ oslogin//' ${nss_config}.new
14
-  sed -i '/^passwd:/ s/ oslogin//' ${nss_config}.new
15
+  gsed -i '/^passwd:/ s/ cache_oslogin oslogin//' ${nss_config}.new
16
+  gsed -i '/^passwd:/ s/ cache oslogin//' ${nss_config}.new
13
+  gsed -i '/^passwd:/ s/ oslogin//' ${nss_config}.new
17
+  gsed -i '/^passwd:/ s/ oslogin//' ${nss_config}.new
14
 }
18
 }
15
 
19
 
Lines 23-36 Link Here
23
 
27
 
24
 add_to_nss_config() {
28
 add_to_nss_config() {
25
   remove_from_nss_config
29
   remove_from_nss_config
26
-  sed -i '/^passwd:/ s/$/ oslogin/' ${nss_config}.new
30
-  sed -i '/^passwd:/ s/$/ cache_oslogin oslogin/' ${nss_config}.new
27
+  gsed -i '/^passwd:/ s/$/ oslogin/' ${nss_config}.new
31
+  gsed -i '/^passwd:/ s/$/ cache_oslogin oslogin/' ${nss_config}.new
28
+  # Replace compat by files (as compat cannot be used with other sources)
32
+  # Replace compat by files (as compat cannot be used with other sources)
29
+  gsed -i '/^passwd:/ s/compat/files/' ${nss_config}.new
33
+  gsed -i '/^passwd:/ s/compat/files/' ${nss_config}.new
30
 }
34
 }
31
 
35
 
32
 add_to_pam_config() {
36
 add_to_pam_config() {
33
@@ -97,9 +99,9 @@ ${pam_homedir}
37
@@ -99,9 +101,9 @@ ${pam_homedir}
34
 "
38
 "
35
     echo "${added_config}$(cat ${pam_config}.new)" > ${pam_config}.new
39
     echo "${added_config}$(cat ${pam_config}.new)" > ${pam_config}.new
36
   else
40
   else
Lines 43-49 Link Here
43
   fi
47
   fi
44
 }
48
 }
45
 
49
 
46
@@ -113,7 +115,7 @@ restart_service() {
50
@@ -115,7 +117,7 @@ restart_service() {
47
     fi
51
     fi
48
   fi
52
   fi
49
   if which service > /dev/null 2>&1; then
53
   if which service > /dev/null 2>&1; then
(-)b/sysutils/google-compute-engine-oslogin/files/patch-libnss__cache__oslogin_nss__cache__oslogin.c (+46 lines)
Added Link Here
1
--- libnss_cache_oslogin/nss_cache_oslogin.c.orig	2018-06-11 17:16:50 UTC
2
+++ libnss_cache_oslogin/nss_cache_oslogin.c
3
@@ -16,6 +16,7 @@
4
 
5
 #include "nss_cache_oslogin.h"
6
 
7
+#include <nsswitch.h>
8
 #include <sys/mman.h>
9
 
10
 // Locking implementation: use pthreads.
11
@@ -32,7 +33,7 @@ static pthread_mutex_t mutex = PTHREAD_M
12
 
13
 static FILE *p_file = NULL;
14
 static char p_filename[NSS_CACHE_OSLOGIN_PATH_LENGTH] =
15
-    "/etc/oslogin_passwd.cache";
16
+    "/usr/local/etc/oslogin_passwd.cache";
17
 #ifdef BSD
18
 extern int fgetpwent_r(FILE *, struct passwd *, char *, size_t,
19
                        struct passwd **);
20
@@ -435,3 +436,26 @@ enum nss_status _nss_cache_oslogin_getpw
21
 
22
   return ret;
23
 }
24
+
25
+NSS_METHOD_PROTOTYPE(__nss_compat_getpwnam_r);
26
+NSS_METHOD_PROTOTYPE(__nss_compat_getpwuid_r);
27
+NSS_METHOD_PROTOTYPE(__nss_compat_getpwent_r);
28
+NSS_METHOD_PROTOTYPE(__nss_compat_setpwent);
29
+NSS_METHOD_PROTOTYPE(__nss_compat_endpwent);
30
+
31
+static ns_mtab methods[] = {
32
+    { NSDB_PASSWD, "getpwnam_r", __nss_compat_getpwnam_r, (void*)_nss_cache_oslogin_getpwnam_r },
33
+    { NSDB_PASSWD, "getpwuid_r", __nss_compat_getpwuid_r, (void*)_nss_cache_oslogin_getpwuid_r },
34
+    { NSDB_PASSWD, "getpwent_r", __nss_compat_getpwent_r, (void*)_nss_cache_oslogin_getpwent_r },
35
+    { NSDB_PASSWD, "endpwent",   __nss_compat_endpwent,   (void*)_nss_cache_oslogin_endpwent },
36
+    { NSDB_PASSWD, "setpwent",   __nss_compat_setpwent,   (void*)_nss_cache_oslogin_setpwent },
37
+};
38
+
39
+ns_mtab *
40
+nss_module_register (const char *name, unsigned int *size,
41
+		                          nss_module_unregister_fn *unregister)
42
+{
43
+    *size = sizeof (methods) / sizeof (methods[0]);
44
+    *unregister = NULL;
45
+    return (methods);
46
+}
(-)b/sysutils/google-compute-engine-oslogin/files/patch-nss__cache_nss__cache.cc (+13 lines)
Added Link Here
1
--- nss_cache/nss_cache.cc.orig	2018-06-11 17:16:50 UTC
2
+++ nss_cache/nss_cache.cc
3
@@ -31,8 +31,8 @@ using oslogin_utils::MutexLock;
4
 using oslogin_utils::NssCache;
5
 
6
 // File paths for the nss cache file.
7
-static const char kDefaultFilePath[] = "/etc/oslogin_passwd.cache";
8
-static const char kDefaultBackupFilePath[] = "/etc/oslogin_passwd.cache.bak";
9
+static const char kDefaultFilePath[] = "/usr/local/etc/oslogin_passwd.cache";
10
+static const char kDefaultBackupFilePath[] = "/usr/local/etc/oslogin_passwd.cache.bak";
11
 
12
 // Local NSS Cache size. This affects the maximum number of passwd entries per
13
 // http request.
(-)b/sysutils/google-compute-engine-oslogin/files/patch-nss__module_nss__oslogin.cc (-5 / +8 lines)
Lines 1-4 Link Here
1
--- nss_module/nss_oslogin.cc.orig	2018-02-27 22:53:04 UTC
1
--- nss_module/nss_oslogin.cc.orig	2018-06-11 17:16:50 UTC
2
+++ nss_module/nss_oslogin.cc
2
+++ nss_module/nss_oslogin.cc
3
@@ -16,6 +16,7 @@
3
@@ -16,6 +16,7 @@
4
 #include <errno.h>
4
 #include <errno.h>
Lines 8-17 Link Here
8
 #include <pthread.h>
8
 #include <pthread.h>
9
 #include <pwd.h>
9
 #include <pwd.h>
10
 #include <sys/types.h>
10
 #include <sys/types.h>
11
@@ -150,4 +151,27 @@ int _nss_oslogin_getpwent_r(struct passw
11
@@ -103,4 +104,30 @@ int _nss_oslogin_getpwnam_r(const char *
12
   }
12
 // nss_getpwent_r() is intentionally left unimplemented. This functionality is
13
   return NSS_STATUS_SUCCESS;
13
 // now covered by the nss_cache binary and nss_cache module.
14
 }
14
 
15
+void _nss_oslogin_getpwent_r() {}
16
+void _nss_oslogin_endpwent() {}
17
+void _nss_oslogin_setpwent() {}
15
+
18
+
16
+NSS_METHOD_PROTOTYPE(__nss_compat_getpwnam_r);
19
+NSS_METHOD_PROTOTYPE(__nss_compat_getpwnam_r);
17
+NSS_METHOD_PROTOTYPE(__nss_compat_getpwuid_r);
20
+NSS_METHOD_PROTOTYPE(__nss_compat_getpwuid_r);
(-)b/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__admin.cc (-1 / +1 lines)
Lines 1-4 Link Here
1
--- pam_module/pam_oslogin_admin.cc.orig	2018-02-27 22:53:04 UTC
1
--- pam_module/pam_oslogin_admin.cc.orig	2018-06-11 17:16:50 UTC
2
+++ pam_module/pam_oslogin_admin.cc
2
+++ pam_module/pam_oslogin_admin.cc
3
@@ -14,7 +14,6 @@
3
@@ -14,7 +14,6 @@
4
 
4
 
(-)b/sysutils/google-compute-engine-oslogin/files/patch-pam__module_pam__oslogin__login.cc (-1 / +1 lines)
Lines 1-4 Link Here
1
--- pam_module/pam_oslogin_login.cc.orig	2018-02-27 22:53:04 UTC
1
--- pam_module/pam_oslogin_login.cc.orig	2018-06-11 17:16:50 UTC
2
+++ pam_module/pam_oslogin_login.cc
2
+++ pam_module/pam_oslogin_login.cc
3
@@ -14,7 +14,6 @@
3
@@ -14,7 +14,6 @@
4
 
4
 
(-)b/sysutils/google-compute-engine-oslogin/files/patch-utils_oslogin__utils.cc (-2 / +2 lines)
Lines 1-6 Link Here
1
--- utils/oslogin_utils.cc.orig	2018-02-27 22:53:04 UTC
1
--- utils/oslogin_utils.cc.orig	2018-06-11 17:16:50 UTC
2
+++ utils/oslogin_utils.cc
2
+++ utils/oslogin_utils.cc
3
@@ -222,7 +222,14 @@ bool ValidatePasswd(struct passwd* resul
3
@@ -255,7 +255,14 @@ bool ValidatePasswd(struct passwd* resul
4
     }
4
     }
5
   }
5
   }
6
   if (strlen(result->pw_shell) == 0) {
6
   if (strlen(result->pw_shell) == 0) {
(-)b/sysutils/google-compute-engine-oslogin/pkg-plist (-1 / +3 lines)
Lines 1-6 Link Here
1
bin/google_authorized_keys
1
bin/google_authorized_keys
2
bin/google_oslogin_control
2
bin/google_oslogin_control
3
bin/google_oslogin_nss_cache
4
lib/libnss_cache_google-compute-engine-oslogin-%%DISTVERSION%%.so
3
lib/libnss_google-compute-engine-oslogin-%%DISTVERSION%%.so
5
lib/libnss_google-compute-engine-oslogin-%%DISTVERSION%%.so
4
lib/nss_oslogin.so.1
6
lib/nss_oslogin.so.1
7
lib/nss_cache_oslogin.so.1
5
lib/pam_oslogin_admin.so
8
lib/pam_oslogin_admin.so
6
lib/pam_oslogin_login.so
9
lib/pam_oslogin_login.so
7
- 

Return to bug 228949