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

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

 



David,

I'm going to take some of these and get them committed to the tree.  It would
be helpful if you could submit bugs for each of these on sourceforge, since
Andrew won't let anything into the tree that doesn't have a bug ID associated
with it. ;)  I've gone ahead and submitted a bug for this one, and will commit
the fix as well.

However,

> 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?

Honestly, I'm not sure why the function is necessary at all.  The author
(baggins?) suggests in the comments that this is needed because of some
brokenness in the system getlogin function, but doesn't say what is broken.
I'm sure it's more portable to include our own function here than to not do
so, but now that we have autoconf support it would be nice to have a test for
the function and use the system version if it works correctly.  It would be
nice to sidestep some of the utmp complexities this way.

Steve Langasek
postmodern programmer


> 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 ====================





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

  Powered by Linux