[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Please have a look at this patch for 1.1.2
From:       Steffen Hansen <stefh () mip ! sdu ! dk>
Date:       1999-06-29 17:25:19
[Download RAW message or body]

Hi.

Since kdebase is frozen for 1.1.2, i need some extra eyes to double check
some bugfixes for kdm. My patch fixes 3 things:

1) The "session type" wasn't updated when the user left the login line
edit with Tab (Pressing return worked fine). This is fixed now.

2) Kdm accepts NOBROADCAST in the Xaccess file now.

3) PAM modules now have the ability to set environment variables for the
user. Without this patch, changes to the env. are lost.

The patch changes 6 files: acconfig.h, kdminclude.m4, kdm/access.c,
kdm/session.c, kdm/kgreeter.h and kdm/kgreeter.cpp. Please check it out 
and drop me a mail so that i can commit ASAP.

Thanks.
-- 
Steffen Hansen                            
email: stefh@mip.sdu.dk, stefh@imada.sdu.dk, hansen@kde.org 
URL:   http://www.mip.sdu.dk/~stefh       

["kdm-bugfixes.diff" (TEXT/PLAIN)]

Index: acconfig.h
===================================================================
RCS file: /home/kde/kdebase/Attic/acconfig.h,v
retrieving revision 1.29.4.5
diff -c -r1.29.4.5 acconfig.h
*** acconfig.h	1999/04/01 22:02:01	1.29.4.5
--- acconfig.h	1999/06/29 16:26:11
***************
*** 50,55 ****
--- 50,58 ----
  /* define if you have the PAM lib. Now, we have two different users, this will change */
  #undef HAVE_PAM_LIB
  
+ /* define if you have a PAM implementation with the pam_misc library */
+ #undef HAVE_PAM_MISC
+ 
  /* define if you have shadow library */
  #undef HAVE_SHADOW_LIB
  
Index: kdminclude.m4
===================================================================
RCS file: /home/kde/kdebase/kdminclude.m4,v
retrieving revision 1.12.4.1
diff -c -r1.12.4.1 kdminclude.m4
*** kdminclude.m4	1999/03/02 16:40:00	1.12.4.1
--- kdminclude.m4	1999/06/29 16:26:11
***************
*** 94,99 ****
--- 94,101 ----
    AC_CHECK_LIB(pam, main, [PASSWDLIB="-lpam -ldl"
    AC_DEFINE_UNQUOTED(HAVE_PAM_LIB)],
    [],-ldl)
+   AC_CHECK_LIB(pam_misc, main, PASSWDLIB="-lpam_misc $PASSWDLIB"
+ 			       AC_DEFINE_UNQUOTED(HAVE_PAM_MISC))
  fi
  
  if test -z "$PASSWDLIB" && test "$shadow_support" = "yes"; then
Index: kdm/access.c
===================================================================
RCS file: /home/kde/kdebase/kdm/access.c,v
retrieving revision 1.3
diff -c -r1.3 access.c
*** access.c	1998/09/30 21:19:49	1.3
--- access.c	1999/06/29 16:26:19
***************
*** 55,66 ****
  #define NEGATE_CHARACTER    '!'
  #define CHOOSER_STRING	    "CHOOSER"
  #define BROADCAST_STRING    "BROADCAST"
  
  #define HOST_ALIAS	0
  #define HOST_ADDRESS	1
  #define HOST_BROADCAST	2
  #define HOST_CHOOSER	3
