Moved makeuserkey() and cutuserkey() from user_ops.h to user_ops.c
authorArt Cancro <ajc@citadel.org>
Mon, 29 Jul 2019 20:16:55 +0000 (16:16 -0400)
committerArt Cancro <ajc@citadel.org>
Mon, 29 Jul 2019 20:16:55 +0000 (16:16 -0400)
citadel/user_ops.c
citadel/user_ops.h

index 7f6ed1c15309ba3d8f7bde5efefbc77132968480..168639ed91da8c3a93e6d84f2668e4c04c63b589 100644 (file)
@@ -32,6 +32,41 @@ int chkpwd_write_pipe[2];
 int chkpwd_read_pipe[2];
 
 
+
+/*
+ * Figure out what this does and make it cleaner
+ */
+long cutuserkey(char *username) { 
+       long len;
+       len = strlen(username);
+       if (len >= USERNAME_SIZE)
+       {
+               syslog(LOG_INFO, "Username too long: %s", username);
+               len = USERNAME_SIZE - 1; 
+               username[len]='\0';
+       }
+       return len;
+}
+
+
+/*
+ * makeuserkey() - convert a username into the format used as a database key
+ *              (it's just the username converted into lower case)
+ */
+void makeuserkey(char *key, const char *username, long len) {
+       int i;
+
+       if (len >= USERNAME_SIZE)
+       {
+               syslog(LOG_INFO, "Username too long: %s", username);
+               len = USERNAME_SIZE - 1; 
+       }
+       for (i=0; i<=len; ++i) {
+               key[i] = tolower(username[i]);
+       }
+}
+
+
 /*
  * CtdlGetUser()       retrieve named user into supplied buffer.
  *                     returns 0 on success
index 697554f13ffa61e1fcaa025965ffdd8b0d64dd3e..02bcf394babce2299a15790a1cae4eef042ff9a2 100644 (file)
@@ -55,42 +55,8 @@ void start_chkpwd_daemon(void);
 
 int rename_user(char *oldname, char *newname);
 
-///#ifndef CTDL_INLINE_USR
-////#define CTDL_INLINE_USR static INLINE
-///#endif
-
-///CTDL_INLINE_USR 
-static INLINE long cutuserkey(char *username) { 
-       long len;
-       len = strlen(username);
-       if (len >= USERNAME_SIZE)
-       {
-               syslog(LOG_INFO, "Username too long: %s", username);
-               len = USERNAME_SIZE - 1; 
-               username[len]='\0';
-       }
-       return len;
-}
-
-/*
- * makeuserkey() - convert a username into the format used as a database key
- *              (it's just the username converted into lower case)
- */
-///CTDL_INLINE_USR 
-static INLINE void makeuserkey(char *key, const char *username, long len) {
-       int i;
-
-       if (len >= USERNAME_SIZE)
-       {
-               syslog(LOG_INFO, "Username too long: %s", username);
-               len = USERNAME_SIZE - 1; 
-       }
-       for (i=0; i<=len; ++i) {
-               key[i] = tolower(username[i]);
-       }
-}
-
-
+long cutuserkey(char *username);
+void makeuserkey(char *key, const char *username, long len);
 int internal_create_user(char *username, struct ctdluser *usbuf, uid_t uid);
 
 #endif