get, put - read and write password entries in the password file — Inferno 1ed
get, put - read and write password entries in the password file
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;
Description
This module provides a convenient interface to the password file (/keydb/password). Each entry in the file contains information corresponding to the members of the PW adt. Those members and their respective sizes (in bytes) are:
Each new entry increases the size of the password file by 128 bytes.
The constant PWlen is currently unused.
Files
|
/keydb/password
|
Storage for password entries.
|
Caveat
Access to the password file is not serialized.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.
See Also
|
logind - login daemon in Chapter 9
|
|
changelogin - command to create/update the password file
|
infernosupport@lucent.com Copyright © 1996,Lucent Technologies, Inc. All rights reserved.