! 
  typedef struct _hostEntry {
      struct _hostEntry	*next;
      int	    type;
--- 55,68 ----
  #define NEGATE_CHARACTER    '!'
  #define CHOOSER_STRING	    "CHOOSER"
  #define BROADCAST_STRING    "BROADCAST"
+ #define NOBROADCAST_STRING  "NOBROADCAST"
  
  #define HOST_ALIAS	0
  #define HOST_ADDRESS	1
  #define HOST_BROADCAST	2
  #define HOST_CHOOSER	3
! #define HOST_NOBROADCAST    4
!  
  typedef struct _hostEntry {
      struct _hostEntry	*next;
      int	    type;
***************
*** 78,83 ****
--- 80,86 ----
      struct _displayEntry    *next;
      int			    type;
      int			    notAllowed;
+     int			    notBroadcast;
      int			    chooser;
      union _displayType {
  	char		    *aliasName;
***************
*** 259,264 ****
--- 262,271 ----
      {
  	h->type = HOST_BROADCAST;
      }
+     else if (!strcmp (hostOrAlias, NOBROADCAST_STRING))
+     {
+ 	h->type = HOST_NOBROADCAST;
+     }
      else
      {
  	h->type = HOST_ADDRESS;
***************
*** 310,315 ****
--- 317,323 ----
      	return NULL;
      d = (DisplayEntry *) malloc (sizeof (DisplayEntry));
      d->notAllowed = 0;
+     d->notBroadcast = 0;
      d->chooser = 0;
      if (*displayOrAlias == ALIAS_CHARACTER)
      {
***************
*** 386,391 ****
--- 394,402 ----
  	{
  	    FreeHostEntry (h);
  	    d->chooser = 1;
+ 	} else if (h->type == HOST_NOBROADCAST) {
+ 	    FreeHostEntry (h);
+ 	    d->notBroadcast = 1;
  	} else {
  	    *prev = h;
  	    prev = &h->next;
***************
*** 744,750 ****
      }
      if (clientName)
  	free (clientName);
!     return (d != 0) && (d->notAllowed == 0);
  }
  
  #endif /* XDMCP */
--- 755,762 ----
      }
      if (clientName)
  	free (clientName);
!     return (d != 0) && (d->notAllowed == 0)
! 	&& (type == BROADCAST_QUERY ? d->notBroadcast == 0 : 1);
  }
  
  #endif /* XDMCP */
Index: kdm/session.c
===================================================================
RCS file: /home/kde/kdebase/kdm/session.c,v
retrieving revision 1.13.4.1
diff -c -r1.13.4.1 session.c
*** session.c	1999/06/14 08:49:11	1.13.4.1
--- session.c	1999/06/29 16:26:21
***************
*** 698,703 ****
--- 698,716 ----
  	CleanUpChild ();
  
  	/* Do system-dependent login setup here */
+ #ifdef HAVE_PAM_MISC
+     /* if we have a pam_misc library on this system, pass in environment
+     variables set by libpam and modules it called */
+     if(pamh != NULL)
+     {
+         long i;
+         char **pam_env = pam_misc_copy_env(pamh);
+         for(i = 0; pam_env && pam_env[i]; i++)
+         {
+             verify->userEnviron = putEnv(pam_env[i], verify->userEnviron);
+         }
+     }
+ #endif /* HAVE_PAM_MISC */
  
  #ifdef HAVE_SETUSERCONTEXT
          /*
Index: kdm/kgreeter.h
===================================================================
RCS file: /home/kde/kdebase/kdm/kgreeter.h,v
retrieving revision 1.12
diff -c -r1.12 kgreeter.h
*** kgreeter.h	1998/10/24 20:17:32	1.12
--- kgreeter.h	1999/06/29 16:26:22
***************
*** 59,65 ****
  #include "kdmshutdown.h"
  #include "kdmconfig.h"
  
! //class KGreeter : public QDialog {
  class KGreeter : public QWidget {
       Q_OBJECT
  public:
--- 59,74 ----
  #include "kdmshutdown.h"
  #include "kdmconfig.h"
  
! class KLoginLineEdit : public QLineEdit {
!      Q_OBJECT
! public:
!      KLoginLineEdit( QWidget *parent = 0) : QLineEdit(parent) {}
! signals:
!      void lost_focus();
! protected:
!      void focusOutEvent( QFocusEvent *e);
! };
! 
  class KGreeter : public QWidget {
       Q_OBJECT
  public:
***************
*** 89,95 ****
       QLabel*        loginLabel;
       QLabel*        passwdLabel;
       QLabel*        failedLabel;
!      QLineEdit*     loginEdit;
       QLineEdit*     passwdEdit; 
       QFrame*        separator;
       QPushButton*   goButton;
--- 98,104 ----
       QLabel*        loginLabel;
       QLabel*        passwdLabel;
       QLabel*        failedLabel;
!      KLoginLineEdit*     loginEdit;
       QLineEdit*     passwdEdit; 
       QFrame*        separator;
       QPushButton*   goButton;
Index: kdm/kgreeter.cpp
===================================================================
RCS file: /home/kde/kdebase/kdm/kgreeter.cpp,v
retrieving revision 1.56.4.3
diff -c -r1.56.4.3 kgreeter.cpp
*** kgreeter.cpp	1999/04/07 00:34:49	1.56.4.3
--- kgreeter.cpp	1999/06/29 16:26:22
***************
*** 90,125 ****
  struct verify_info      *verify;
  struct greet_info       *greet;
  
! // Here we store a number for the seed:
! //static int event_sum;
  
! class MyApp:public KApplication {
  public:
       MyApp( int &argc, char **argv );
       virtual ~MyApp();
       virtual bool x11EventFilter( XEvent * );
- 
-      /* Calculate a "sum" of the recorded events
-       * The "sum" is caclulated in a somewhat ad hoc
-       * way by starting with the value of a pointer
-       * and shifting and xor'ing events to it. See
-       * the implementation.
-       * 
-       * If someone has a more "proven" way to do this,
-       * please contact me /stefh
-       *
-       * NOTE: This is disabled now. We read /dev/mem instead!
-       * /stefh
-       */
-      //static int getSum() { return event_sum;}
- private:
-      // Add one timestamp
-      //void addEvent( int);
-      //static int event_sum;
  };
  
- //int MyApp::event_sum = 42;
- 
  MyApp::MyApp(int &argc, char **argv ) : KApplication(argc, argv)
  {}
  
--- 90,109 ----
  struct verify_info      *verify;
  struct greet_info       *greet;
  
! void 
! KLoginLineEdit::focusOutEvent( QFocusEvent *e) 
! {
!      emit lost_focus();
!      QLineEdit::focusOutEvent( e);
! }
  
! class MyApp : public KApplication {
  public:
       MyApp( int &argc, char **argv );
       virtual ~MyApp();
       virtual bool x11EventFilter( XEvent * );
  };
  
  MyApp::MyApp(int &argc, char **argv ) : KApplication(argc, argv)
  {}
  
***************
*** 128,139 ****
  
  bool 
  MyApp::x11EventFilter( XEvent * ev){
- #if 0 
-     if( ev->type == KeyPress ||
- 	 ev->type == KeyRelease ) addEvent( ((XKeyEvent*)ev)->time);
-      if( ev->type == ButtonPress ||
- 	 ev->type == ButtonRelease ) addEvent( ((XButtonEvent*)ev)->time);
- #endif
       if( ev->type == KeyPress && kgreeter){
  	  // This should go away
  	  KeySym ks = XLookupKeysym(&(ev->xkey),0);
--- 112,117 ----
***************
*** 152,171 ****
       return FALSE;
  }
  
- #if 0
- void
- MyApp::addEvent( int t)
- {
-      event_sum = (event_sum << 3) ^ t;
-      printf("addEvent( %d): event_sum = %d\n", t, event_sum);
- }
- 
- // GenerateAuthData calls this to get the seed:
- extern "C" {
-      int greeter_event_sum() { printf("%d\n",MyApp::getSum());return MyApp::getSum();}
- }
- #endif
- 
  // Misc. functions
  static inline int my_seteuid( uid_t euid)
  {
--- 130,135 ----
***************
*** 233,239 ****
  
       loginLabel = new QLabel( klocale->translate("Login:"), this);
       set_min( loginLabel);
!      loginEdit = new QLineEdit( this);
  
       // The line-edit look _very_ bad if you don't give them 
       // a resonal height that observes a proportional aspect.
--- 197,203 ----
  
       loginLabel = new QLabel( klocale->translate("Login:"), this);
       set_min( loginLabel);
!      loginEdit = new KLoginLineEdit( this);
  
       // The line-edit look _very_ bad if you don't give them 
       // a resonal height that observes a proportional aspect.
***************
*** 366,371 ****
--- 330,337 ----
       // Signals/Slots
       connect( timer, SIGNAL(timeout()),
             this , SLOT(timerDone()) );
+      connect( loginEdit, SIGNAL(lost_focus()),
+ 	      this, SLOT( load_wm()));
       if( user_view)
  	  connect( user_view, SIGNAL(selected(int)), 
  		   this, SLOT(slot_user_name( int)));


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic