InfoCenter Home >
5: Securing applications -- special topics >
5.2: Introduction to custom registries >
5.2.2: Implementing the CustomRegistry interface >
5.2.2.1: Structure of the example registry

5.2.2.1: Structure of the example registry

The registry used in this example consists of two text files. These files are variants of the UNIX /etc/password and /etc/group files. The file containing user information is called users.props, and the file containing group information is called groups.props.

The user-information file

Entries in the users.props file consist of the following fields, separated by the colon (:) character:

  • User name: the unique name associated with a user's account; maps to the user name in the CustomRegistry interface
  • Password: the password associated with the user name
  • User ID (UID): a single, unique number associated with the user name; maps to the unique identifier in the CustomRegistry interface
  • Group IDs (GIDs): a comma-delimited list of numeric identifiers indicating the groups to which the user belongs
  • Annotation: an optional string of information used for description; maps to the display name in the CustomRegistry interface

In this simple registry, the passwords are simply stored as cleartext fields; the passwords are not encrypted. Any lines that begin with the hash (#) character are considered comments and ignored. Figure 3 shows a sample user-information file.

Figure 3. The example users.props file

# User-information file
# Format: username:password:UID:GID[, GID]*:annotation
bob:bob1:123:567:bob
dave:dave1:234:678:
jay:jay1:345:678,789:Jay-Jay
ted:ted1:456:678:Teddy G
jeff:jeff1:222:789:Jeff
vikas:vikas1:333:789:vikas
bobby:bobby1:444:789:

The group-information file

Entries in the groups.props file consist of the following fields, separated by the colon (:) character:

  • Group name: the unique name associated with the group; maps to the group name in the CustomRegistry interface
  • Group ID (GID): a single, unique number associated with the group name; maps to the unique identifier in the CustomRegistry interface
  • User names: a comma-delimited list of the names of the members of the group
  • Annotation: an optional string of information used for description; maps to the display name in the CustomRegistry interface

Any lines that begin with the hash (#) character are considered comments and ignored. Figure 4 shows a sample group-information file.

Figure 4. The example groups.props file

# Group-information file
# Format: groupname:GID:username[, username]*:annotation
admins:567:bob:Administrative group
operators:678:jay,ted,dave:Operators group
users:789:jay,jeff,vikas,bobby:

Go to previous article: Implementing the CustomRegistry interface Go to next article: Implementing the CustomRegistry interface

 

 
Go to previous article: Implementing the CustomRegistry interface Go to next article: Implementing the CustomRegistry interface