Re: Porting pam to Solaris, HP-UX, others

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 11 Dec 2000, Andrew Morgan wrote:

>   1. file a bug report for each logical change request - include a patch
> with that bug report.

Here's a patch so that pam_access can compile on Solaris (and probably on
other systems too).

====================== snip =======================
*** modules/pam_access/pam_access.c.orig	Sat Nov 25 01:48:05 2000
--- modules/pam_access/pam_access.c	Wed Dec 13 09:35:00 2000
***************
*** 13,19 ****
  #include <stdlib.h>
  #include <unistd.h>
  /* man page says above file includes this... */
! extern int gethostname(char *name, size_t len);
  
  #include <stdarg.h>
  #include <syslog.h>
--- 13,21 ----
  #include <stdlib.h>
  #include <unistd.h>
  /* man page says above file includes this... */
! /* Shouldn't locally declare "gethostname()" because of possible type conflicts
!    on various OSes.  Better to live with the warning */
! /* extern int gethostname(char *name, size_t len); */
  
  #include <stdarg.h>
  #include <syslog.h>
====================== snip =======================

My guess is that the original "gethostname()" declaration had been to
suppress a warning (not error) message from a compiler on one particular
OS (would I be wrong in guessing Linux?) as a supposed cure. 

But for systems which have the expected declaration in the expected place,
which might be of a slightly different form, this "cure" is worse than
the illness and causes compiler errors.

So my patch above simply, in effect, removes that declaration.  I leave it
to you to decide whether to do it "as is" (which at least leaves for
future generations an indication of why the declaration was poor) or
simply to delete the original lines.

Hope that helps.


-- 

:  David Lee                                I.T. Service          :
:  Systems Programmer                       Computer Centre       :
:                                           University of Durham  :
:  http://www.dur.ac.uk/t.d.lee/            South Road            :
:                                           Durham                :
:  Phone: +44 191 374 2882                  U.K.                  :





[Index of Archives]     [Fedora Users]     [Kernel]     [Red Hat Install]     [Linux for the blind]     [Gimp]

  Powered by Linux