include "keyring.m";
include "security.m";
pw := load Password Password->PATH;
Password: module
{
PW: adt {
id: string; # user id
pw: array of byte; # password
expire: int; # expiration time (epoch
seconds)
other: string; # about the account
};
get: fn(id: string): ref PW;
put: fn(pass: ref PW): int;
PWlen: con 4;
};
| id | 32 | User identification string |
pw
| Keyring->SHAdlen (20) | Password. |
| expire | length of int (4) | Expiration data in seconds of epoch (Jan 1 00:00 1970 GMT). See daytime - time conversions in Chapter 15. |
| other | 72 | Arbitrary administrative comment. |
Each new entry increases the size of the password file by 128 bytes.
The functions provide access to the file:
The constant PWlen is currently unused.
| /keydb/password | Storage for password entries. |
This module transfers data without transformation (except for the truncating of excessively long fields) between the PWD adt and the password file. If some transformation is needed (for example, encryption of the pw value), the caller must make separate arrangements.