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

List:       kde-core-devel
Subject:    Fwd: patch for kdepasswd in kde 3.0.2
From:       David Faure <david () mandrakesoft ! com>
Date:       2002-07-19 21:29:33
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nobody answered this one on kde-devel ... does anyone know that code?

- ----------  Forwarded Message  ----------

Subject: patch for kdepasswd in kde 3.0.2
Date: Wednesday 17 July 2002 10:16
From: Xander Soldaat <xander@soldaat.com>
To: kde-devel@mail.kde.org

Hi there,

I have a patch for kdepasswd 3.0.2 which fixes the kdepasswd <-> passwd 
conversation error which occur when the user enters a 'bad' password 
and when the new password is not really new but completely the same.
Do with it as you like. It uses some parts of the patches which I found 
on the mailing lists when scouring the web with google.
Some lines may be wrapped.

Gr,
Xander

- -- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
On holidays from 20/07 to 24/07
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9OIS+72KcVAmwbhARAlr9AJ9i++TdhdqKdXDdcUJk6iDs0lH7zwCgrg4O
6FONWn+RExgRtVWlq3r6LMo=
=z/i2
-----END PGP SIGNATURE-----

[" " (text/x-diff)]

diff -ru kdeutils-3.0.2.old/kdepasswd/passwd.cpp kdeutils-3.0.2/kdepasswd/passwd.cpp
--- kdeutils-3.0.2.old/kdepasswd/passwd.cpp	Thu Jan  3 21:34:56 2002
+++ kdeutils-3.0.2/kdepasswd/passwd.cpp	Tue Jul 16 13:06:22 2002
@@ -111,7 +111,7 @@
     QCString line, errline;
     int state = 0;
 
-    while (state != 7)
+    while (state != 8)
     {
 	line = readLine();
 	if (line.isNull()) 
@@ -217,7 +217,28 @@
 		fputs(line, stdout);
 	    m_Error += line;
 	    break;
-	}
+        case 7:
+            if (line.contains("Bad:"))
+                {
+                        kill(m_Pid, SIGKILL);
+                        waitForChild();
+                        m_Error = line;
+                        return PasswordNotGood;
+                }
+	    else if(line.contains("Password unchanged"))
+	    {
+                        kill(m_Pid, SIGKILL);
+                        waitForChild();
+                        m_Error = line;
+                        return PasswordNotGood;
+            }
+
+            if (m_bTerminal)
+                fputs(line, stdout);
+            m_Error += line;
+                state++;
+                break;
+  	}
     }
 
     kdDebug(1512) << k_lineinfo << "Conversation ended successfully.\n";


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

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