Bug 2087

Summary: endgrent() is not available on Android
Product: Portable OpenSSH Reporter: Nathan Osman <nathan.osman>
Component: sshAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: minor CC: dtucker
Priority: P5    
Version: 6.2p1   
Hardware: All   
OS: Linux   
Bug Depends on:    
Bug Blocks: 2076    
Attachments:
Description Flags
wraps call to endgrent with HAVE_ENDGRENT and checks for function in configure.ac
none
add an empty endgrent in compat library djm: ok+

Description Nathan Osman 2013-04-05 06:03:47 AEDT
Created attachment 2233 [details]
wraps call to endgrent with HAVE_ENDGRENT and checks for function in configure.ac

Android does not provide the endgrent() function, leading to the following compilation error:

  session.c:1502:20: warning: implicit declaration of function 'endgrent'

The attached patch adds endgrent to the list of functions that configure.ac checks for and wraps the call to endgrent() in session.c with a #ifdef / #endif.
Comment 1 Darren Tucker 2013-04-05 09:44:22 AEDT
Created attachment 2234 [details]
add an empty endgrent in compat library

#ifdefs in the main codebase are an ongoing maintenance burden, since they cause diffs from openbsd's ssh to no longer apply, so we try to avoid this when possible.

instead, I'd put a no-op implementation of endgrent in the compat library.  I think this patch should work (can you confirm)?
Comment 2 Nathan Osman 2013-04-05 10:30:37 AEDT
I have applied your patch and can confirm that it eliminates the error.
Comment 3 Darren Tucker 2013-05-10 14:04:49 AEST
Thanks.  We'll put it on the list for the 6.3 release.
Comment 4 Darren Tucker 2013-05-30 08:29:37 AEST
Patch applied, will be in 6.3p1.  Thanks.
Comment 5 Damien Miller 2015-08-11 23:02:27 AEST
Set all RESOLVED bugs to CLOSED with release of OpenSSH 7.1