diff options
| author | Jelmer Vernooij <jelmer@samba.org> | 2005-12-14 00:07:05 +0100 | 
|---|---|---|
| committer | Jelmer Vernooij <jelmer@samba.org> | 2005-12-14 00:07:05 +0100 | 
| commit | d3307e281afdbed22a561eb2cd73f97a03e3073d (patch) | |
| tree | b5e10b15e55ec9453bf902431a3b9dc24310378c /storage_text.c | |
| parent | 34759e68501ccf2a885f650df9d35ba3fc84658d (diff) | |
| parent | b73ac9c35fb53203b8d0668251dfb66096883863 (diff) | |
Merge my storage fixes
Diffstat (limited to 'storage_text.c')
| -rw-r--r-- | storage_text.c | 15 | 
1 files changed, 8 insertions, 7 deletions
| diff --git a/storage_text.c b/storage_text.c index f3ca8a38..5909ff63 100644 --- a/storage_text.c +++ b/storage_text.c @@ -66,7 +66,8 @@ static storage_status_t text_load ( const char *my_nick, const char* password, i  	while( fscanf( fp, "%511[^\n]s", s ) > 0 )  	{  		fgetc( fp ); -		line = deobfucrypt( irc, s ); +		line = deobfucrypt( s, password ); +		if (line == NULL) return STORAGE_OTHER_ERROR;  		root_command_string( irc, ru, line, 0 );  		g_free( line );  	} @@ -128,11 +129,11 @@ static storage_status_t text_save( irc_t *irc, int overwrite )  	 *  me. I just thought it was funny.  	\*/ -	hash = hashpass( irc ); +	hash = hashpass( irc->password );  	if( hash == NULL )  	{  		irc_usermsg( irc, "Please register yourself if you want to save your settings." ); -		return( 0 ); +		return STORAGE_OTHER_ERROR;  	}  	g_snprintf( path, 511, "%s%s%s", global.conf->configdir, irc->nick, ".nicks~" ); @@ -191,7 +192,7 @@ static storage_status_t text_save( irc_t *irc, int overwrite )  			g_snprintf( s, sizeof( s ), "account add %s \"%s\" \"%s\" \"%s\"",  			            proto_name[a->protocol], a->user, a->pass, a->server ? a->server : "" ); -		line = obfucrypt( irc, s ); +		line = obfucrypt( s, irc->password );  		if( *line )  		{  			if( fprintf( fp, "%s\n", line ) != strlen( line ) + 1 ) @@ -209,7 +210,7 @@ static storage_status_t text_save( irc_t *irc, int overwrite )  		if( set->value && set->def )  		{  			g_snprintf( s, sizeof( s ), "set %s \"%s\"", set->key, set->value ); -			line = obfucrypt( irc, s ); +			line = obfucrypt( s, irc->password );  			if( *line )  			{  				if( fprintf( fp, "%s\n", line ) != strlen( line ) + 1 ) @@ -226,7 +227,7 @@ static storage_status_t text_save( irc_t *irc, int overwrite )  	if( strcmp( irc->mynick, ROOT_NICK ) != 0 )  	{  		g_snprintf( s, sizeof( s ), "rename %s %s", ROOT_NICK, irc->mynick ); -		line = obfucrypt( irc, s ); +		line = obfucrypt( s, irc->password );  		if( *line )  		{  			if( fprintf( fp, "%s\n", line ) != strlen( line ) + 1 ) @@ -269,7 +270,7 @@ static storage_status_t text_check_pass( const char *nick, const char *password  	char s[512];  	FILE *fp; -	g_snprintf( s, 511, "%s%s%s", global.conf->configdir, nick, ".nicks" ); +	g_snprintf( s, 511, "%s%s%s", global.conf->configdir, nick, ".accounts" );  	fp = fopen( s, "r" );  	if (!fp)  		return STORAGE_NO_SUCH_USER; | 
