/* name of credentials file, defaults to .netrc in either Path or $HOME. */
char *credentials_file;
+/* if set to 1, do not check permissions on credentials file */
+int credentials_no_perm_check = 0;
+
/* name of current message "sequence" */
char *current = "cur";
extern char *context;
extern char *current;
extern char *credentials_file;
+extern int credentials_no_perm_check;
extern char *defaultfolder;
extern char *digestcomps;
extern char *distcomps;
.RS 5
Indicates how the username and password credentials will be retrieved
for access to external servers, such as those that provide SMTP or POP
-service. The supported entry values are \*(lqlegacy\*(rq and
-.RI \*(lqfile: netrc \*(rq.
+service. The supported entry values are \*(lqlegacy\*(rq,
+.RI \*(lqfile: netrc \*(rq,
+and
+.RI \*(lqfile\-nopermcheck: netrc \*(rq.
With \*(lqlegacy\*(rq, or if there is no credentials entry, the
username is the first of:
.RS 5
This
.I netrc
file must be owned and readable only by you.
+.PP
+The
+.RI \*(lqfile\-nopermcheck: netrc \*(rq
+.B credentials
+entry is identical in behavior to the \*(lqfile\*(rq entry, with the
+exception that the permission checks done by
+\*(lqfile\*(rq are not performed. This entry should be used with
+caution and only when absolutely necessary.
(profile, default: legacy)
.RE
.SS "Process Profile Entries"
char *hdir = getenv ("HOME");
credentials_file = concat (hdir ? hdir : ".", "/.netrc", NULL);
- } else if (! strncasecmp (cred_style, "file:", 5)) {
+ } else if (! strncasecmp (cred_style, "file:", 5) ||
+ ! strncasecmp (cred_style, "file-nopermcheck:", 17)) {
struct stat st;
- char *filename = cred_style + 5;
+ char *filename = strchr(cred_style, ':') + 1;
while (*filename && isspace ((unsigned char) *filename)) ++filename;
}
}
}
+
+ if (! strncasecmp (cred_style, "file-nopermcheck:", 17))
+ credentials_no_perm_check = 1;
}
}
}
/* Only inc.c and msgchk.c do this. smtp.c doesn't. */
creds->password = getusername ();
}
- } else if (! strncasecmp (cred_style, "file:", 5)) {
+ } else if (! strncasecmp (cred_style, "file:", 5) ||
+ ! strncasecmp (cred_style, "file-nopermcheck:", 17)) {
/*
* Determine user using the first of:
* 1) -user switch
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. */