diff options
-rw-r--r-- | src/hash.c | 4 | ||||
-rw-r--r-- | src/s_user.c | 32 |
2 files changed, 32 insertions, 4 deletions
@@ -569,7 +569,7 @@ add_user_host(const char *user, const char *host, int global) struct NameHost *nameh; int hasident = 1; - if (*user == '~') + if (*user == '~' || *user == '^') { hasident = 0; ++user; @@ -629,7 +629,7 @@ delete_user_host(const char *user, const char *host, int global) struct NameHost *nameh; int hasident = 1; - if (*user == '~') + if (*user == '~' || *user == '^') { hasident = 0; ++user; diff --git a/src/s_user.c b/src/s_user.c index b9a9a64..1017c05 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -339,8 +339,14 @@ register_local_user(struct Client *source_p) strlcpy(username, source_p->username, sizeof(username)); - if (!IsNoTilde(conf)) + if (!IsNoTilde(conf)) { +#ifdef HAVE_LIBCRYPTO + if (source_p->localClient->fd.ssl != NULL) + source_p->username[i++] = '^'; + else +#endif source_p->username[i++] = '~'; + } for (; *p && i < USERLEN; ++p) if (*p != '[') @@ -348,6 +354,28 @@ register_local_user(struct Client *source_p) source_p->username[i] = '\0'; } + else + { + char username[USERLEN + 1]; + const char *p = username; + unsigned int i = 0; + + strlcpy(username, source_p->username, sizeof(username)); + + if (!IsNoTilde(conf)) { +#ifdef HAVE_LIBCRYPTO + if (source_p->localClient->fd.ssl != NULL) + source_p->username[i++] = '^'; + else +#endif + source_p->username[i++] = '~'; + } + + for (; *p && i < USERLEN; ++p) + source_p->username[i++] = *p; + + source_p->username[i] = '\0'; + } /* password check */ if (!EmptyString(conf->passwd)) @@ -674,7 +702,7 @@ valid_username(const char *username, const int local) assert(p != NULL); - if (*p == '~') + if (*p == '^' || *p == '~') ++p; /* |