diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-12-08 15:37:39 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2005-12-08 15:37:39 +0100 |
commit | 7989fcf34257201f54538f289cce1c651341e142 (patch) | |
tree | 852c57b842878efdbf311f7e2bb713745963141f /storage_text.c | |
parent | a1f17d45fae99428c8024168b55b4279c59ac867 (diff) |
Add check_pass function
Diffstat (limited to 'storage_text.c')
-rw-r--r-- | storage_text.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/storage_text.c b/storage_text.c index a244aed5..49a44fbe 100644 --- a/storage_text.c +++ b/storage_text.c @@ -263,7 +263,7 @@ static storage_status_t text_save( irc_t *irc, int overwrite ) return STORAGE_OK; } -static storage_status_t text_remove( const char *nick, const char *password ) +static storage_status_t text_check_pass( const char *nick, const char *password ) { char s[512]; FILE *fp; @@ -278,6 +278,18 @@ static storage_status_t text_remove( const char *nick, const char *password ) /*FIXME Test if password is correct */ + return STORAGE_OK; +} + +static storage_status_t text_remove( const char *nick, const char *password ) +{ + char s[512]; + storage_status_t status; + + status = text_check_pass( nick, password ); + if (status != STORAGE_OK) + return status; + g_snprintf( s, 511, "%s%s%s", global.conf->configdir, nick, ".accounts" ); if (unlink( s ) == -1) return STORAGE_OTHER_ERROR; @@ -292,6 +304,7 @@ static storage_status_t text_remove( const char *nick, const char *password ) storage_t storage_text = { .name = "text", .init = text_init, + .check_pass = text_check_pass, .remove = text_remove, .load = text_load, .save = text_save |