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.

And another patch...

"modules/pam_unix/support.c" uses the constant "UT_NAMESIZE", which is not
present in "utmp.h" include files on various operating systems (e.g
Solaris 2.x)

How about this patch?

========================== snip ====================
*** modules/pam_unix/support.c.orig	Sat Nov 25 04:40:55 2000
--- modules/pam_unix/support.c	Wed Dec 13 12:27:37 2000
***************
*** 101,107 ****
  {
  	struct utmp *ut, line;
  	char *curr_tty, *retval;
! 	static char curr_user[UT_NAMESIZE + 4];
  
  	retval = NULL;
  
--- 101,107 ----
  {
  	struct utmp *ut, line;
  	char *curr_tty, *retval;
! 	static char curr_user[sizeof(ut->ut_user) + 4];
  
  	retval = NULL;
  
***************
*** 112,118 ****
  		setutent();
  		strncpy(line.ut_line, curr_tty, sizeof line.ut_line);
  		if ((ut = getutline(&line)) != NULL) {
! 			strncpy(curr_user, ut->ut_user, UT_NAMESIZE);
  			retval = curr_user;
  		}
  		endutent();
--- 112,118 ----
  		setutent();
  		strncpy(line.ut_line, curr_tty, sizeof line.ut_line);
  		if ((ut = getutline(&line)) != NULL) {
! 			strncpy(curr_user, ut->ut_user, sizeof(ut->ut_user));
  			retval = curr_user;
  		}
  		endutent();
========================== snip ====================

Also, my experience in managing the "utmp" work in Samba indicated that
"utmp" declarations and usage varies greatly from system to sytem.  I
suspect that other utmp-isms will turn up as Linux-PAM is ported and
tested.

Finally, please note that there is a very unpleasant word in the source a
few lines above this.  Is it necessary?  Please could it be removed?


-- 

:  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