* libc/rexec.cc (ruserpass): Use fstat64 instead of fstat.
This commit is contained in:
parent
2f9ee8fc90
commit
6af3d60df9
|
@ -1,3 +1,7 @@
|
||||||
|
2009-04-06 Earl Chew <earl_chew@agilent.com>
|
||||||
|
|
||||||
|
* libc/rexec.cc (ruserpass): Use fstat64 instead of fstat.
|
||||||
|
|
||||||
2009-04-06 Corinna Vinschen <corinna@vinschen.de>
|
2009-04-06 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* strfuncs.cc: Add comment to explain why we can't support JIS
|
* strfuncs.cc: Add comment to explain why we can't support JIS
|
||||||
|
|
|
@ -159,7 +159,7 @@ ruserpass(const char *host, char **aname, char **apass, char **aacct)
|
||||||
char myname[INTERNET_MAX_HOST_NAME_LENGTH + 1];
|
char myname[INTERNET_MAX_HOST_NAME_LENGTH + 1];
|
||||||
const char *mydomain;
|
const char *mydomain;
|
||||||
int t, i, c, usedefault = 0;
|
int t, i, c, usedefault = 0;
|
||||||
struct stat stb;
|
struct __stat64 stb;
|
||||||
|
|
||||||
hdir = getenv("HOME");
|
hdir = getenv("HOME");
|
||||||
if (hdir == NULL)
|
if (hdir == NULL)
|
||||||
|
@ -218,7 +218,7 @@ next:
|
||||||
break;
|
break;
|
||||||
case PASSWD:
|
case PASSWD:
|
||||||
if ((*aname == 0 || strcmp(*aname, "anonymous")) &&
|
if ((*aname == 0 || strcmp(*aname, "anonymous")) &&
|
||||||
fstat(fileno(cfile), &stb) >= 0 &&
|
fstat64(fileno(cfile), &stb) >= 0 &&
|
||||||
(stb.st_mode & 077) != 0) {
|
(stb.st_mode & 077) != 0) {
|
||||||
warnx("Error: .netrc file is readable by others.");
|
warnx("Error: .netrc file is readable by others.");
|
||||||
warnx("Remove password or make file unreadable by others.");
|
warnx("Remove password or make file unreadable by others.");
|
||||||
|
@ -230,7 +230,7 @@ next:
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACCOUNT:
|
case ACCOUNT:
|
||||||
if (fstat(fileno(cfile), &stb) >= 0
|
if (fstat64(fileno(cfile), &stb) >= 0
|
||||||
&& (stb.st_mode & 077) != 0) {
|
&& (stb.st_mode & 077) != 0) {
|
||||||
warnx("Error: .netrc file is readable by others.");
|
warnx("Error: .netrc file is readable by others.");
|
||||||
warnx("Remove account or make file unreadable by others.");
|
warnx("Remove account or make file unreadable by others.");
|
||||||
|
|
Loading…
Reference in New Issue