All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object
|
+----jnfs.security.UnixStylePermissionGranter
|
+----jnfs.security.FileBasedPermissionGranter
ls -laR,
/etc/passwd, and /etc/group.
The ls -laR stream should be formatted as the below
example, where the first column lists the permission bits, the
third lists the owner, the fourth lists the group, and the ninth
the filename. All other fields are required but ignored.
The filename separator used to indicate which directory the files belong to must conform to the system-dependent file separator string (for example, "/" on unix and "\" on WinNT). A fragment from a directory listing is given below:
/: total 129 drwxr-xr-x 32 root root 1024 Feb 25 13:05 . drwxr-xr-x 32 root root 1024 Feb 25 13:05 .. dr-xr-xr-x 2 root root 3 May 21 15:40 bin lrwxrwxrwx 1 root root 9 Jan 6 19:47 lib -> ./usr/lib drwx------ 2 root root 8192 Jan 6 19:47 lost+found drwxrwxr-x 25 root sys 1024 Jan 7 09:16 usrThe
/bin: total 18944 drwxrwxr-x 2 root bin 7168 Mar 18 05:13 . drwxrwxr-x 25 root sys 1024 Jan 7 09:16 .. -r-sr-xr-x 1 root bin 32868 Jan 29 05:13 login -r-xr-xr-x 1 bin bin 17500 Oct 25 1995 ls -r-x--s--x 1 bin mail 66208 Jan 6 20:16 mail
group stream should consist of a one-line entry
for each group recognized by the system, of the form:
groupname:password:gid:user-list
where
groupname is the name of the group.
gid is the group's unique numerical ID within the system.
password is ignored. May be left blank.
user-list is a comma-separated list of users allowed
in the group.
passwd stream should consist of a one-line entry
for each user of the form:
username:password:uid:gid:gcos-field:home-dir:login-shell
where
username is the user's login name.
gid is the user's numerical group ID.
password
field may be left blank, but all other fields may not be blank.
ls -laR,
/etc/group, and /etc/passwd.
pathname to mode.
pathname to
owner and group membership to group.
pathname.
groupname.
pathname.
pathname.
ls -laR into this permission granter.
/etc/group into this permission granter.
/etc/passwd into this permission granter.
public FileBasedPermissionGranter(UserTable users,
InputStream ls_laR,
InputStream group,
InputStream passwd)
ls -laR,
/etc/group, and /etc/passwd. This
constructor is very slow.
public void readGroup(InputStream is)
/etc/group into this permission granter.
public void readPasswd(InputStream is)
/etc/passwd into this permission granter.
public void readDirListing(InputStream is)
ls -laR into this permission granter.
protected int mode(String pathname) throws IOException
pathname.
pathname does
not exist.
protected String owner(String pathname) throws IOException
pathname.
pathname does
not exist.
protected String group(String pathname) throws IOException
pathname.
pathname does
not exist.
protected String[] members(String group_name) throws IOException
groupname.
protected void chmod(String pathname,
int mode) throws IOException
pathname to mode.
pathname does
not exist.
protected void chown(String pathname,
String owner,
String group) throws IOException
pathname to
owner and group membership to group. If
either owner or group are
null, that permission is not changed. If both are
null, nothing happens.
pathname does
not exist.
All Packages Class Hierarchy This Package Previous Next Index