java.lang.Object
com.aoindustries.aoserv.daemon.posix.GroupFile
Manages access to the
/etc/group file.- Author:
- AO Industries, Inc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents one line of the/etc/groupfile on a POSIX server. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]buildGroupFile(Map<Group.Name, GroupFile.Entry> groups, int gidMin, int gidMax) Builds a new version of the group file with necessary adjustments made.static Map<Group.Name, GroupFile.Entry> Reads the full contents of/etc/group.static voidwriteGroupFile(byte[] newContents, Set<PosixFile> restorecon) Must holdgroupLock.
-
Field Details
-
groupLock
Locks the group file for updates.
-
-
Method Details
-
readGroupFile
Reads the full contents of/etc/group.Must hold
groupLock.- Throws:
IOException
-
writeGroupFile
Must holdgroupLock.- Throws:
IOException
-
buildGroupFile
public static byte[] buildGroupFile(Map<Group.Name, GroupFile.Entry> groups, int gidMin, int gidMax) throws IOExceptionBuilds a new version of the group file with necessary adjustments made.Must hold
groupLock.- Throws:
IOException
-
