X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=util%2Fpasswddb.c;h=79cd6597c58a248ddcb3dd51e33635947d8e6b40;hp=61624f609459e532a152809e876438c6493c6ed9;hb=e4c6861efeeea654bfb00c5f0239ee258629d77f;hpb=89d16cf15eda0e4802d18b8ad09bd3653508ebfc diff --git a/util/passwddb.c b/util/passwddb.c index 61624f6..79cd659 100644 --- a/util/passwddb.c +++ b/util/passwddb.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1994-2009 Index Data + Copyright (C) 2004-2013 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -18,6 +18,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #if HAVE_UNISTD_H #include #endif @@ -54,7 +57,7 @@ Passwd_db passwd_db_open (void) } static int get_entry (const char **p, char *dst, int max) -{ +{ int i = 0; while ((*p)[i] != ':' && (*p)[i]) i++; @@ -106,7 +109,7 @@ void passwd_db_close(Passwd_db db) while (pe) { struct passwd_entry *pe_next = pe->next; - + xfree (pe->name); xfree (pe->des); xfree (pe); @@ -163,7 +166,7 @@ int passwd_db_auth(Passwd_db db, const char *user, const char *pass) if (strcmp (pe->des, pass)) return -2; } - return 0; + return 0; } int passwd_db_file_crypt(Passwd_db db, const char *fname) @@ -183,6 +186,7 @@ int passwd_db_file_plain(Passwd_db db, const char *fname) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab