static afs_int32 mode = 1; /* Start up in 'off' */
afs_int32 force = 0;
int code = 0;
- char flags[3];
+ char flags[4];
+ struct vrequest lreq;
- if (afs_pd_getBytes(ain, &flags, 3) == 0) {
+ if (afs_pd_getBytes(ain, &flags, 4) == 0) {
if (!afs_osi_suser(*acred))
return EPERM;
afs_ConflictPolicy = flags[1] - 1;
if (flags[2])
force = 1;
+ if (flags[3]) {
+ /* Fake InitReq support for UID override */
+ memset(&lreq, 0, sizeof(lreq));
+ lreq.uid = flags[3];
+ areq = &lreq; /* override areq we got */
+ }
/*
* All of these numbers are hard coded in fs.c. If they
char *modename;
char *policyname;
int modelen, policylen;
- afs_int32 mode, policy, code;
+ afs_int32 mode, policy, code, unixuid = 0;
struct ViceIoctl blob;
blob.in = NULL;
blob.in_size = 0;
- space[0] = space[1] = space[2] = 0;
+ space[0] = space[1] = space[2] = space[3] = 0;
ti = as->parms[0].items;
if (ti) {
printf("force on\n");
}
+ ti = as->parms[3].items;
+ if (ti) {
+ code = util_GetInt32(ti->data, &unixuid);
+ if (code) {
+ fprintf(stderr, "%s: bad integer specified for uid.\n", pn);
+ return 1;
+ }
+ space[3] = unixuid;
+ } else
+ space[3] = 0;
+
blob.in = space;
- blob.in_size = 3 * sizeof(afs_int32);
+ blob.in_size = 4 * sizeof(afs_int32);
blob.out_size = sizeof(mode);
blob.out = space;
cmd_AddParm(ts, "-mode", CMD_SINGLE, CMD_REQUIRED, "offline | online");
cmd_AddParm(ts, "-policy", CMD_SINGLE, CMD_OPTIONAL, "client | server");
cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, "Force reconnection, despite any synchronization issues.");
+ cmd_AddParm(ts, "-uid", CMD_SINGLE, CMD_OPTIONAL, "Numeric UID of user whose tokens to use at reconnect.");
ts = cmd_CreateSyntax("nukenfscreds", NukeNFSCredsCmd, NULL, "nuke credentials for NFS client");
cmd_AddParm(ts, "-addr", CMD_SINGLE, 0, "host name or address");