From bafebe0b8a1f3d99f595959b745f1db14940bffa Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Sat, 19 Mar 2005 22:52:33 +0000 Subject: [PATCH] Fix crash when /oper operator badpass. Fix comment explaining the crypted passwords. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1327 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 8 ++++++++ doc/example.conf | 8 +++++--- ircd/m_oper.c | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96ecbbb..c404bdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-03-19 Michael Poole + + * doc/example.conf (Operator): Correct the comment explaining + hashed passwords. + + * ircd/m_oper.c (oper_password_match): Check correct variable to + determine whether the hashed password matched. + 2005-03-08 Michael Poole * ircd/match.c (ipmask_parse): Explicitly zero-initialize the mask diff --git a/doc/example.conf b/doc/example.conf index 8538096..92eedc7 100644 --- a/doc/example.conf +++ b/doc/example.conf @@ -609,9 +609,11 @@ CRULE # # and the default setting. # }; # -# The encrypted password is optional. If you wish to encrypt your -# password, there is a utility in the ircd. Please read the file -# tools/README. +# By default, the password is hashed using the system's native crypt() +# function. Other password mechanisms are available; the umkpasswd +# utility from the ircd directory can hash passwords using those +# mechanisms. +# # All privileges are shown with their default values; if you wish to # override defaults, you should set only those privileges for the # operator. Listing defaulted privileges just makes things harder to diff --git a/ircd/m_oper.c b/ircd/m_oper.c index 3e561eb..c820fe9 100644 --- a/ircd/m_oper.c +++ b/ircd/m_oper.c @@ -121,7 +121,7 @@ int oper_password_match(const char* to_match, const char* passwd) crypt_clear if it's enabled -- hikari */ crypted = ircd_crypt(to_match, passwd); - if (to_match == NULL) + if (!crypted) return 0; res = strcmp(crypted, passwd); MyFree(crypted); -- 2.20.1