[8089] in Athena Bugs
rsaix 7.3M: xlogin
daemon@ATHENA.MIT.EDU (akajerry@ATHENA.MIT.EDU)
Mon Sep 2 16:14:09 1991
From: akajerry@ATHENA.MIT.EDU
To: bugs@ATHENA.MIT.EDU
Date: Mon, 02 Sep 91 16:14:38 EDT
System name: IX
Type and version: POWER 7.3M (1 update(s) to same version)
Display type: graygda
What were you trying to do?
N/A
What's wrong:
xlogin uses the function:
IsRemoteDir(dir)
char *dir;
{
int f;
char c;
struct stat stbuf;
if (lstat(dir, &stbuf))
return(FALSE);
if (!(stbuf.st_mode & S_IFDIR))
return(TRUE);
if ((f = open(dir, O_RDONLY, 0)) < 0)
return(FALSE);
if (read(f, &c, 1) < 0) {
close(f);
return(TRUE);
}
close(f);
return(FALSE);
}
To determine is a user's home dir is remote or not. This does not
work on the RS/6000 for NFS home dirs.
What should have happened:
This function should do the right thing for the RS/6000:
IsRemoteDir(dir)
char *dir;
{
int f;
char c;
struct stat stbuf;
#ifdef _AIX
if (statx(dir, &stbuf, STATXSIZE, STX_LINK))
return(FALSE);
if (!(stbuf.st_mode & S_IFDIR))
return(TRUE);
if (stbuf.st_flag == FS_REMOTE)
return(TRUE);
#else
if (lstat(dir, &stbuf))
return(FALSE);
if (!(stbuf.st_mode & S_IFDIR))
return(TRUE);
if ((f = open(dir, O_RDONLY, 0)) < 0)
return(FALSE);
if (read(f, &c, 1) < 0) {
close(f);
return(TRUE);
}
close(f);
#endif
return(FALSE);
}
Please describe any relevant documentation references:
see the Info on the stat.f file for the RS/6000