This repository was archived by the owner on Jan 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathsfsagent.x
486 lines (378 loc) · 9.35 KB
/
sfsagent.x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
/* $Id$ */
/*
* This file was written by David Mazieres and Michael Kaminsky. Its
* contents is uncopyrighted and in the public domain. Of course,
* standards of academic honesty nonetheless prevent anyone in
* research from falsely claiming credit for this work.
*/
%#include "sfs_prot.h"
typedef string sfs_filename<255>;
struct sfsagent_authinit_arg_old {
int ntries;
string requestor<>;
sfs_authinfo authinfo;
sfs_seqno seqno;
};
struct sfsagent_authinit_arg {
int ntries;
string requestor<>;
sfs_authinfo authinfo;
sfs_seqno seqno;
sfs_idname user;
unsigned server_release;
};
struct sfsagent_authmore_arg {
sfs_authinfo authinfo;
sfs_seqno seqno;
bool checkserver; /* To request mutual authentication at end */
opaque more<>;
};
union sfsagent_auth_res switch (bool authenticate) {
case TRUE:
opaque certificate<>;
case FALSE:
void;
};
typedef string sfsagent_path<1024>;
enum sfsagent_lookup_type {
LOOKUP_NOOP = 0,
LOOKUP_MAKELINK = 1,
LOOKUP_MAKEDIR = 2
};
union sfsagent_lookup_res switch (sfsagent_lookup_type type) {
case LOOKUP_NOOP:
void;
case LOOKUP_MAKELINK:
sfsagent_path path;
case LOOKUP_MAKEDIR:
sfsagent_path dir;
};
enum sfs_revocation_type {
REVOCATION_NONE = 0,
REVOCATION_BLOCK = 1,
REVOCATION_CERT = 2
};
union sfsagent_revoked_res switch (sfs_revocation_type type) {
case REVOCATION_NONE:
void;
case REVOCATION_BLOCK:
void;
case REVOCATION_CERT:
sfs_pathrevoke cert;
};
struct sfsagent_symlink_arg {
sfs_filename name;
sfsagent_path contents;
};
typedef opaque sfsagent_seed[48];
const sfs_badgid = -1;
union sfs_privkey2_clear switch (sfs_keytype type) {
case SFS_RABIN:
sfs_rabin_priv_xdr rabin;
case SFS_1SCHNORR:
sfs_1schnorr_priv_xdr schnorr1;
case SFS_2SCHNORR:
sfs_2schnorr_priv_xdr schnorr2;
case SFS_ESIGN:
sfs_esign_priv_xdr esign;
};
typedef string sfsagent_comment<1023>;
struct sfs_addkey_arg {
sfs_privkey2_clear privkey;
int key_version;
sfs_time expire;
sfsagent_comment name;
};
struct sfsagent_addextauth_arg {
sfs_time expire;
int pid;
sfsagent_comment name;
};
struct sfsextauth_init {
sfsagent_comment name;
sfsagent_authinit_arg autharg;
};
struct sfsextauth_more {
sfsagent_comment name;
sfsagent_authmore_arg autharg;
};
enum sfs_remauth_type {
SFS_REM_PUBKEY,
SFS_REM_NAME,
SFS_REM_PID
};
union sfs_remauth_arg switch (sfs_remauth_type type) {
case SFS_REM_PUBKEY:
sfs_pubkey2 pubkey;
case SFS_REM_NAME:
sfsagent_comment name;
case SFS_REM_PID:
int pid;
};
struct sfs_keylistelm {
string desc<>; /* Long string description */
sfs_time expire;
sfsagent_comment name;
sfs_keylistelm *next;
};
typedef sfs_keylistelm *sfs_keylist;
typedef string sfsagent_progarg<>;
typedef sfsagent_progarg sfsagent_cmd<>;
struct sfsagent_certprog {
string prefix<>; /* Prefix path to match against path name */
string filter<>; /* Regular expression filter on path name */
string exclude<>; /* Regular expression filter on path name */
sfsagent_cmd av; /* External program to run */
};
typedef sfsagent_certprog sfsagent_certprogs<>;
struct sfsagent_blockfilter {
string filter<>; /* Regular expression filter on hostname */
string exclude<>; /* Regular expression filter on hostname */
};
struct sfsagent_revokeprog {
sfsagent_blockfilter *block; /* Block hostid even without revocation cert */
sfsagent_cmd av; /* External program to run */
};
typedef sfsagent_revokeprog sfsagent_revokeprogs<>;
typedef sfs_hash sfsagent_norevoke_list<>;
typedef string sfsagent_srpname<>;
struct sfsagent_srpname_pair {
sfsagent_srpname srpname; /* [email protected] */
sfs_hostname sfsname; /* self-certifying hostname */
};
typedef sfsagent_srpname_pair sfsagent_srpname_pairs<>;
union sfsagent_srpname_res switch (bool status) {
case TRUE:
sfs_hostname sfsname;
case FALSE:
void;
};
typedef sfsagent_cmd sfsagent_confprog;
typedef sfsagent_cmd sfsagent_srpcacheprog;
struct sfsagent_rex_arg {
sfs_hostname dest; /* destination user named on cmdline */
sfs_hostname schost; /* corresponding self-certifying hostname */
bool forwardagent;
bool blockactive;
bool resumable;
};
struct sfsagent_rex_resok {
sfs_hash sessid;
sfs_seqno seqno;
sfs_hash newsessid;
opaque kcs<>;
opaque ksc<>;
};
union sfsagent_rex_res switch (bool status) {
case TRUE:
sfsagent_rex_resok resok;
case FALSE:
void;
};
struct rex_sessentry {
sfs_hostname dest; /* destination user named on cmdline */
sfs_hostname schost; /* corresponding self-certifying hostname */
sfs_hostname created_from;
bool agentforwarded;
};
typedef rex_sessentry rex_sessvec<>;
struct sfsctl_getfh_arg {
filename3 filesys;
u_int64_t fileid;
};
union sfsctl_getfh_res switch (nfsstat3 status) {
case NFS3_OK:
nfs_fh3 fh;
default:
void;
};
struct sfsctl_getidnames_arg {
filename3 filesys;
sfs_idnums nums;
};
union sfsctl_getidnames_res switch (nfsstat3 status) {
case NFS3_OK:
sfs_idnames names;
default:
void;
};
struct sfsctl_getidnums_arg {
filename3 filesys;
sfs_idnames names;
};
union sfsctl_getidnums_res switch (nfsstat3 status) {
case NFS3_OK:
sfs_idnums nums;
default:
void;
};
union sfsctl_getcred_res switch (nfsstat3 status) {
case NFS3_OK:
sfsauth_cred cred;
default:
void;
};
struct sfsctl_lookup_arg {
filename3 filesys;
diropargs3 arg;
};
struct sfsctl_getacl_arg {
filename3 filesys;
diropargs3 arg;
};
struct sfsctl_setacl_arg {
filename3 filesys;
setaclargs arg;
};
program AGENTCTL_PROG {
version AGENTCTL_VERS {
void
AGENTCTL_NULL (void) = 0;
bool
AGENTCTL_ADDKEY (sfs_addkey_arg) = 1;
bool
AGENTCTL_REMAUTH (sfs_remauth_arg) = 2;
void
AGENTCTL_REMALLKEYS (void) = 3;
sfs_keylist
AGENTCTL_DUMPKEYS (void) = 4;
void
AGENTCTL_CLRCERTPROGS (void) = 5;
bool
AGENTCTL_ADDCERTPROG (sfsagent_certprog) = 6;
sfsagent_certprogs
AGENTCTL_DUMPCERTPROGS (void) = 7;
void
AGENTCTL_CLRREVOKEPROGS (void) = 8;
bool
AGENTCTL_ADDREVOKEPROG (sfsagent_revokeprog) = 9;
sfsagent_revokeprogs
AGENTCTL_DUMPREVOKEPROGS (void) = 10;
void
AGENTCTL_SETNOREVOKE (sfsagent_norevoke_list) = 11;
sfsagent_norevoke_list
AGENTCTL_GETNOREVOKE (void) = 12;
void
AGENTCTL_SYMLINK (sfsagent_symlink_arg) = 13;
void
AGENTCTL_RESET (void) = 14;
int
AGENTCTL_FORWARD (sfs_hostname) = 15;
void
AGENTCTL_RNDSEED (sfsagent_seed) = 16;
sfsagent_rex_res
AGENTCTL_REX (sfsagent_rex_arg) = 17;
rex_sessvec
AGENTCTL_LISTSESS (void) = 18;
bool
AGENTCTL_KILLSESS (sfs_hostname) = 19;
bool
AGENTCTL_CLRCERTPROG_BYREALM (sfsauth_realm) = 20;
bool
AGENTCTL_ADDEXTAUTH (sfsagent_addextauth_arg) = 21;
void
AGENTCTL_CLRSRPNAMES (void) = 22;
bool
AGENTCTL_ADDSRPNAME (sfsagent_srpname_pair) = 23;
sfsagent_srpname_pairs
AGENTCTL_DUMPSRPNAMES (void) = 24;
sfsagent_srpname_res
AGENTCTL_LOOKUPSRPNAME (sfsagent_srpname) = 25;
void
AGENTCTL_CLRCONFIRMPROG (void) = 26;
bool
AGENTCTL_ADDCONFIRMPROG (sfsagent_confprog) = 27;
sfsagent_confprog
AGENTCTL_DUMPCONFIRMPROG (void) = 28;
void
AGENTCTL_CLRSRPCACHEPROG (void) = 29;
bool
AGENTCTL_ADDSRPCACHEPROG (sfsagent_srpcacheprog) = 30;
sfsagent_srpcacheprog
AGENTCTL_DUMPSRPCACHEPROG (void) = 31;
bool
AGENTCTL_KEEPALIVE (sfs_hostname) = 32;
void
AGENTCTL_KILL (void) = 33;
} = 1;
} = 344428;
program SFSEXTAUTH_PROG {
version SFSEXTAUTH_VERS {
void
SFSEXTAUTH_NULL (void) = 0;
sfsagent_auth_res
SFSEXTAUTH_AUTHINIT (sfsextauth_init) = 1;
sfsagent_auth_res
SFSEXTAUTH_AUTHMORE (sfsextauth_more) = 2;
} = 1;
} = 344429;
program SETUID_PROG {
version SETUID_VERS {
/* Note: SETUIDPROC_SETUID requires an authunix AUTH. */
int SETUIDPROC_SETUID (void) = 0;
} = 1;
} = 344430;
program AGENT_PROG {
version AGENT_VERS {
void
AGENT_NULL (void) = 0;
int
AGENT_START (void) = 1;
int
AGENT_KILL (void) = 2;
int
AGENT_KILLSTART (void) = 3;
void
AGENT_SYMLINK (sfsagent_symlink_arg) = 4;
void
AGENT_FLUSHNAME (sfs_filename) = 5;
void
AGENT_FLUSHNEG (void) = 6;
void
AGENT_REVOKE (sfs_pathrevoke) = 7;
sfsagent_seed
AGENT_RNDSEED (void) = 8;
unsigned
AGENT_AIDALLOC (void) = 9;
int
AGENT_GETAGENT (void) = 10;
} = 1;
} = 344432;
program AGENTCB_PROG {
version AGENTCB_VERS {
void
AGENTCB_NULL (void) = 0;
sfsagent_auth_res
AGENTCB_AUTHINIT (sfsagent_authinit_arg) = 1;
sfsagent_auth_res
AGENTCB_AUTHMORE (sfsagent_authmore_arg) = 2;
sfsagent_lookup_res
AGENTCB_LOOKUP (sfs_filename) = 3;
sfsagent_revoked_res
AGENTCB_REVOKED (filename3) = 4;
void
AGENTCB_CLONE (void) = 5;
} = 1;
} = 344433;
program SFSCTL_PROG {
version SFSCTL_VERS {
void
SFSCTL_NULL (void) = 0;
void
SFSCTL_SETPID (int) = 1;
sfsctl_getfh_res
SFSCTL_GETFH (sfsctl_getfh_arg) = 2;
sfsctl_getidnames_res
SFSCTL_GETIDNAMES (sfsctl_getidnames_arg) = 3;
sfsctl_getidnums_res
SFSCTL_GETIDNUMS (sfsctl_getidnums_arg) = 4;
sfsctl_getcred_res
SFSCTL_GETCRED (filename3) = 5;
lookup3res
SFSCTL_LOOKUP (sfsctl_lookup_arg) = 6;
read3res
SFSCTL_GETACL (sfsctl_getacl_arg) = 7;
write3res
SFSCTL_SETACL (sfsctl_setacl_arg) = 8;
} = 1;
} = 344434;