dtdocbook: Coverity 86763
[oweals/cde.git] / cde / programs / dtlogin / sysauth.c
index 0e60d5046fc2e598562e9cf78a40912ed4cd4174..34a987b28b4a47b96741f484352da1aa09942b39 100644 (file)
@@ -64,7 +64,6 @@
  **     Platform identification:
  **
  **    __hpux      HP-UX OS only
- **    __apollo    Domain OS only
  **     sun         SUN OS only
  **     SVR4        SUN OS et al.
  **     _AIX        AIX only
 /*
  * Define as generic those without platform specific code.
  */
-#if !(defined(__hpux) || defined(__apollo) || defined(_AIX) || defined(sun))
+#if !(defined(__hpux) || defined(_AIX) || defined(sun))
 #define generic
 #endif
 
@@ -218,7 +217,7 @@ static void Audit( struct passwd *p, char *msg, int errnum) ;
 static int     CheckPassword( char *name, char *passwd, struct passwd **ppwd );
 static int     CountUsers( int added_users) ;
 static int     CountUsersStrict( char *new_user) ;
-static int     PasswordAged( register struct passwd *pw) ;
+static int     PasswordAged( struct passwd *pw) ;
 static void    WriteBtmp( char *name) ;
 
 
@@ -489,7 +488,7 @@ CountUsersStrict( char *new_user )
 #define SECONDS_IN_WEEK                604800L
 
 static int 
-PasswordAged( register struct passwd *pw )
+PasswordAged( struct passwd *pw )
 {
     long change_week;  /* week password was changed (1/1/70 = Week 0) */
     long last_week;    /* week after which password must change */
@@ -704,7 +703,7 @@ CheckPassword( char *name, char     *passwd, struct passwd **ppwd )
 
 #ifdef __PASSWD_ETC
     /*
-     *   If regular passwd check fails, try old-style Apollo SR
+     *   If regular passwd check fails, try old-style SR
      */
 
     if (rgy_$is_des(passwd, strlen(passwd), p->pw_passwd) == TRUE)
@@ -1358,7 +1357,7 @@ Authenticate( struct display *d, char *name, char *passwd, char **msg )
  ***************************************************************************/
 
 static void Audit( struct passwd *p, char *msg, int errnum) ;
-static int  PasswordAged(char *name, register struct passwd *pw) ;
+static int  PasswordAged(char *name, struct passwd *pw) ;
 static void WriteBtmp( char *name) ;
 
 
@@ -1437,7 +1436,7 @@ WriteBtmp( char *name )
 #define SECONDS_IN_WEEK                604800L
 
 static int 
-PasswordAged(char *name, register struct passwd *pw )
+PasswordAged(char *name, struct passwd *pw )
 {
   struct userpw *pupw; /* authentication information from getuserpw() */
   struct userpw  upw;  /* working authentication information */
@@ -1833,7 +1832,7 @@ tsm_check_login(uid_t uid)
  ***************************************************************************/
 
 static void Audit( struct passwd *p, char *msg, int errnum) ;
-static int  PasswordAged( register struct passwd *pw) ;
+static int  PasswordAged( struct passwd *pw) ;
 static void WriteBtmp( char *name) ;
 
 
@@ -1897,7 +1896,7 @@ WriteBtmp( char *name )
 #define SECONDS_IN_WEEK                604800L
 
 static int 
-PasswordAged( register struct passwd *pw )
+PasswordAged( struct passwd *pw )
 {
   return(FALSE);
 }
@@ -1956,6 +1955,13 @@ Authenticate( struct display *d, char *name, char *passwd, char **msg )
     }
 #endif
 
+#if defined(__OpenBSD__) && OSMAJORVERSION > 5
+    /*
+     * Use the OpenBSD getpwnam_shadow function to get the crypt()ed password
+     */
+     p = getpwnam_shadow(name);
+#endif
+
     if (!p || strlen(name) == 0 ||
         strcmp (crypt (passwd, p->pw_passwd), p->pw_passwd)) {