com.sun.nfs

Class XFileExtensionAccessor

Known Direct Subclasses:
nfsXFileExtensionAccessor

public class XFileExtensionAccessor
extends XFileExtensionAccessor

Constructor Summary

XFileExtensionAccessor(XFile xf)

Method Summary

String[]
getExports()
Get server's export list
boolean
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
logoutPCNFSD()
Sets the user's RPC credential to "nobody"
void
logoutUGID()
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

public XFileExtensionAccessor(XFile xf)

Method Details

getExports

public String[] getExports()
            throws java.net.UnknownHostException,
                   IOException
Get server's export list

loginPCNFSD

public boolean loginPCNFSD(String host,
                           String username,
                           String password)
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".

Parameters:
Returns:
true if the login succeeded, false otherwise.

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".

Parameters:

logoutPCNFSD

public void logoutPCNFSD()
Sets the user's RPC credential to "nobody"

logoutUGID

public void logoutUGID()
Sets the user's RPC credential to "nobody"

setNfsHandler

public void setNfsHandler(NfsHandler handler)
Assigns an NfsHandler class that allows the application to receive RPC timeout notifications. The handler is used for all NFS files accessed by the application. The default handler can be restored by passing a null handler argument.
Parameters: