From d80e6017603a6eeadb5fa1d5220a4b92c0efc367 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Wed, 11 Sep 2019 14:31:14 +0200 Subject: [PATCH] Rename sptr->username to sptr->ident, since that is what it is. [skip ci] --- include/struct.h | 2 +- src/bsd.c | 2 +- src/list.c | 2 +- src/misc.c | 4 ++-- src/modules/nick.c | 14 +++++++------- src/modules/server.c | 4 ++-- src/modules/tkl.c | 2 +- src/modules/whois.c | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/struct.h b/include/struct.h index bdb3b5c6b..b2c77d27f 100644 --- a/include/struct.h +++ b/include/struct.h @@ -929,7 +929,7 @@ struct Client { It is never NULL */ unsigned char hopcount; /**< Number of servers to this, 0 means local client */ char name[HOSTLEN + 1]; /**< Unique name of the client: nickname for persons, hostname for servers */ - char username[USERLEN + 1]; /**< Username, or actually the ident */ + char ident[USERLEN + 1]; /**< Ident of the user, if available. Otherwise set to "unknown". */ char info[REALLEN + 1]; /**< Additional client information text. For persons this is gecos/realname */ char id[IDLEN + 1]; /**< Unique ID: SID or UID */ Client *srvptr; /**< Server on where this client is connected to (can be &me) */ diff --git a/src/bsd.c b/src/bsd.c index 9e460ff40..b6f3707c1 100644 --- a/src/bsd.c +++ b/src/bsd.c @@ -1700,7 +1700,7 @@ static void read_authports(int fd, int revents, void *userdata) return; } ircstp->is_asuc++; - strlcpy(cptr->username, ruser, USERLEN + 1); + strlcpy(cptr->ident, ruser, USERLEN + 1); cptr->flags |= FLAGS_GOTID; Debug((DEBUG_INFO, "got username [%s]", ruser)); return; diff --git a/src/list.c b/src/list.c index be72c3f9b..99629448a 100644 --- a/src/list.c +++ b/src/list.c @@ -111,7 +111,7 @@ Client *make_client(Client *from, Client *servr) INIT_LIST_HEAD(&cptr->client_hash); INIT_LIST_HEAD(&cptr->id_hash); - (void)strcpy(cptr->username, "unknown"); + (void)strcpy(cptr->ident, "unknown"); if (!from) { /* Local client */ diff --git a/src/misc.c b/src/misc.c index dd2efb1b1..a9315913f 100644 --- a/src/misc.c +++ b/src/misc.c @@ -284,7 +284,7 @@ char *get_client_name(Client *sptr, int showip) (void)ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@%s.%u]", sptr->name, (!(sptr->flags & FLAGS_GOTID)) ? "" : - sptr->username, + sptr->ident, sptr->ip ? sptr->ip : "???", (unsigned int)sptr->local->port); else @@ -310,7 +310,7 @@ char *get_client_host(Client *cptr) return get_client_name(cptr, FALSE); (void)ircsnprintf(nbuf, sizeof(nbuf), "%s[%-.*s@%-.*s]", cptr->name, USERLEN, - (!(cptr->flags & FLAGS_GOTID)) ? "" : cptr->username, + (!(cptr->flags & FLAGS_GOTID)) ? "" : cptr->ident, HOSTLEN, cptr->local->hostp->h_name); return nbuf; } diff --git a/src/modules/nick.c b/src/modules/nick.c index febe15ea6..17282db4b 100644 --- a/src/modules/nick.c +++ b/src/modules/nick.c @@ -312,7 +312,7 @@ CMD_FUNC(m_uid) me.name, sptr->name, me.name, get_client_name(cptr, FALSE), sptr->name, - sptr->user ? sptr->username : "", + sptr->user ? sptr->ident : "", sptr->user ? sptr->user->server : cptr->name); sptr->flags |= FLAGS_KILLED; @@ -645,7 +645,7 @@ CMD_FUNC(m_nick) me.name, sptr->name, me.name, get_client_name(cptr, FALSE), sptr->name, - sptr->user ? sptr->username : "", + sptr->user ? sptr->ident : "", sptr->user ? sptr->user->server : cptr->name); sptr->flags |= FLAGS_KILLED; @@ -1259,7 +1259,7 @@ int _register_user(Client *cptr, Client *sptr, char *nick, char *username, char * username. -Donwulff * * I do, We only allow a-z A-Z 0-9 _ - and . now so the - * !strchr(sptr->username, '@') check is out of date. -Cabal95 + * !strchr(sptr->ident, '@') check is out of date. -Cabal95 * * Moved the noident stuff here. -OnyxDragon */ @@ -1270,7 +1270,7 @@ int _register_user(Client *cptr, Client *sptr, char *nick, char *username, char if (!(sptr->flags & FLAGS_DOID)) strlcpy(user->username, temp, USERLEN + 1); else if (sptr->flags & FLAGS_GOTID) - strlcpy(user->username, sptr->username, USERLEN+1); + strlcpy(user->username, sptr->ident, USERLEN+1); else { if (IDENT_CHECK == 0) { @@ -1724,7 +1724,7 @@ int AllowClient(Client *cptr, struct hostent *hp, char *sockhost, char *username if (aconf->flags.noident) strlcpy(uhost, username, sizeof(uhost)); else - strlcpy(uhost, cptr->username, sizeof(uhost)); + strlcpy(uhost, cptr->ident, sizeof(uhost)); strlcat(uhost, "@", sizeof(uhost)); } else @@ -1739,7 +1739,7 @@ int AllowClient(Client *cptr, struct hostent *hp, char *sockhost, char *username if (aconf->flags.noident) strlcpy(uhost, username, sizeof(uhost)); else - strlcpy(uhost, cptr->username, sizeof(uhost)); + strlcpy(uhost, cptr->ident, sizeof(uhost)); (void)strlcat(uhost, "@", sizeof(uhost)); } else @@ -1758,7 +1758,7 @@ int AllowClient(Client *cptr, struct hostent *hp, char *sockhost, char *username if (aconf->flags.noident) strlcpy(uhost, username, sizeof(uhost)); else - strlcpy(uhost, cptr->username, sizeof(uhost)); + strlcpy(uhost, cptr->ident, sizeof(uhost)); strlcat(uhost, "@localhost", sizeof(uhost)); } else diff --git a/src/modules/server.c b/src/modules/server.c index e3e3df97f..3c65ba0b1 100644 --- a/src/modules/server.c +++ b/src/modules/server.c @@ -275,7 +275,7 @@ int _verify_link(Client *cptr, Client *sptr, char *servername, ConfigItem_link * sendto_one(cptr, NULL, "ERROR :%s", xerrmsg); sendto_ops_and_log("Outgoing link aborted to %s(%s@%s) (%s) %s", - cptr->serv->conf->servername, cptr->username, cptr->local->sockhost, xerrmsg, inpath); + cptr->serv->conf->servername, cptr->ident, cptr->local->sockhost, xerrmsg, inpath); return exit_client(cptr, sptr, &me, NULL, xerrmsg); } link = cptr->serv->conf; @@ -311,7 +311,7 @@ errlink: servername, GetIP(cptr), inpath); /* And send the "verbose" error msg only to locally connected ircops */ sendto_ops_and_log("Link denied for %s(%s@%s) (%s) %s", - servername, cptr->username, cptr->local->sockhost, xerrmsg, inpath); + servername, cptr->ident, cptr->local->sockhost, xerrmsg, inpath); return exit_client(cptr, sptr, &me, NULL, "Link denied (No link block found with your server name or link::incoming::mask did not match)"); } diff --git a/src/modules/tkl.c b/src/modules/tkl.c index 522f22b07..67194566b 100644 --- a/src/modules/tkl.c +++ b/src/modules/tkl.c @@ -4542,7 +4542,7 @@ int _match_user(char *rmask, Client *acptr, int options) p = strchr(p ? p : mask, '@'); if (p) { - char *client_username = (acptr->user && *acptr->user->username) ? acptr->user->username : acptr->username; + char *client_username = (acptr->user && *acptr->user->username) ? acptr->user->username : acptr->ident; *p++ = '\0'; if (!*p || !*mask) diff --git a/src/modules/whois.c b/src/modules/whois.c index a2af06861..9e7d6e9c2 100644 --- a/src/modules/whois.c +++ b/src/modules/whois.c @@ -147,7 +147,7 @@ CMD_FUNC(m_whois) if ((acptr == sptr) || IsOper(sptr)) { sendnumeric(sptr, RPL_WHOISHOST, acptr->name, - (MyConnect(acptr) && strcmp(acptr->username, "unknown")) ? acptr->username : "*", + (MyConnect(acptr) && strcmp(acptr->ident, "unknown")) ? acptr->ident : "*", acptr->user->realhost, acptr->ip ? acptr->ip : ""); }