Changeset 7cad7b4
- Timestamp:
- 2005-12-08T16:00:08Z (19 years ago)
- Branches:
- master
- Children:
- 87c24ba
- Parents:
- 09adf08
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
r09adf08 r7cad7b4 114 114 } 115 115 116 setpassnc( irc, cmd[1] );116 irc_setpass( irc, cmd[1] ); 117 117 switch( global.storage->save( irc, FALSE )) { 118 118 case STORAGE_ALREADY_EXISTS: … … 145 145 return( 0 ); 146 146 case STORAGE_OK: 147 setpassnc( irc, NULL );147 irc_setpass( irc, NULL ); 148 148 irc_usermsg( irc, "Account `%s' removed", irc->nick ); 149 149 return( 0 ); -
crypting.c
r09adf08 r7cad7b4 52 52 #include <stdlib.h> 53 53 54 #define irc_usermsg55 56 54 #endif 57 55 … … 62 60 \*/ 63 61 64 /* USE WITH CAUTION! 65 Sets pass without checking */ 66 void setpassnc (irc_t *irc, const char *pass) 67 { 68 if (irc->password) g_free (irc->password); 69 70 if (pass) { 71 irc->password = g_strdup (pass); 72 irc_usermsg (irc, "Password successfully changed"); 73 } else { 74 irc->password = NULL; 75 } 76 } 77 78 int setpass (irc_t *irc, const char *pass, const char* md5sum) 62 int checkpass (const char *pass, const char *md5sum) 79 63 { 80 64 md5_state_t md5state; … … 94 78 if (digits[1] != md5sum[j + 1]) return (-1); 95 79 } 96 97 /* If pass is correct, we end up here and we set the pass */ 98 setpassnc (irc, pass); 99 100 return (0); 101 } 80 81 return( 0 ); 82 } 83 102 84 103 85 char *hashpass (irc_t *irc) { -
crypting.h
r09adf08 r7cad7b4 24 24 */ 25 25 26 void setpassnc (irc_t *irc, const char *pass); /* USE WITH CAUTION! */ 27 int setpass (irc_t *irc, const char *pass, const char* md5sum); 26 int checkpass (const char *password, const char *md5sum); 28 27 char *hashpass (irc_t *irc); 29 28 char *obfucrypt (irc_t *irc, char *line); -
irc.c
r09adf08 r7cad7b4 32 32 GSList *irc_connection_list = NULL; 33 33 34 char *passchange (irc_t *irc, void *set, char *value)35 { 36 setpassnc(irc, value);34 static char *passchange (irc_t *irc, void *set, char *value) 35 { 36 irc_setpass (irc, value); 37 37 return (NULL); 38 38 } … … 266 266 if( global.conf->runmode == RUNMODE_INETD ) 267 267 g_main_quit( global.loop ); 268 } 269 270 /* USE WITH CAUTION! 271 Sets pass without checking */ 272 void irc_setpass (irc_t *irc, const char *pass) 273 { 274 if (irc->password) g_free (irc->password); 275 276 if (pass) { 277 irc->password = g_strdup (pass); 278 irc_usermsg (irc, "Password successfully changed"); 279 } else { 280 irc->password = NULL; 281 } 268 282 } 269 283 -
irc.h
r09adf08 r7cad7b4 137 137 void irc_whois( irc_t *irc, char *nick ); 138 138 int irc_away( irc_t *irc, char *away ); 139 void irc_setpass( irc_t *irc, const char *pass ); /* USE WITH CAUTION! */ 139 140 140 141 int irc_send( irc_t *irc, char *nick, char *s, int flags ); -
storage_text.c
r09adf08 r7cad7b4 53 53 54 54 fscanf( fp, "%32[^\n]s", s ); 55 if( setpass( irc, password, s ) < 0 ) 55 56 if (checkpass (password, s) != 0) 56 57 { 57 58 fclose( fp ); … … 277 278 fclose( fp ); 278 279 279 /*FIXME: Check password */ 280 if (checkpass( password, s) == -1) 281 return STORAGE_INVALID_PASSWORD; 280 282 281 283 return STORAGE_OK;
Note: See TracChangeset
for help on using the changeset viewer.