[Fedora-directory-commits] winsync/passwordsync passhand.cpp, 1.10, 1.11 passhand.h, 1.8, 1.9

Richard Allen Megginson rmeggins at fedoraproject.org
Fri Feb 13 23:39:46 UTC 2009


Author: rmeggins

Update of /cvs/dirsec/winsync/passwordsync
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8461/passwordsync

Modified Files:
	passhand.cpp passhand.h 
Log Message:
Resolves: bug 471408
Description: PassSync logs a bogus error message
Reviewed by: nkinder
Fix Description: Just see if the file does not yet exist.  If that is the case
(err == ENOENT), then return a non-fatal error.  I also fixed a usage of list
iterator - apparently it is not a pointer type, and should be passed by
reference rather than by value.  Without this fix, I could not compile using
Visual C++ 9.0 Express Edition
Platforms tested: Windows 2003 Server
Flag Day: no
Doc impact: no



Index: passhand.cpp
===================================================================
RCS file: /cvs/dirsec/winsync/passwordsync/passhand.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- passhand.cpp	30 Mar 2006 22:59:25 -0000	1.10
+++ passhand.cpp	13 Feb 2009 23:39:43 -0000	1.11
@@ -133,9 +133,16 @@
 	int cipherTextLen = 0;
 	int resultTextLen = 0;
 	int pairCount = 0;
+	errno_t err = 0;
 
 	// Read in cipher text from file
 	inFile.open(filename, ios::in | ios::binary);
+	_get_errno(&err);
+	if (err == ENOENT) { // file does not exist - ok
+		result = 1;
+		goto exit;
+	}
+
 	if(!inFile.is_open())
 	{
 		result = -1;


Index: passhand.h
===================================================================
RCS file: /cvs/dirsec/winsync/passwordsync/passhand.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- passhand.h	30 Mar 2006 22:59:25 -0000	1.8
+++ passhand.h	13 Feb 2009 23:39:43 -0000	1.9
@@ -42,6 +42,8 @@
 
 #include <windows.h>
 #include <time.h>
+#include <errno.h>
+#include <stdlib.h>
 #include <strstream>
 #include <fstream>
 #include <list>




More information about the Fedora-directory-commits mailing list