Bug 2087 - endgrent() is not available on Android
Summary: endgrent() is not available on Android
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 6.2p1
Hardware: All Linux
: P5 minor
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_6_3
  Show dependency treegraph
 
Reported: 2013-04-05 06:03 AEDT by Nathan Osman
Modified: 2015-08-11 23:02 AEST (History)
1 user (show)

See Also:


Attachments
wraps call to endgrent with HAVE_ENDGRENT and checks for function in configure.ac (507 bytes, patch)
2013-04-05 06:03 AEDT, Nathan Osman
no flags Details | Diff
add an empty endgrent in compat library (890 bytes, patch)
2013-04-05 09:44 AEDT, Darren Tucker
djm: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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