Coda Distributed File System
user.h
Go to the documentation of this file.
1/* BLURB gpl
2
3 Coda File System
4 Release 8
5
6 Copyright (c) 1987-2021 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU General Public Licence Version 2, as shown in the
11file LICENSE. The technical and financial contributors to Coda are
12listed in the file CREDITS.
13
14 Additional copyrights
15 none currently
16
17#*/
18
19/*
20 *
21 * Specification of the Venus User abstraction.
22 *
23 */
24
25#ifndef _VENUS_USER_H_
26#define _VENUS_USER_H_ 1
27
28/* Forward declarations. */
29class userent;
30class user_iterator;
31class srvent;
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36#include <stdio.h>
37#include <rpc2/rpc2.h>
38#ifdef __cplusplus
39}
40#endif
41
42/* interfaces */
43#include <auth2.h>
44
45/* from util */
46#include <olist.h>
47
48/* from venus */
49#include "comm.h"
50#include "venus.private.h"
51
52class userent {
53 friend void UserInit();
54 friend void PutUser(userent **);
55 friend void UserPrint(int);
56 friend class user_iterator;
57 friend class fsdb;
58 friend class Realm; /* ~Realm, ResetTransient, GetUser, NewUserToken */
59
60 /* The user list. */
61 static olist *usertab;
62
63 /* Transient members. */
64 olink tblhandle;
65 RealmId realmid;
66 uid_t uid;
67 int tokensvalid;
68 int told_you_so;
69 SecretToken secret;
70 ClearToken clear;
71 int waitforever : 1;
72
73 long DemandHoardWalkTime; /* time of last demand hoard walk for this user */
74
75 /* Constructors, destructors, and private utility routines. */
76 userent(RealmId realmid, uid_t userid);
77 userent(userent &); /* not supported! */
78 int operator=(userent &); /* not supported! */
79 ~userent();
80
81public:
82 long SetTokens(SecretToken *, ClearToken *);
83 long GetTokens(SecretToken *, ClearToken *);
84 int TokensValid();
85 void CheckTokenExpiry();
86 void Invalidate();
87 void Reset();
89 int *retry_cnt) EXCLUDES_TRANSACTION;
90 int Connect(RPC2_Handle *, int *, struct in_addr *) EXCLUDES_TRANSACTION;
91 int GetWaitForever();
92 void SetWaitForever(int);
93
94 uid_t GetUid() { return (uid); }
95
96 void print();
97 void print(FILE *);
98 void print(int);
99};
100
102public:
105};
106
107/* ***** Functions/Routines ***** */
108
109/* user.c */
110void UserInit();
111void PutUser(userent **);
112void UserPrint();
113void UserPrint(FILE *);
114void UserPrint(int);
115int AuthorizedUser(uid_t);
116int ConsoleUser(uid_t user);
117
118/* user_daemon.c */
119void USERD_Init(void);
121
122#endif /* _VENUS_USER_H_ */
Definition: realm.h:31
Definition: fso.h:121
Definition: olist.h:75
Definition: olist.h:47
Definition: rescomm.h:73
Definition: user.h:101
user_iterator()
Definition: user.cc:706
userent * operator()()
Definition: user.cc:711
Definition: user.h:52
friend void UserPrint(int)
Definition: user.cc:132
void Reset()
Definition: user.cc:375
int Connect(RPC2_Handle *, int *, struct in_addr *) EXCLUDES_TRANSACTION
Definition: user.cc:495
uid_t GetUid()
Definition: user.h:94
int GetWaitForever()
Definition: user.cc:647
long GetTokens(SecretToken *, ClearToken *)
Definition: user.cc:303
void print()
Definition: user.cc:667
void Invalidate()
Definition: user.cc:351
long SetTokens(SecretToken *, ClearToken *)
Definition: user.cc:266
int TokensValid()
Definition: user.cc:319
int CheckFetchPartialSupport(RPC2_Handle *cid, srvent *sv, int *retry_cnt) EXCLUDES_TRANSACTION
Definition: user.cc:406
friend void UserInit()
Definition: user.cc:74
friend void PutUser(userent **)
Definition: user.cc:116
void CheckTokenExpiry()
Definition: user.cc:325
void SetWaitForever(int)
Definition: user.cc:652
#define EXCLUDES_TRANSACTION
Definition: coda_tsa.h:108
uid
Definition: pwdtopdbtool.py:40
RPC2_Integer RPC2_Handle
Definition: rpc2.h:345
void USERD_Init(void)
Definition: user.cc:734
void UserPrint()
Definition: user.cc:121
int ConsoleUser(uid_t user)
Definition: user.cc:181
int AuthorizedUser(uid_t)
Definition: user.cc:152
void UserInit()
Definition: user.cc:74
void PutUser(userent **)
Definition: user.cc:116
void UserDaemon(void) EXCLUDES_TRANSACTION
Definition: user.cc:740