From: Art Cancro Date: Mon, 30 Oct 2017 20:58:26 +0000 (-0400) Subject: Remove unused parameter X-Git-Tag: v939~509 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=39e0649930fc89da0b0b56a0ca80ef021b3154a6 Remove unused parameter --- diff --git a/citadel/context.c b/citadel/context.c index f95a7a2f7..385f9a779 100644 --- a/citadel/context.c +++ b/citadel/context.c @@ -587,10 +587,10 @@ void CtdlFillSystemContext(CitContext *context, char *name) context->state = CON_SYS; context->ServiceName = name; - /* internal_create_user has the side effect of loading the user regardless of wether they + /* internal_create_user has the side effect of loading the user regardless of whether they * already existed or needed to be created */ - internal_create_user (sysname, len, &(context->user), -1) ; + internal_create_user(sysname, &(context->user), -1) ; /* Check to see if the system user needs upgrading */ if (context->user.usernum == 0) diff --git a/citadel/modules/ctdlproto/serv_user.c b/citadel/modules/ctdlproto/serv_user.c index 82a18fd14..7b7725a6e 100644 --- a/citadel/modules/ctdlproto/serv_user.c +++ b/citadel/modules/ctdlproto/serv_user.c @@ -93,7 +93,6 @@ void cmd_pass(char *buf) void cmd_newu(char *cmdbuf) { int a; - long len; char username[SIZ]; if (CtdlGetConfigInt("c_auth_mode") != AUTHMODE_NATIVE) { @@ -120,7 +119,6 @@ void cmd_newu(char *cmdbuf) } extract_token(username, cmdbuf, 0, '|', sizeof username); strproc(username); - len = cutuserkey(username); if (IsEmptyStr(username)) { cprintf("%d You must supply a user name.\n", ERROR + USERNAME_REQUIRED); @@ -134,7 +132,7 @@ void cmd_newu(char *cmdbuf) return; } - a = create_user(username, len, 1); + a = create_user(username, 1); if (a == 0) { logged_in_response(); @@ -194,7 +192,6 @@ void cmd_setp(char *new_pw) void cmd_creu(char *cmdbuf) { int a; - long len; char username[SIZ]; char password[SIZ]; struct ctdluser tmp; @@ -210,12 +207,10 @@ void cmd_creu(char *cmdbuf) cprintf("%d You must supply a user name.\n", ERROR + USERNAME_REQUIRED); return; } - len = cutuserkey(username); - extract_token(password, cmdbuf, 1, '|', sizeof password); - a = create_user(username, len, 0); + a = create_user(username, 0); if (a == 0) { if (!IsEmptyStr(password)) { diff --git a/citadel/modules/openid/serv_openid_rp.c b/citadel/modules/openid/serv_openid_rp.c index 8ed7712e5..69479190e 100644 --- a/citadel/modules/openid/serv_openid_rp.c +++ b/citadel/modules/openid/serv_openid_rp.c @@ -402,7 +402,7 @@ int openid_create_user_via_ax(StrBuf *claimed_id, HashList *sreg_keys) } /* The desired account name is available. Create the account and log it in! */ - if (create_user(nickname, len, 1)) return(6); + if (create_user(nickname, 1)) return(6); /* Generate a random password. * The user doesn't care what the password is since he is using OpenID. diff --git a/citadel/user_ops.c b/citadel/user_ops.c index 26aad2094..00b027283 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -488,7 +488,6 @@ int CtdlLoginExistingUser(char *authname, const char *trythisname) { char username[SIZ]; int found_user; - long len; syslog(LOG_DEBUG, "user_ops: CtdlLoginExistingUser(%s, %s)", authname, trythisname); @@ -517,7 +516,6 @@ int CtdlLoginExistingUser(char *authname, const char *trythisname) /* Continue attempting user validation... */ safestrncpy(username, trythisname, sizeof (username)); striplt(username); - len = cutuserkey(username); if (IsEmptyStr(username)) { return login_not_found; @@ -555,8 +553,7 @@ int CtdlLoginExistingUser(char *authname, const char *trythisname) found_user = getuserbyuid(&CC->user, pd.pw_uid); syslog(LOG_DEBUG, "user_ops: found it: uid=%ld, gecos=%s here: %d", (long)pd.pw_uid, pd.pw_gecos, found_user); if (found_user != 0) { - len = cutuserkey(username); - create_user(username, len, 0); + create_user(username, 0); found_user = getuserbyuid(&CC->user, pd.pw_uid); } @@ -578,7 +575,7 @@ int CtdlLoginExistingUser(char *authname, const char *trythisname) found_user = getuserbyuid(&CC->user, ldap_uid); if (found_user != 0) { - create_user(username, len, 0); + create_user(username, 0); found_user = getuserbyuid(&CC->user, ldap_uid); } @@ -1004,7 +1001,7 @@ int purge_user(char pname[]) } -int internal_create_user (char *username, long len, struct ctdluser *usbuf, uid_t uid) +int internal_create_user(char *username, struct ctdluser *usbuf, uid_t uid) { if (!CtdlGetUser(usbuf, username)) { return (ERROR + ALREADY_EXISTS); @@ -1042,7 +1039,7 @@ int internal_create_user (char *username, long len, struct ctdluser *usbuf, uid_ * Set 'become_user' to nonzero if this is self-service account creation and we want * to actually log in as the user we just created, otherwise set it to 0. */ -int create_user(const char *newusername, long len, int become_user) +int create_user(const char *newusername, int become_user) { struct ctdluser usbuf; struct ctdlroom qrbuf; @@ -1078,7 +1075,6 @@ int create_user(const char *newusername, long len, int become_user) if (IsEmptyStr (username)) { safestrncpy(username, pd.pw_name, sizeof username); - len = cutuserkey(username); } } else { @@ -1094,7 +1090,7 @@ int create_user(const char *newusername, long len, int become_user) } #endif /* HAVE_LDAP */ - if ((retval = internal_create_user(username, len, &usbuf, uid)) != 0) + if ((retval = internal_create_user(username, &usbuf, uid)) != 0) return retval; /* diff --git a/citadel/user_ops.h b/citadel/user_ops.h index 9769754b2..e53fab445 100644 --- a/citadel/user_ops.h +++ b/citadel/user_ops.h @@ -12,7 +12,7 @@ void rebuild_usersbynumber(void); void session_startup (void); void logged_in_response(void); int purge_user (char *pname); -int create_user (const char *newusername, long len, int become_user); +int create_user (const char *newusername, int become_user); void do_login(void); int CtdlInvtKick(char *iuser, int op); void ForEachUser(void (*CallBack)(struct ctdluser *EachUser, void *out_data), @@ -86,6 +86,6 @@ static INLINE void makeuserkey(char *key, const char *username, long len) { } -int internal_create_user(char *username, long len, struct ctdluser *usbuf, uid_t uid); +int internal_create_user(char *username, struct ctdluser *usbuf, uid_t uid); #endif