X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/e2b5453864a9343161ed2dd53527a0ea858d3c43..f0bcd0b87a07dbe86db190f554a77fd89f4823d8:/sbr/mts.c diff --git a/sbr/mts.c b/sbr/mts.c index 3ffdfead..868e603c 100644 --- a/sbr/mts.c +++ b/sbr/mts.c @@ -412,9 +412,12 @@ getuserinfo (void) strncpy (username, pw->pw_name, sizeof(username)); /* The $SIGNATURE environment variable overrides the GECOS field's idea of - your real name. */ + your real name. If SIGNATURE isn't set, use the Signature profile + setting if it exists. */ if ((cp = getenv ("SIGNATURE")) && *cp) strncpy (fullname, cp, sizeof(fullname)); + else if ((cp = context_find("Signature"))) + strncpy (fullname, cp, sizeof(fullname)); if (strchr(fullname, '.')) { /* quote any .'s */ char tmp[BUFSIZ]; @@ -424,6 +427,8 @@ getuserinfo (void) strncpy (fullname, tmp, sizeof(fullname)); } + fullname[sizeof(fullname) - 1] = '\0'; + return; }