Changeset 19275 for gsdl/trunk/common-src/src/getpw/getpw.cpp
- Timestamp:
- 2009-04-27T17:37:46+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/common-src/src/getpw/getpw.cpp
r18493 r19275 30 30 #include "gsdlconf.h" 31 31 32 // use the standard namespace33 #if !defined (GSDL_NAMESPACE_BROKEN)34 #if defined(GSDL_USE_OBJECTSPACE)35 using namespace ospace::std;36 #else37 using namespace std;38 #endif39 #endif40 41 32 42 33 // include crypt … … 66 57 #endif 67 58 59 // use the standard namespace 60 #if !defined (GSDL_NAMESPACE_BROKEN) 61 #if defined(GSDL_USE_OBJECTSPACE) 62 using namespace ospace::std; 63 #else 64 using namespace std; 65 #endif 66 #endif 67 68 68 69 #include <string.h> 69 #include <pwd.h> 70 //#include <pwd.h> 71 70 72 71 73 int main (int argc, char *argv[]) { 72 74 73 75 int password_ok = 0; 74 char c[1 0];76 char c[129]; 75 77 int i; 76 78 77 79 for (i=0; i<3; i++) { 80 #if defined(__WIN32__) 81 cout << "Enter password (will appear on screen): "; 82 char a[129]; 83 cin.getline(a, 128); 84 #else 78 85 char *a = getpass("Enter password:"); 86 #endif 87 79 88 int len = strlen (a); 80 89 if (len < 3 || len > 128) { … … 85 94 strcpy (c, a); 86 95 96 #if defined(__WIN32__) 97 cout << "Re-enter password: "; 98 char b[129]; 99 cin.getline(b, 128); 100 #else 87 101 char *b = getpass("Re-enter password:"); 102 #endif 88 103 89 104 if ((strcmp (c, b)) == 0) {
Note:
See TracChangeset
for help on using the changeset viewer.