45
45
# See /COPYRIGHT in this repository for more information.
46
46
#
47
47
diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
48
- index 91c09ed..86e2f26 100644
48
+ index 8d6946f8f..48325b5d0 100644
49
49
--- a/src/afs/LINUX/osi_vnodeops.c
50
50
+++ b/src/afs/LINUX/osi_vnodeops.c
51
- @@ -1296 ,6 +1296 ,28 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags)
51
+ @@ -1426 ,6 +1426 ,28 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags)
52
52
/* should we always update the attributes at this point? */
53
53
/* unlikely--the vcache entry hasn't changed */
54
54
@@ -75,13 +75,13 @@ index 91c09ed..86e2f26 100644
75
75
+ vcp->apache_access = strncmp(dp->d_name.name, ".ht", 3) == 0;
76
76
+
77
77
dput(parent);
78
+
78
79
} else {
79
- #ifdef notyet
80
80
diff --git a/src/afs/VNOPS/afs_vnop_access.c b/src/afs/VNOPS/afs_vnop_access.c
81
- index 0087073..df3e4ef 100644
81
+ index 8dd885b35..a538427bd 100644
82
82
--- a/src/afs/VNOPS/afs_vnop_access.c
83
83
+++ b/src/afs/VNOPS/afs_vnop_access.c
84
- @@ -130 ,6 +130 ,16 @@ afs_AccessOK(struct vcache *avc, afs_int32 arights, struct vrequest *areq,
84
+ @@ -129 ,6 +129 ,16 @@ afs_AccessOK(struct vcache *avc, afs_int32 arights, struct vrequest *areq,
85
85
dirBits = PRSFS_LOOKUP | PRSFS_READ;
86
86
return (arights == (dirBits & arights));
87
87
}
@@ -98,7 +98,7 @@ index 0087073..df3e4ef 100644
98
98
return (arights == afs_GetAccessBits(avc, arights, areq));
99
99
} else {
100
100
/* some rights come from dir and some from file. Specifically, you
101
- @@ -183 ,6 +192,20 @@ afs_AccessOK(struct vcache *avc, afs_int32 arights, struct vrequest *areq,
101
+ @@ -182 ,6 +192,20 @@ afs_AccessOK(struct vcache *avc, afs_int32 arights, struct vrequest *areq,
102
102
fileBits |= PRSFS_READ;
103
103
}
104
104
}
@@ -120,7 +120,7 @@ index 0087073..df3e4ef 100644
120
120
}
121
121
}
122
122
diff --git a/src/afs/VNOPS/afs_vnop_attrs.c b/src/afs/VNOPS/afs_vnop_attrs.c
123
- index 2eb228f..d5d6e4a 100644
123
+ index 7166bf3c3..6df9d644a 100644
124
124
--- a/src/afs/VNOPS/afs_vnop_attrs.c
125
125
+++ b/src/afs/VNOPS/afs_vnop_attrs.c
126
126
@@ -90,8 +90,8 @@ afs_CopyOutAttrs(struct vcache *avc, struct vattr *attrs)
@@ -132,13 +132,13 @@ index 2eb228f..d5d6e4a 100644
132
132
+ attrs->va_uid = fakedir ? 0 : avc->f.fid.Fid.Volume;
133
133
+ attrs->va_gid = (avc->f.m.Owner == DAEMON_SCRIPTS_PTSID ? avc->f.m.Group : avc->f.m.Owner);
134
134
#if defined(AFS_SUN5_ENV)
135
- attrs->va_fsid = avc->v. v_vfsp->vfs_fsid.val[0];
135
+ attrs->va_fsid = AFSTOV( avc)-> v_vfsp->vfs_fsid.val[0];
136
136
#elif defined(AFS_DARWIN80_ENV)
137
137
diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c
138
- index d8205b6..5010486 100644
138
+ index dd585e97a..f2785eb28 100644
139
139
--- a/src/afs/VNOPS/afs_vnop_lookup.c
140
140
+++ b/src/afs/VNOPS/afs_vnop_lookup.c
141
- @@ -1915 ,6 +1915 ,12 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr
141
+ @@ -1947 ,6 +1947 ,12 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr
142
142
}
143
143
144
144
done:
@@ -152,10 +152,10 @@ index d8205b6..5010486 100644
152
152
if (tname != aname && tname)
153
153
osi_FreeLargeSpace(tname);
154
154
diff --git a/src/afs/afs.h b/src/afs/afs.h
155
- index 0dbc11b..ab6c0d9 100644
155
+ index 407eb8902..c8a9a35bd 100644
156
156
--- a/src/afs/afs.h
157
157
+++ b/src/afs/afs.h
158
- @@ -237 ,8 +237 ,16 @@ struct afs_slotlist {
158
+ @@ -254 ,8 +254 ,16 @@ struct afs_slotlist {
159
159
struct afs_slotlist *next;
160
160
};
161
161
@@ -172,7 +172,7 @@ index 0dbc11b..ab6c0d9 100644
172
172
afs_int32 busyCount; /* how many busies we've seen so far */
173
173
afs_int32 flags; /* things like O_SYNC, O_NONBLOCK go here */
174
174
char initd; /* if non-zero, Error fields meaningful */
175
- @@ -902 ,6 +910 ,7 @@ struct vcache {
175
+ @@ -984 ,6 +992 ,7 @@ struct vcache {
176
176
spinlock_t pagewriter_lock;
177
177
struct list_head pagewriters; /* threads that are writing vm pages */
178
178
#endif
@@ -181,10 +181,10 @@ index 0dbc11b..ab6c0d9 100644
181
181
182
182
#ifdef AFS_LINUX26_ENV
183
183
diff --git a/src/afs/afs_analyze.c b/src/afs/afs_analyze.c
184
- index dea580b..6021cc2 100644
184
+ index 4bb212ba6..e24994ed0 100644
185
185
--- a/src/afs/afs_analyze.c
186
186
+++ b/src/afs/afs_analyze.c
187
- @@ -482 ,7 +482 ,7 @@ afs_Analyze(struct afs_conn *aconn, struct rx_connection *rxconn,
187
+ @@ -473 ,7 +473 ,7 @@ afs_Analyze(struct afs_conn *aconn, struct rx_connection *rxconn,
188
188
(afid ? afid->Fid.Volume : 0));
189
189
}
190
190
@@ -194,19 +194,19 @@ index dea580b..6021cc2 100644
194
194
(aerrP->err_Volume)++;
195
195
areq->volumeError = VOLBUSY;
196
196
diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c
197
- index afbb1cf..43ffdfd 100644
197
+ index c0667d9e1..d2e736e75 100644
198
198
--- a/src/afs/afs_osi_pag.c
199
199
+++ b/src/afs/afs_osi_pag.c
200
- @@ -49 ,6 +49 ,8 @@ afs_uint32 pagCounter = 0 ;
201
- #endif
202
- /* Local variables */
200
+ @@ -42 ,6 +42 ,8 @@ afs_uint32 pagCounter = 1 ;
201
+ afs_uint32 pagCounter = 0;
202
+ #endif /* UKERNEL */
203
203
204
204
+ afs_int32 globalpag = 0;
205
205
+
206
206
/*
207
207
* Pags are implemented as follows: the set of groups whose long
208
208
* representation is '41XXXXXX' hex are used to represent the pags.
209
- @@ -484 ,6 +486 ,15 @@ afs_InitReq(struct vrequest *av, afs_ucred_t *acred)
209
+ @@ -485 ,6 +487 ,15 @@ afs_InitReq(struct vrequest *av, afs_ucred_t *acred)
210
210
av->uid = afs_cr_ruid(acred); /* default when no pag is set */
211
211
#endif
212
212
}
@@ -223,10 +223,10 @@ index afbb1cf..43ffdfd 100644
223
223
}
224
224
225
225
diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c
226
- index e9a84e3..047b3b5 100644
226
+ index 263487967..cd55bc800 100644
227
227
--- a/src/afs/afs_pioctl.c
228
228
+++ b/src/afs/afs_pioctl.c
229
- @@ -1422 ,6 +1422 ,10 @@ DECL_PIOCTL(PSetAcl)
229
+ @@ -1449 ,6 +1449 ,10 @@ DECL_PIOCTL(PSetAcl)
230
230
struct rx_connection *rxconn;
231
231
XSTATS_DECLS;
232
232
@@ -237,9 +237,9 @@ index e9a84e3..047b3b5 100644
237
237
AFS_STATCNT(PSetAcl);
238
238
if (!avc)
239
239
return EINVAL;
240
- @@ -1809,6 +1813,10 @@ DECL_PIOCTL(PSetTokens)
240
+ @@ -1898,6 +1902,10 @@ DECL_PIOCTL(PSetTokens)
241
+ struct vrequest *treq = NULL;
241
242
afs_int32 flag, set_parent_pag = 0;
242
- int code;
243
243
244
244
+ if (areq->uid == globalpag && areq->realuid != AFSAGENT_UID) {
245
245
+ return EACCES;
@@ -248,8 +248,8 @@ index e9a84e3..047b3b5 100644
248
248
AFS_STATCNT(PSetTokens);
249
249
if (!afs_resourceinit_flag) {
250
250
return EIO;
251
- @@ -2273 ,6 +2281 ,11 @@ DECL_PIOCTL(PGetTokens)
252
- int newStyle ;
251
+ @@ -2349 ,6 +2357 ,11 @@ DECL_PIOCTL(PGetTokens)
252
+ int cellNum ;
253
253
int code = E2BIG;
254
254
255
255
+ if (areq->uid == globalpag && areq->realuid != AFSAGENT_UID &&
@@ -260,7 +260,7 @@ index e9a84e3..047b3b5 100644
260
260
AFS_STATCNT(PGetTokens);
261
261
if (!afs_resourceinit_flag) /* afs daemons haven't started yet */
262
262
return EIO; /* Inappropriate ioctl for device */
263
- @@ -2383 ,6 +2396 ,10 @@ DECL_PIOCTL(PUnlog)
263
+ @@ -2454 ,6 +2467 ,10 @@ DECL_PIOCTL(PUnlog)
264
264
afs_int32 i;
265
265
struct unixuser *tu;
266
266
@@ -271,3 +271,26 @@ index e9a84e3..047b3b5 100644
271
271
AFS_STATCNT(PUnlog);
272
272
if (!afs_resourceinit_flag) /* afs daemons haven't started yet */
273
273
return EIO; /* Inappropriate ioctl for device */
274
+ @@ -5355,6 +5372,10 @@ DECL_PIOCTL(PSetTokens2)
275
+ struct ktc_setTokenData tokenSet;
276
+ struct ktc_tokenUnion decodedToken;
277
+
278
+ + if (areq->uid == globalpag && areq->realuid != AFSAGENT_UID) {
279
+ + return EACCES;
280
+ + }
281
+ +
282
+ memset(&tokenSet, 0, sizeof(tokenSet));
283
+
284
+ AFS_STATCNT(PSetTokens2);
285
+ @@ -5485,6 +5506,11 @@ DECL_PIOCTL(PGetTokens2)
286
+ XDR xdrs;
287
+ struct ktc_setTokenData tokenSet;
288
+
289
+ + if (areq->uid == globalpag && areq->realuid != AFSAGENT_UID &&
290
+ + areq->realuid != 0 && areq->realuid != SIGNUP_UID) {
291
+ + return EDOM;
292
+ + }
293
+ +
294
+ AFS_STATCNT(PGetTokens);
295
+ if (!afs_resourceinit_flag)
296
+ return EIO;
0 commit comments