]> diplodocus.org Git - nmh/blobdiff - sbr/ruserpass.c
Cleaned up a bit, mostly in comments for each function.
[nmh] / sbr / ruserpass.c
index a55f68031b60006562a6874e4c33bd1a21617b3b..7892cbfdc46a636791d26fe48f54f7d266faeaf1 100644 (file)
@@ -102,7 +102,8 @@ ruserpass(char *host, char **aname, char **apass)
                        break;
 
                    case PASSWD:
-                       if (fstat(fileno(cfile), &stb) >= 0 &&
+                       if (!credentials_no_perm_check &&
+                           fstat(fileno(cfile), &stb) >= 0 &&
                            (stb.st_mode & 077) != 0) {
                            /* We make this a fatal error to force the
                               user to correct it. */
@@ -152,7 +153,7 @@ ruserpass(char *host, char **aname, char **apass)
            advise ("tmp", "fgets");
        }
        tmp[strlen(tmp) - 1] = '\0';
-       if (*tmp != '\0') {
+       if (*tmp != '\0' || myname == NULL) {
            myname = tmp;
        }