Package com.sun.nfs
Class XFileExtensionAccessor
java.lang.Object
com.sun.xfile.XFileExtensionAccessor
com.sun.nfs.XFileExtensionAccessor
- Direct Known Subclasses:
nfsXFileExtensionAccessor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]
Get server's export listboolean
loginPCNFSD
(String host, String username, String password) Sets the user's RPC credential from Login name and password.void
loginUGID
(int uid, int gid, int[] gids) Sets the user's RPC credential to a known uid/gid.void
Sets the user's RPC credential to "nobody"void
Sets the user's RPC credential to "nobody"void
setNfsHandler
(NfsHandler handler) Assigns an NfsHandler class that allows the application to receive RPC timeout notifications.
-
Constructor Details
-
XFileExtensionAccessor
-
-
Method Details
-
loginPCNFSD
Sets the user's RPC credential from Login name and password. Every NFS request includes a "credential" that identifies the user. An AUTH_SYS credential includes the user's UID and GID values. These are determined from the user's login name (and password) by the PCNFSD service that must be available on a local server. Once the credential is set, it is assigned globally to all future NFS XFile objects.If this method is not called, a default credential is assigned with a UID and GID of "nobody".
- Type Parameters:
code
- host The name of the host that runs the PCNFSD service. This does not have to be an NFS server.code
- username The user's login name.code
- password The user's password. This is obscured before transmission to the PCNFSD server.- Returns:
- true if the login succeeded, false otherwise.
-
logoutPCNFSD
public void logoutPCNFSD()Sets the user's RPC credential to "nobody" -
loginUGID
public void loginUGID(int uid, int gid, int[] gids) Sets the user's RPC credential to a known uid/gid. Assumes that the calling application has already authenticated the user and has obtained to uid/gid itself.Note: This credential setting method exposes an inherent security hole in RPC AUTH_SYS authentication. The server trusts the client to authenticate the user before setting the UID and GID values. It is possible for a malicious client to allow the UID and/or group ids to be set to allow unauthorized access to other user's files on the server.
Servers can avoid this security hole by exporting NFS filesystem securely - requiring clients to use secure Diffie-Hellman or Kerberos credentials.
If this method is not called, a default credential is assigned with a UID and GID of "nobody".
- Type Parameters:
code
- uid The user-ID.code
- gid The group-ID.code
- gids The group-ID list.
-
logoutUGID
public void logoutUGID()Sets the user's RPC credential to "nobody" -
setNfsHandler
Assigns an NfsHandler class that allows the application to receive RPC timeout notifications. Thehandler
is used for all NFS files accessed by the application. The default handler can be restored by passing a nullhandler
argument.- Type Parameters:
code
- handler An instance of the NfsHandler class.
-
getExports
Get server's export list- Throws:
UnknownHostException
IOException
-