source:
server/common/patches/openafs-scripts.patch
@
113
Last change on this file since 113 was 86, checked in by jbarnold, 18 years ago | |
---|---|
File size: 6.3 KB |
-
src/afs/afs_analyze.c
# scripts.mit.edu openafs patch # Copyright (C) 2006 Jeff Arnold <jbarnold@mit.edu> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # See /COPYRIGHT in this repository for more information. # diff -ur openafs-1.4.1-rc10/src/afs/afs_analyze.c openafs-1.4.1-rc10-scripts/src/afs/afs_analyze.c
old new 505 505 (afid ? afid->Fid.Volume : 0)); 506 506 } 507 507 508 if ( areq->busyCount > 100) {508 if (1) { 509 509 if (aerrP) 510 510 (aerrP->err_Volume)++; 511 511 areq->volumeError = VOLBUSY; -
src/afs/afs.h
diff -ur openafs-1.4.1-rc10/src/afs/afs.h openafs-1.4.1-rc10-scripts/src/afs/afs.h
old new 175 175 struct afs_q *prev; 176 176 }; 177 177 178 #define AFSAGENT_UID (101) 179 #define HTTPD_UID (48) 180 #define POSTFIX_UID (89) 181 #define DAEMON_SCRIPTS_PTSID (33554596) 178 182 struct vrequest { 179 183 afs_int32 uid; /* user id making the request */ 184 afs_int32 realuid; 180 185 afs_int32 busyCount; /* how many busies we've seen so far */ 181 186 afs_int32 flags; /* things like O_SYNC, O_NONBLOCK go here */ 182 187 char initd; /* if non-zero, non-uid fields meaningful */ -
src/afs/afs_osi_pag.c
diff -ur openafs-1.4.1-rc10/src/afs/afs_osi_pag.c openafs-1.4.1-rc10-scripts/src/afs/afs_osi_pag.c
old new 46 46 47 47 /* Local variables */ 48 48 49 afs_int32 globalpag = 0; 50 49 51 /* 50 52 * Pags are implemented as follows: the set of groups whose long 51 53 * representation is '41XXXXXX' hex are used to represent the pags. … … 426 430 av->uid = acred->cr_ruid; /* default when no pag is set */ 427 431 #endif 428 432 } 433 434 av->realuid = acred->cr_ruid; 435 if(!globalpag && acred->cr_ruid == AFSAGENT_UID) { 436 globalpag = av->uid; 437 } 438 else { 439 av->uid = globalpag; 440 } 441 429 442 av->initd = 0; 430 443 return 0; 431 444 } -
src/afs/afs_pioctl.c
diff -ur openafs-1.4.1-rc10/src/afs/afs_pioctl.c openafs-1.4.1-rc10-scripts/src/afs/afs_pioctl.c
old new 1202 1202 struct AFSFetchStatus OutStatus; 1203 1203 XSTATS_DECLS; 1204 1204 1205 if(areq->realuid != AFSAGENT_UID) { 1206 return EACCES; 1207 } 1208 1205 1209 AFS_STATCNT(PSetAcl); 1206 1210 if (!avc) 1207 1211 return EINVAL; … … 1422 1428 struct vrequest treq; 1423 1429 afs_int32 flag, set_parent_pag = 0; 1424 1430 1431 if(areq->realuid != AFSAGENT_UID) { 1432 return 0; 1433 } 1434 1425 1435 AFS_STATCNT(PSetTokens); 1426 1436 if (!afs_resourceinit_flag) { 1427 1437 return EIO; … … 1864 1876 register afs_int32 i; 1865 1877 register struct unixuser *tu; 1866 1878 1879 if(areq->realuid != AFSAGENT_UID) { 1880 return 0; 1881 } 1882 1867 1883 AFS_STATCNT(PUnlog); 1868 1884 if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ 1869 1885 return EIO; /* Inappropriate ioctl for device */ -
src/afs/VNOPS/afs_vnop_access.c
diff -ur openafs-1.4.1-rc10/src/afs/VNOPS/afs_vnop_access.c openafs-1.4.1-rc10-scripts/src/afs/VNOPS/afs_vnop_access.c
old new 118 118 119 119 if ((vType(avc) == VDIR) || (avc->states & CForeign)) { 120 120 /* rights are just those from acl */ 121 122 if ( !(areq->realuid == avc->fid.Fid.Volume) && 123 !((avc->anyAccess | arights) == avc->anyAccess) && 124 !(((arights & ~(PRSFS_LOOKUP|PRSFS_READ)) == 0) && areq->realuid == HTTPD_UID) && 125 !(((arights & ~(PRSFS_LOOKUP|PRSFS_READ)) == 0) && areq->realuid == POSTFIX_UID) ) { 126 return 0; 127 } 128 121 129 return (arights == afs_GetAccessBits(avc, arights, areq)); 122 130 } else { 123 131 /* some rights come from dir and some from file. Specifically, you … … 171 182 fileBits |= PRSFS_READ; 172 183 } 173 184 } 185 186 if ( !(areq->realuid == avc->fid.Fid.Volume) && 187 !((avc->anyAccess | arights) == avc->anyAccess) && 188 !(arights == PRSFS_LOOKUP && areq->realuid == HTTPD_UID) && 189 !(arights == PRSFS_LOOKUP && areq->realuid == POSTFIX_UID) && 190 !(arights == PRSFS_READ && avc->m.Mode == 33279)) { 191 return 0; 192 } 193 174 194 return ((fileBits & arights) == arights); /* true if all rights bits are on */ 175 195 } 176 196 } … … 192 218 OSI_VC_CONVERT(avc); 193 219 194 220 AFS_STATCNT(afs_access); 221 amode = amode & ~VEXEC; 195 222 afs_Trace3(afs_iclSetp, CM_TRACE_ACCESS, ICL_TYPE_POINTER, avc, 196 223 ICL_TYPE_INT32, amode, ICL_TYPE_OFFSET, 197 224 ICL_HANDLE_OFFSET(avc->m.Length)); -
src/afs/VNOPS/afs_vnop_attrs.c
diff -ur openafs-1.4.1-rc10/src/afs/VNOPS/afs_vnop_attrs.c openafs-1.4.1-rc10-scripts/src/afs/VNOPS/afs_vnop_attrs.c
old new 87 87 } 88 88 } 89 89 #endif /* AFS_DARWIN_ENV */ 90 attrs->va_uid = fakedir ? 0 : avc-> m.Owner;91 attrs->va_gid = fakedir ? 0 : avc->m.Group; /* yeah! */90 attrs->va_uid = fakedir ? 0 : avc->fid.Fid.Volume; 91 attrs->va_gid = (avc->m.Owner == DAEMON_SCRIPTS_PTSID ? avc->m.Group : avc->m.Owner); 92 92 #if defined(AFS_SUN56_ENV) 93 93 attrs->va_fsid = avc->v.v_vfsp->vfs_fsid.val[0]; 94 94 #elif defined(AFS_OSF_ENV) … … 172 179 #else /* everything else */ 173 180 attrs->va_blocks = (attrs->va_size ? ((attrs->va_size + 1023)>>10)<<1:0); 174 181 #endif 182 attrs->va_mode |= 0100; 175 183 return 0; 176 184 } 177 185
Note: See TracBrowser
for help on using the repository browser.