diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2012-08-19 15:07:48 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2012-08-19 15:07:48 +0100 | 
| commit | 6ee51a914b26fec1f7036af758be514bbfed9778 (patch) | |
| tree | 9f2d76fc31d696490f01ded26a8f9e85bca2dfdc | |
| parent | d3bfe3d0e6a0d0c655556bba838f2dcbf878d20f (diff) | |
Allow "set -del password". #984
| -rw-r--r-- | protocols/account.c | 20 | 
1 files changed, 8 insertions, 12 deletions
| diff --git a/protocols/account.c b/protocols/account.c index 12831531..0eb16b59 100644 --- a/protocols/account.c +++ b/protocols/account.c @@ -153,18 +153,14 @@ char *set_eval_account( set_t *set, char *value )  	}  	else if( strcmp( set->key, "password" ) == 0 )  	{ -		if( value ) -		{ -			g_free( acc->pass ); -			acc->pass = g_strdup( value ); -			return NULL;	/* password shouldn't be visible in plaintext! */ -		} -		else -		{ -			/* NULL can (should) be stored in the set_t -			   variable, but is otherwise not correct. */ -			return SET_INVALID; -		} +		/* set -del should be allowed now, but I don't want to have any +		   NULL pointers to have to deal with. */ +		if( !value ) +			value = ""; +		 +		g_free( acc->pass ); +		acc->pass = g_strdup( value ); +		return NULL;	/* password shouldn't be visible in plaintext! */  	}  	else if( strcmp( set->key, "tag" ) == 0 )  	{ | 
