Remove unused parameter
authorArt Cancro <ajc@citadel.org>
Mon, 30 Oct 2017 20:58:26 +0000 (16:58 -0400)
committerArt Cancro <ajc@citadel.org>
Mon, 30 Oct 2017 20:58:26 +0000 (16:58 -0400)
citadel/context.c
citadel/modules/ctdlproto/serv_user.c
citadel/modules/openid/serv_openid_rp.c
citadel/user_ops.c
citadel/user_ops.h

index f95a7a2f7cab24e9a867aa92f4f95b6f993c6e72..385f9a7790f3b51fc58446f3da8388c44b700f7a 100644 (file)
@@ -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)
index 82a18fd14d6654cb24f4e5f1453ec1561633c364..7b7725a6edcffdd9ce8c55893fcad64343ba8cf0 100644 (file)
@@ -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)) {
index 8ed7712e5eefd665d617e88ea9f55a5e0c4052a8..69479190e132ebb8233e631d56aee08b1b042f59 100644 (file)
@@ -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.
index 26aad209422851383163ba77c5106c2e3d35cbd9..00b02728362cc48a6aaa60bbe554285320fc14df 100644 (file)
@@ -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;
        
        /*
index 9769754b2380d989e4d3c16abecb11f4841ef1fb..e53fab445b2eeab289d89e0728b476d269c610b7 100644 (file)
@@ -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