Bug 238560

Summary: sysutils/google-compute-engine-oslogin: fix OSLogin
Product: Ports & Packages Reporter: Lucas Kanashiro <lucas.kanashiro>
Component: Individual Port(s)Assignee: Raphael Kubo da Costa <rakuco>
Status: Closed FIXED    
Severity: Affects Only Me CC: freebsd, helen.koike, ler, lucas.kanashiro, rakuco, riggs
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
fix OSLogin
none
Update google-compute-engine-oslogin to version 20191018.00 helen.koike: maintainer-approval+

Description Lucas Kanashiro 2019-06-14 13:02:13 UTC
Larry Rosenman and Glen Barber from the FreeBSD team reported that the OSLogin feature has not been working since the last update I made to sysutils/google-compute-engine-oslogin ports package. I found out that the problem is in some modifications made by upstream in the shell script responsible to activate and deactivate the feature. I prepared the attached patch to fix it. With the patch applied in a FreeBSD 13 instance on GCE I was able to use the OSLogin feature without any problem. I also sent this same patch upstream.
Comment 1 Thomas Zander freebsd_committer freebsd_triage 2019-09-21 10:58:35 UTC
There is no attachment. Is this report still up to date?
Comment 2 Peter 2019-10-02 15:55:25 UTC
still having issues with oslogin
it seems this patch broke it:
  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238561
or directly:
  https://svnweb.freebsd.org/ports/head/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control?view=markup&pathrev=504192

line 80 - more specifically the quotes need to be removed:
  for func in "$funcs"; do
should be
  for func in $funcs; do


example:
crook:$ 
crook:$ cat /tmp/letter.sh 
z="a b c d e f"

echo withquotes:
for letter in "$z"; do
  echo $letter
done

echo noquotes:
for letter in $z; do
  echo $letter
done
crook:$ 
crook:$ 
crook:$ sh /tmp/letter.sh 
withquotes:
a b c d e f
noquotes:
a
b
c
d
e
f
crook:$
Comment 3 Peter 2019-10-02 19:27:50 UTC
Also,
 FreeBSD sed needs a space after -i in 'google_oslogin_control'

's/sed -i/sed -i /g'

example:
crook:$ sed -i"" 's/z/aaa/g' /tmp/letter.sh 
sed: 1: "/tmp/letter.sh": extra characters at the end of l command
crook:$ 
crook:$ sed -i "" 's/z/aaa/g' /tmp/letter.sh
crook:$
Comment 4 Peter 2019-10-02 19:39:54 UTC
(In reply to Peter from comment #3)
n/m - it uses 'gsed' which doesn't need that extra space.
Comment 5 Helen Koike 2019-10-21 08:40:55 UTC
This upstream commit should fix the issue: https://github.com/GoogleCloudPlatform/compute-image-packages/commit/6e352be28da49f3ca31579552ed56079a4069de5

I'll update the package.
Comment 6 Helen Koike 2019-10-25 08:59:29 UTC
Created attachment 208594 [details]
Update google-compute-engine-oslogin to version 20191018.00

Follow attached the patch updating oslogin to latest version 20191018.00.
I tested and it is working as before.

Major changes in the package:

- Upstream moved to another github repo
- Upstream versioning numbering changed to dates

The patches that area included were already sent upstream.

The only missing feature is the usage of oslogin in the group database that is not working (it causes "sudo su" with an oslogin user to stall). But this wans't present in the last version, so I'm leaving it disabled for now until we have a better solution.
Comment 7 commit-hook freebsd_committer freebsd_triage 2019-11-03 17:00:27 UTC
A commit references this bug:

Author: rakuco
Date: Sun Nov  3 16:59:41 UTC 2019
New revision: 516443
URL: https://svnweb.freebsd.org/changeset/ports/516443

Log:
  Update to 20191018.00.

  Follow-up to bug 238561, which did not fully fix the port.

  Major changes in the package:
  - Upstream moved to another github repo
  - Upstream versioning numbering changed to dates

  The patches that area included were already sent upstream.

  The only missing feature is the usage of oslogin in the group database that is
  not working (it causes "sudo su" with an oslogin user to stall). But this
  wans't present in the last version, so it is left disabled for now until we
  have a better solution.

  PR:		238561
  PR:		238560
  Submitted by:	Helen Koike <helen.koike@collabora.com>
  Tested by:	Helen Koike <helen.koike@collabora.com>
  MFH:		2019Q4

Changes:
  head/sysutils/google-compute-engine-oslogin/Makefile
  head/sysutils/google-compute-engine-oslogin/distinfo
  head/sysutils/google-compute-engine-oslogin/files/patch-bin_google__oslogin__control
  head/sysutils/google-compute-engine-oslogin/files/patch-google__oslogin__control
  head/sysutils/google-compute-engine-oslogin/files/patch-src_Makefile
  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__oslogin.cc
  head/sysutils/google-compute-engine-oslogin/pkg-descr
  head/sysutils/google-compute-engine-oslogin/pkg-plist
Comment 8 Raphael Kubo da Costa freebsd_committer freebsd_triage 2019-11-03 17:01:00 UTC
Thanks, Helen!