auth: Remove plaintext OSF1 password support
authorAndrew Bartlett <abartlet@samba.org>
Wed, 22 Jan 2014 02:40:19 +0000 (15:40 +1300)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 15 Apr 2014 08:13:12 +0000 (10:13 +0200)
The WAF build does not have the code to detect getprpwnam on which
this is based, and so this is dead code.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
ctdb/lib/replace/system/passwd.h
lib/replace/system/passwd.h
source3/auth/pass_check.c
source3/include/includes.h

index 8257e066ac020f853bec9c1a487eb1d9ff33358f..e5c16a0429b19a4257e18c3827cf0cb153088ad8 100644 (file)
@@ -77,9 +77,6 @@
 #define PASSWORD_LENGTH 8
 #endif
 
 #define PASSWORD_LENGTH 8
 #endif
 
-#if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS)
-#define OSF1_ENH_SEC 1
-#endif
 
 #ifndef ALLOW_CHANGE_PASSWORD
 #if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID))
 
 #ifndef ALLOW_CHANGE_PASSWORD
 #if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID))
index 8257e066ac020f853bec9c1a487eb1d9ff33358f..e5c16a0429b19a4257e18c3827cf0cb153088ad8 100644 (file)
@@ -77,9 +77,6 @@
 #define PASSWORD_LENGTH 8
 #endif
 
 #define PASSWORD_LENGTH 8
 #endif
 
-#if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS)
-#define OSF1_ENH_SEC 1
-#endif
 
 #ifndef ALLOW_CHANGE_PASSWORD
 #if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID))
 
 #ifndef ALLOW_CHANGE_PASSWORD
 #if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID))
index 66cf8b8873ab3ede83f6dbb8e6dc3d6eeabccab8..5f134feb3ba5a5e8abb048f17fa26895a13da992 100644 (file)
@@ -92,36 +92,6 @@ static int linux_bigcrypt(char *password, char *salt1, char *crypted)
 }
 #endif
 
 }
 #endif
 
-#ifdef OSF1_ENH_SEC
-/****************************************************************************
-an enhanced crypt for OSF1
-****************************************************************************/
-static char *osf1_bigcrypt(char *password, char *salt1)
-{
-       static char result[AUTH_MAX_PASSWD_LENGTH] = "";
-       char *p1;
-       char *p2 = password;
-       char salt[3];
-       int i;
-       int parts = strlen(password) / AUTH_CLEARTEXT_SEG_CHARS;
-       if (strlen(password) % AUTH_CLEARTEXT_SEG_CHARS)
-               parts++;
-
-       StrnCpy(salt, salt1, 2);
-       StrnCpy(result, salt1, 2);
-       result[2] = '\0';
-
-       for (i = 0; i < parts; i++) {
-               p1 = crypt(p2, salt);
-               strncat(result, p1 + 2,
-                       AUTH_MAX_PASSWD_LENGTH - strlen(p1 + 2) - 1);
-               StrnCpy(salt, &result[2 + i * AUTH_CIPHERTEXT_SEG_CHARS], 2);
-               p2 += AUTH_CLEARTEXT_SEG_CHARS;
-       }
-
-       return (result);
-}
-#endif
 
 
 /****************************************************************************
 
 
 /****************************************************************************
@@ -138,22 +108,6 @@ static NTSTATUS password_check(const char *user, const char *password, const voi
 
 
 
 
 
 
-#ifdef OSF1_ENH_SEC
-
-       ret = (strcmp(osf1_bigcrypt(password, get_this_salt()),
-                     get_this_crypted()) == 0);
-       if (!ret) {
-               DEBUG(2,
-                     ("OSF1_ENH_SEC failed. Trying normal crypt.\n"));
-               ret = (strcmp((char *)crypt(password, get_this_salt()), get_this_crypted()) == 0);
-       }
-       if (ret) {
-               return NT_STATUS_OK;
-       } else {
-               return NT_STATUS_WRONG_PASSWORD;
-       }
-
-#endif /* OSF1_ENH_SEC */
 
 #ifdef ULTRIX_AUTH
        ret = (strcmp((char *)crypt16(password, get_this_salt()), get_this_crypted()) == 0);
 
 #ifdef ULTRIX_AUTH
        ret = (strcmp((char *)crypt16(password, get_this_salt()), get_this_crypted()) == 0);
@@ -330,24 +284,6 @@ NTSTATUS pass_check(const struct passwd *pass,
        }
 #endif
 
        }
 #endif
 
-#ifdef OSF1_ENH_SEC
-       {
-               struct pr_passwd *mypasswd;
-               DEBUG(5, ("Checking password for user %s in OSF1_ENH_SEC\n",
-                         user));
-               mypasswd = getprpwnam(user);
-               if (mypasswd) {
-                       user = mypasswd->ufld.fd_name;
-                       if (set_this_crypted(mypasswd->ufld.fd_encrypt) == NULL) {
-                               return NT_STATUS_NO_MEMORY;
-                       }
-               } else {
-                       DEBUG(5,
-                             ("OSF1_ENH_SEC: No entry for user %s in protected database !\n",
-                              user));
-               }
-       }
-#endif
 
 #ifdef ULTRIX_AUTH
        {
 
 #ifdef ULTRIX_AUTH
        {
index d18496ac6eb9beba7d99eb9ae35d049896e87387..de44fd2d99afbfe49ee5ae18bc6563795584db2d 100644 (file)
@@ -419,9 +419,6 @@ typedef char fstring[FSTRING_LEN];
 #define SIGRTMIN NSIG
 #endif
 
 #define SIGRTMIN NSIG
 #endif
 
-#if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS)
-#define OSF1_ENH_SEC 1
-#endif
 
 #if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID)
 #define ULTRIX_AUTH 1
 
 #if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID)
 #define ULTRIX_AUTH 1