From: Russ Allbery Date: Sat, 10 Nov 2007 02:44:57 +0000 (+0000) Subject: Import upstream 1.4.5 release (repackaged to remove non-DFSG-free files). X-Git-Tag: upstream/1.4.5.dfsg1 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=6fcfcbe004b7ac8864ffd43f793ec7df45a08e8f;p=packages%2Fo%2Fopenafs.git Import upstream 1.4.5 release (repackaged to remove non-DFSG-free files). --- diff --git a/configure b/configure index 905b80e25..e62e8d70d 100644 --- a/configure +++ b/configure @@ -2170,7 +2170,7 @@ fi # Define the identity of the package. PACKAGE=openafs - VERSION=1.4.5pre2 + VERSION=1.4.5 cat >>confdefs.h <<_ACEOF @@ -2318,7 +2318,7 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers src/config/afsconfig.h" -MACOS_VERSION=1.4.5fc2 +MACOS_VERSION=1.4.5 diff --git a/configure-libafs b/configure-libafs index 141f0003a..39092b039 100644 --- a/configure-libafs +++ b/configure-libafs @@ -2170,7 +2170,7 @@ fi # Define the identity of the package. PACKAGE=openafs-libafs - VERSION=1.4.5pre2 + VERSION=1.4.5 cat >>confdefs.h <<_ACEOF @@ -2318,7 +2318,7 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers src/config/afsconfig.h" -MACOS_VERSION=1.4.5fc2 +MACOS_VERSION=1.4.5 diff --git a/configure-libafs.in b/configure-libafs.in index 7799910bf..8c211b0ee 100644 --- a/configure-libafs.in +++ b/configure-libafs.in @@ -1,7 +1,7 @@ AC_INIT(src/libafs/Makefile.common.in) -AM_INIT_AUTOMAKE(openafs-libafs,1.4.5pre2) +AM_INIT_AUTOMAKE(openafs-libafs,1.4.5) AC_CONFIG_HEADER(src/config/afsconfig.h) -MACOS_VERSION=1.4.5fc2 +MACOS_VERSION=1.4.5 AC_SUBST(MACOS_VERSION) diff --git a/configure.in b/configure.in index 1e21ca732..350778c58 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_INIT(src/config/stds.h) -AM_INIT_AUTOMAKE(openafs,1.4.5pre2) +AM_INIT_AUTOMAKE(openafs,1.4.5) AC_CONFIG_HEADER(src/config/afsconfig.h) -MACOS_VERSION=1.4.5fc2 +MACOS_VERSION=1.4.5 AC_SUBST(MACOS_VERSION) diff --git a/doc/man-pages/man1/fs_uuid.1 b/doc/man-pages/man1/fs_uuid.1 new file mode 100644 index 000000000..f8cb093df --- /dev/null +++ b/doc/man-pages/man1/fs_uuid.1 @@ -0,0 +1,271 @@ +.rn '' }` +''' $RCSfile$$Revision$$Date$ +''' +''' $Log$ +''' +.de Sh +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp +.if t .sp .5v +.if n .sp +.. +.de Ip +.br +.ie \\n(.$>=3 .ne \\$3 +.el .ne 3 +.IP "\\$1" \\$2 +.. +.de Vb +.ft CW +.nf +.ne \\$1 +.. +.de Ve +.ft R + +.fi +.. +''' +''' +''' Set up \*(-- to give an unbreakable dash; +''' string Tr holds user defined translation string. +''' Bell System Logo is used as a dummy character. +''' +.tr \(*W-|\(bv\*(Tr +.ie n \{\ +.ds -- \(*W- +.ds PI pi +.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +.ds L" "" +.ds R" "" +''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of +''' \*(L" and \*(R", except that they are used on ".xx" lines, +''' such as .IP and .SH, which do another additional levels of +''' double-quote interpretation +.ds M" """ +.ds S" """ +.ds N" """"" +.ds T" """"" +.ds L' ' +.ds R' ' +.ds M' ' +.ds S' ' +.ds N' ' +.ds T' ' +'br\} +.el\{\ +.ds -- \(em\| +.tr \*(Tr +.ds L" `` +.ds R" '' +.ds M" `` +.ds S" '' +.ds N" `` +.ds T" '' +.ds L' ` +.ds R' ' +.ds M' ` +.ds S' ' +.ds N' ` +.ds T' ' +.ds PI \(*p +'br\} +.\" If the F register is turned on, we'll generate +.\" index entries out stderr for the following things: +.\" TH Title +.\" SH Header +.\" Sh Subsection +.\" Ip Item +.\" X<> Xref (embedded +.\" Of course, you have to process the output yourself +.\" in some meaninful fashion. +.if \nF \{ +.de IX +.tm Index:\\$1\t\\n%\t"\\$2" +.. +.nr % 0 +.rr F +.\} +.TH FS_UUID 1 "OpenAFS" "23/Oct/2007" "AFS Command Reference" +.UC +.if n .hy 0 +.if n .na +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.de CQ \" put $1 in typewriter font +.ft CW +'if n "\c +'if t \\&\\$1\c +'if n \\&\\$1\c +'if n \&" +\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7 +'.ft R +.. +.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2 +. \" AM - accent mark definitions +.bd B 3 +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds ? ? +. ds ! ! +. ds / +. ds q +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10' +. ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +. ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#] +.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u' +.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u' +.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#] +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +.ds oe o\h'-(\w'o'u*4/10)'e +.ds Oe O\h'-(\w'O'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds v \h'-1'\o'\(aa\(ga' +. ds _ \h'-1'^ +. ds . \h'-1'. +. ds 3 3 +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +. ds oe oe +. ds Oe OE +.\} +.rm #[ #] #H #V #F C +.SH "NAME" +fs uuid \- Prints the uuid of the client or generates a new one +.SH "SYNOPSIS" +\fBfs uuid\fR [\fB\-generate\fR] [\fB\-help\fR] +.SH "DESCRIPTION" +\fBfs uuid\fR prints the current uuid of an OpenAFS client. It can +optionally force the generation of a new uuid, if needed. The client +uuid is used by the \fBfileserver\fR to differentiate clients with the +same IP address. +.SH "CAUTIONS" +The \fBfs uuid\fR command is only available in OpenAFS versions after +1.4.5 and 1.5.8. The behavior differs slightly between versions. In +OpenAFS 1.4.5 and later, the \fB\-generate\fR option is required and the +uuid for the client machine is never printed. OpenAFS versions 1.5.8 +and later will print the uuid. +.SH "OPTIONS" +.Ip "\fB\-generate\fR" 4 +Generates a new uuid for the cache manager. This is useful if two +clients share the same uuid. \fB\-generate\fR is optional in OpenAFS +versions 1.5.8 and later, but it is required in OpenAFS versions 1.4.5 +and later. +.Ip "\fB\-help\fR" 4 +Prints the online help for this command. All other valid options are +ignored. +.SH "OUTPUT" +\fBfs uuid\fR prints out the current uuid for the client or the new uuid +if the \fB\-generate\fR option is passed to it. +.SH "EXAMPLES" +There are only two ways to invoke \fBfs uuid\fR under 1.5.8 and later: +.PP +.Vb 2 +\& % fs uuid +\& UUID: 8ac66f9308a8e-47d7-80f7-50d0040cddc2 +.Ve +.Vb 2 +\& % fs uuid -generate +\& New UUID: 436bd660-1720-429508e470cff38f5c6fb0 +.Ve +Here is the only way to invoke \fBfs uuid\fR under OpenAFS 1.4.5 and later: +.PP +.Vb 2 +\& % fs uuid -generate +\& New uuid generated. +.Ve +.SH "PRIVILEGE REQUIRED" +The issuer must be logged on as the local superuser \f(CWroot\fR. +.SH "SEE ALSO" +the \fIfs(1)\fR manpage +.SH "COPYRIGHT" +Copyright 2007 Jason Edgecombe +.PP +This documentation is covered by the IBM Public License Version 1.0. This +man page was written by Jason Edgecombe for OpenAFS. + +.rn }` '' +.IX Title "FS_UUID 1" +.IX Name "fs uuid - Prints the uuid of the client or generates a new one" + +.IX Header "NAME" + +.IX Header "SYNOPSIS" + +.IX Header "DESCRIPTION" + +.IX Header "CAUTIONS" + +.IX Header "OPTIONS" + +.IX Item "\fB\-generate\fR" + +.IX Item "\fB\-help\fR" + +.IX Header "OUTPUT" + +.IX Header "EXAMPLES" + +.IX Header "PRIVILEGE REQUIRED" + +.IX Header "SEE ALSO" + +.IX Header "COPYRIGHT" + diff --git a/doc/man-pages/pod1/fs_uuid.pod b/doc/man-pages/pod1/fs_uuid.pod new file mode 100644 index 000000000..244f5aa2f --- /dev/null +++ b/doc/man-pages/pod1/fs_uuid.pod @@ -0,0 +1,82 @@ +=head1 NAME + +fs uuid - Prints the uuid of the client or generates a new one + +=head1 SYNOPSIS + +=for html +
+ +B [B<-generate>] [B<-help>] + +=for html +
+ +=head1 DESCRIPTION + +B prints the current uuid of an OpenAFS client. It can +optionally force the generation of a new uuid, if needed. The client +uuid is used by the B to differentiate clients with the +same IP address. + +=head1 CAUTIONS + +The B command is only available in OpenAFS versions after +1.4.5 and 1.5.8. The behavior differs slightly between versions. In +OpenAFS 1.4.5 and later, the B<-generate> option is required and the +uuid for the client machine is never printed. OpenAFS versions 1.5.8 +and later will print the uuid. + +=head1 OPTIONS + +=over 4 + +=item B<-generate> + +Generates a new uuid for the cache manager. This is useful if two +clients share the same uuid. B<-generate> is optional in OpenAFS +versions 1.5.8 and later, but it is required in OpenAFS versions 1.4.5 +and later. + +=item B<-help> + +Prints the online help for this command. All other valid options are +ignored. + +=back + +=head1 OUTPUT + +B prints out the current uuid for the client or the new uuid +if the B<-generate> option is passed to it. + +=head1 EXAMPLES + +There are only two ways to invoke B under 1.5.8 and later: + + % fs uuid + UUID: 8ac66f9308a8e-47d7-80f7-50d0040cddc2 + + % fs uuid -generate + New UUID: 436bd660-1720-429508e470cff38f5c6fb0 + +Here is the only way to invoke B under OpenAFS 1.4.5 and later: + + % fs uuid -generate + New uuid generated. + + +=head1 PRIVILEGE REQUIRED + +The issuer must be logged on as the local superuser C. + +=head1 SEE ALSO + +L + +=head1 COPYRIGHT + +Copyright 2007 Jason Edgecombe + +This documentation is covered by the IBM Public License Version 1.0. This +man page was written by Jason Edgecombe for OpenAFS. diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c index 75580a4fd..7fad134a7 100644 --- a/src/afs/DARWIN/osi_vnodeops.c +++ b/src/afs/DARWIN/osi_vnodeops.c @@ -5,7 +5,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.18.2.24 2007/10/15 19:22:43 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.18.2.28 2007/10/24 05:45:38 shadow Exp $"); #include /* Standard vendor system headers */ #include /* Afs-based standard headers */ @@ -542,6 +542,8 @@ afs_vop_close(ap) else code = afs_close(avc, ap->a_fflag, &afs_osi_cred, vop_proc); osi_FlushPages(avc, vop_cred); /* hold bozon lock, but not basic vnode lock */ + /* This is legit; it just forces the fstrace event to happen */ + code = afs_CheckCode(code, NULL, 60); AFS_GUNLOCK(); return code; @@ -634,17 +636,22 @@ afs_vop_access(ap) /* we can't check for KAUTH_VNODE_TAKE_OWNERSHIP, so we always permit it */ code = afs_AccessOK(tvc, bits, &treq, cmb); - +#if defined(AFS_DARWIN80_ENV) + /* In a dropbox, cp on 10.4 behaves badly, looping on EACCES */ + /* In a dropbox, Finder may reopen the file. Let it. */ + if (code == 0 && ((bits &~(PRSFS_READ|PRSFS_WRITE)) == 0)) { + code = afs_AccessOK(tvc, PRSFS_ADMINISTER|PRSFS_INSERT|bits, &treq, cmb); + } +#endif if (code == 1 && vnode_vtype(ap->a_vp) == VREG && ap->a_action & KAUTH_VNODE_EXECUTE && (tvc->m.Mode & 0100) != 0100) { code = 0; - } + } if (code) { code= 0; /* if access is ok */ } else { - /* In 10.4 cp will loop forever on EACCES */ - code = afs_CheckCode(EPERM, &treq, 57); /* failure code */ + code = afs_CheckCode(EACCES, &treq, 57); /* failure code */ } out: afs_PutFakeStat(&fakestate); @@ -683,12 +690,15 @@ afs_vop_getattr(ap) AFS_GLOCK(); code = afs_getattr(VTOAFS(ap->a_vp), ap->a_vap, vop_cred); + /* This is legit; it just forces the fstrace event to happen */ + code = afs_CheckCode(code, NULL, 58); AFS_GUNLOCK(); #ifdef AFS_DARWIN80_ENV VATTR_SET_SUPPORTED(ap->a_vap, va_type); VATTR_SET_SUPPORTED(ap->a_vap, va_mode); VATTR_SET_SUPPORTED(ap->a_vap, va_uid); VATTR_SET_SUPPORTED(ap->a_vap, va_gid); + VATTR_SET_SUPPORTED(ap->a_vap, va_fsid); VATTR_SET_SUPPORTED(ap->a_vap, va_fileid); VATTR_SET_SUPPORTED(ap->a_vap, va_nlink); VATTR_SET_SUPPORTED(ap->a_vap, va_data_size); @@ -715,6 +725,8 @@ afs_vop_setattr(ap) int code; AFS_GLOCK(); code = afs_setattr(VTOAFS(ap->a_vp), ap->a_vap, vop_cred); + /* This is legit; it just forces the fstrace event to happen */ + code = afs_CheckCode(code, NULL, 59); AFS_GUNLOCK(); return code; } @@ -1191,6 +1203,7 @@ afs_vop_remove(ap) GETNAME(); AFS_GLOCK(); error = afs_remove(VTOAFS(dvp), name, vop_cn_cred); + error = afs_CheckCode(error, NULL, 61); AFS_GUNLOCK(); cache_purge(vp); if (!error) { @@ -1208,6 +1221,12 @@ afs_vop_remove(ap) /* If crashes continue in ubc_hold, comment this out */ (void)ubc_uncache(vp); #endif + } else { + /* should check for PRSFS_INSERT and not PRSFS_DELETE, but the + goal here is to deal with Finder's unhappiness with resource + forks that have no resources in a dropbox setting */ + if (name[0] == '.' && name[1] == '_' && error == EACCES) + error = 0; } #ifndef AFS_DARWIN80_ENV @@ -2061,14 +2080,14 @@ afs_darwin_getnewvnode(struct vcache *avc) Don't touch! */ int afs_darwin_finalizevnode(struct vcache *avc, struct vnode *dvp, struct componentname *cnp, int isroot) { - vnode_t ovp = AFSTOV(avc); + vnode_t ovp; vnode_t nvp; int error; struct vnode_fsparam par; AFS_GLOCK(); ObtainWriteLock(&avc->lock,325); + ovp = AFSTOV(avc); if (!(avc->states & CDeadVnode) && vnode_vtype(ovp) != VNON) { - ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); #if 0 /* unsupported */ if (dvp && cnp) @@ -2076,7 +2095,11 @@ afs_darwin_finalizevnode(struct vcache *avc, struct vnode *dvp, struct component cnp->cn_hash, VNODE_UPDATE_PARENT|VNODE_UPDATE_NAME); #endif + /* Can end up in reclaim... drop GLOCK */ vnode_rele(ovp); + AFS_GLOCK(); + ReleaseWriteLock(&avc->lock); + AFS_GUNLOCK(); return 0; } if ((avc->states & CDeadVnode) && vnode_vtype(ovp) != VNON) @@ -2098,20 +2121,24 @@ afs_darwin_finalizevnode(struct vcache *avc, struct vnode *dvp, struct component error = vnode_create(VNCREATE_FLAVOR, VCREATESIZE, &par, &nvp); if (!error) { vnode_addfsref(nvp); + if ((avc->states & CDeadVnode) && vnode_vtype(ovp) != VNON) + printf("vcache %p should not be CDeadVnode", avc); + if (avc->v == ovp) { + if (!(avc->states & CVInit)) { + vnode_clearfsnode(ovp); + vnode_removefsref(ovp); + } + } avc->v = nvp; avc->states &=~ CDeadVnode; - if (!(avc->states & CVInit)) { - vnode_clearfsnode(ovp); - vnode_removefsref(ovp); - } } + vnode_put(ovp); + vnode_rele(ovp); AFS_GLOCK(); ReleaseWriteLock(&avc->lock); if (!error) afs_osi_Wakeup(&avc->states); AFS_GUNLOCK(); - vnode_put(ovp); - vnode_rele(ovp); return error; } #endif diff --git a/src/afs/LINUX/osi_module.c b/src/afs/LINUX/osi_module.c index d25f6f616..52d2ced82 100644 --- a/src/afs/LINUX/osi_module.c +++ b/src/afs/LINUX/osi_module.c @@ -15,7 +15,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/LINUX/osi_module.c,v 1.52.2.28 2007/08/22 02:19:28 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/LINUX/osi_module.c,v 1.52.2.29 2007/10/24 18:09:50 shadow Exp $"); #include /* early to avoid printf->printk mapping */ #include "afs/sysincludes.h" @@ -379,9 +379,7 @@ init_module(void) err = register_filesystem(&afs_fs_type); if (err) { afs_destroy_inodecache(); -#ifndef LINUX_KEYRING_SUPPORT osi_syscall_clean(); -#endif return err; } @@ -408,9 +406,7 @@ cleanup_module(void) osi_keyring_shutdown(); #endif osi_sysctl_clean(); -#ifndef LINUX_KEYRING_SUPPORT osi_syscall_clean(); -#endif unregister_filesystem(&afs_fs_type); afs_destroy_inodecache(); diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index 5f8053f48..e1c11a99f 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -18,7 +18,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.50.2.18 2006/02/18 04:09:36 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.50.2.19 2007/10/16 22:03:46 shadow Exp $"); #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ @@ -497,7 +497,7 @@ Next_AtSys(register struct vcache *avc, struct vrequest *areq, au = afs_GetUser(areq->uid, avc->fid.Cell, 0); if (au->exporter) { error = - EXP_SYSNAME(au->exporter, (char *)0, sysnamelist, num); + EXP_SYSNAME(au->exporter, (char *)0, sysnamelist, &num); if (error) { return 0; } diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index d9ead8b15..70a764c7a 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -11,7 +11,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/afs_call.c,v 1.74.2.23 2007/10/10 16:57:54 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/afs_call.c,v 1.74.2.25 2007/10/17 03:51:44 shadow Exp $"); #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ @@ -508,11 +508,12 @@ afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5, static void wait_for_cachedefs(void) { #ifdef AFS_CACHE_VNODE_PATH - while ((afs_numcachefiles < 1) || (afs_numfilesperdir < 1) || - (afs_cachebasedir[0] != '/')) { - printf("afs: waiting for cache parameter definitions\n"); - afs_osi_Sleep(&afs_initState); - } + if (cacheDiskType != AFS_FCACHE_TYPE_MEM) + while ((afs_numcachefiles < 1) || (afs_numfilesperdir < 1) || + (afs_cachebasedir[0] != '/')) { + printf("afs: waiting for cache parameter definitions\n"); + afs_osi_Sleep(&afs_initState); + } #endif } @@ -894,22 +895,24 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6) osi_FreeSmallSpace(tbuffer); } else if (parm == AFSOP_GO) { #ifdef AFS_CACHE_VNODE_PATH - afs_int32 dummy; - - wait_for_cachedefs(); - + if (cacheDiskType != AFS_FCACHE_TYPE_MEM) { + afs_int32 dummy; + + wait_for_cachedefs(); + #ifdef AFS_DARWIN80_ENV - get_vfs_context(); -#endif - if ((afs_numcachefiles > 0) && (afs_numfilesperdir > 0) && - (afs_cachebasedir[0] == '/')) { - for (dummy = 0; dummy < afs_numcachefiles; dummy++) { - code = afs_InitCacheFile(NULL, dummy); - } - } + get_vfs_context(); +#endif + if ((afs_numcachefiles > 0) && (afs_numfilesperdir > 0) && + (afs_cachebasedir[0] == '/')) { + for (dummy = 0; dummy < afs_numcachefiles; dummy++) { + code = afs_InitCacheFile(NULL, dummy); + } + } #ifdef AFS_DARWIN80_ENV - put_vfs_context(); + put_vfs_context(); #endif + } #endif /* the generic initialization calls come here. One parameter: should we do the * set-time operation on this workstation */ diff --git a/src/afs/afs_daemons.c b/src/afs/afs_daemons.c index 81e3db070..1cc6c11ad 100644 --- a/src/afs/afs_daemons.c +++ b/src/afs/afs_daemons.c @@ -11,7 +11,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/afs_daemons.c,v 1.28.2.13 2006/02/13 18:31:13 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/afs_daemons.c,v 1.28.2.14 2007/10/23 00:03:01 shadow Exp $"); #ifdef AFS_AIX51_ENV #define __FULL_PROTO @@ -49,7 +49,7 @@ afs_int32 afs_CheckServerDaemonStarted = 0; #ifdef DEFAULT_PROBE_INTERVAL afs_int32 PROBE_INTERVAL = DEFAULT_PROBE_INTERVAL; /* overridding during compile */ #else -afs_int32 PROBE_INTERVAL = 180; /* default to 3 min */ +afs_int32 PROBE_INTERVAL = 30; /* default to 3 min */ #endif #define PROBE_WAIT() (1000 * (PROBE_INTERVAL - ((afs_random() & 0x7fffffff) \ diff --git a/src/afs/afs_nfsclnt.c b/src/afs/afs_nfsclnt.c index 203c27361..071f0b5b3 100644 --- a/src/afs/afs_nfsclnt.c +++ b/src/afs/afs_nfsclnt.c @@ -11,7 +11,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/afs_nfsclnt.c,v 1.12.2.3 2007/03/20 19:24:11 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/afs_nfsclnt.c,v 1.12.2.4 2007/10/16 22:03:45 shadow Exp $"); #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV) #include "afs/sysincludes.h" /* Standard vendor system headers */ @@ -331,6 +331,8 @@ afs_nfsclient_sysname(register struct nfsclientpag *np, char *inname, } *outname = np->sysname; *num = np->sysnamecount; + if (!np->sysname[0]) + return ENODEV; /* XXX */ return 0; } diff --git a/src/afs/afs_osidnlc.c b/src/afs/afs_osidnlc.c index 05361c615..5caf6549f 100644 --- a/src/afs/afs_osidnlc.c +++ b/src/afs/afs_osidnlc.c @@ -11,7 +11,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/afs_osidnlc.c,v 1.8.2.5 2006/02/18 04:09:33 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/afs_osidnlc.c,v 1.8.2.6 2007/10/19 20:40:52 shadow Exp $"); #include "afs/sysincludes.h" /*Standard vendor system headers */ #include "afsincludes.h" /*AFS-based standard headers */ @@ -242,7 +242,12 @@ osi_dnlc_lookup(struct vcache *adp, char *aname, int locktype) ReleaseReadLock(&afs_xvcache); dnlcstats.misses++; } else { - if (tvc->states & CVInit) { + if ((tvc->states & CVInit) +#ifdef AFS_DARWIN80_ENV + ||(tvc->states & CDeadVnode) +#endif + ) + { ReleaseReadLock(&afs_xvcache); dnlcstats.misses++; osi_dnlc_remove(adp, aname, tvc); diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index 7c5e5e269..6ff46c3fc 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -58,7 +58,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/afsd/afsd.c,v 1.43.2.22 2007/10/10 16:57:56 shadow Exp $"); + ("$Header: /cvs/openafs/src/afsd/afsd.c,v 1.43.2.23 2007/10/23 14:31:29 shadow Exp $"); #define VFS 1 @@ -428,7 +428,7 @@ afsd_event_cleanup(int signo) { CFRunLoopRemoveSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode); CFRelease (source); - IODeregisterForSystemPower(iterator); + IODeregisterForSystemPower(&iterator); IOServiceClose(root_port); IONotificationPortDestroy(notify); diff --git a/src/bucoord/restore.c b/src/bucoord/restore.c index 0835edaec..7486cbd81 100644 --- a/src/bucoord/restore.c +++ b/src/bucoord/restore.c @@ -15,7 +15,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/bucoord/restore.c,v 1.8.2.7 2007/06/26 05:44:57 jaltman Exp $"); + ("$Header: /cvs/openafs/src/bucoord/restore.c,v 1.8.2.8 2007/10/16 16:56:48 jaltman Exp $"); #include #include @@ -224,7 +224,7 @@ bc_Restorer(aindex) code = bcdb_FindDumpByID(dumpTaskPtr->parentDumpID, dumpDescr); if (code) { - afs_com_err(whoami, "Couldn't look up info for dump %d\n", + afs_com_err(whoami, code, "Couldn't look up info for dump %d\n", dumpTaskPtr->parentDumpID); continue; } diff --git a/src/packaging/RedHat/openafs-buildall.sh b/src/packaging/RedHat/openafs-buildall.sh index 788cb2a31..40108b539 100755 --- a/src/packaging/RedHat/openafs-buildall.sh +++ b/src/packaging/RedHat/openafs-buildall.sh @@ -4,7 +4,7 @@ # # Written by: Derek Atkins # -# $Revision: 1.1.2.2 $ +# $Revision: 1.1.2.3 $ # # Define where the Specfile is located. @@ -21,10 +21,17 @@ buildopts= if [ `echo $rhrel | grep -c 'Fedora Core'` = 1 ] ; then ostype='fc' osrel=`echo $rhrel | sed -e 's/^.*release \([^ ]*\).*$/\1/' -e 's/\.//g'` +elif [ `echo $rhrel | grep -c 'Fedora'` = 1 ] ; then + ostype='fc' + osrel=`echo $rhrel | sed -e 's/^.*release \([^ ]*\).*$/\1/' -e 's/\.//g'` elif [ `echo $rhrel | grep -c 'Red Hat Enterprise Linux'` = 1 ] ; then ostype='rhel' excludearch=i586 osrel=`echo $rhrel | sed -e 's/^.*release \([^ ]*\).*$/\1/' -e 's/\.//g'` +elif [ `echo $rhrel | grep -c 'CentOS'` = 1 ] ; then + ostype='rhel' + excludearch=i586 + osrel=`echo $rhrel | sed -e 's/^.*release \([^ ]*\).*$/\1/' -e 's/\.//g'` elif [ `echo $rhrel | grep -c 'Red Hat Linux'` = 1 ] ; then ostype='rh' osrel=`echo $rhrel | sed -e 's/^.*release \([^ ]*\).*$/\1/' -e 's/\.//g'` diff --git a/src/packaging/RedHat/openafs.spec.in b/src/packaging/RedHat/openafs.spec.in index f7c626315..99ae034fb 100644 --- a/src/packaging/RedHat/openafs.spec.in +++ b/src/packaging/RedHat/openafs.spec.in @@ -1,4 +1,4 @@ -# Openafs Spec $Revision: 1.1.2.4 $ +# Openafs Spec $Revision: 1.1.2.6 $ %define afsvers 1.4.5pre1 %define pkgvers 1.4.5pre1 @@ -229,7 +229,7 @@ URL: http://www.openafs.org BuildRoot: %{_tmppath}/%{name}-%{version}-root Packager: Derek Atkins Group: Networking/Filesystems -BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel +BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison %if %{build_userspace} BuildRequires: autoconf %endif @@ -244,6 +244,7 @@ Source10: http://www.openafs.org/dl/openafs/%{afsvers}/RELNOTES-%{afsvers} Source11: http://www.openafs.org/dl/openafs/%{afsvers}/ChangeLog Source30: openafs-kernel-version.sh +Source998: openafs-buildall.sh Source999: kmodtool Patch0: openafs-1.4.0-kmodule26.patch diff --git a/src/venus/fs.c b/src/venus/fs.c index 9eac9dad5..a5c5dd89a 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -11,7 +11,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/venus/fs.c,v 1.24.2.7 2007/06/12 19:20:21 shadow Exp $"); + ("$Header: /cvs/openafs/src/venus/fs.c,v 1.24.2.8 2007/10/16 17:20:09 jaltman Exp $"); #include #include @@ -69,7 +69,7 @@ static char tspace[1024]; static struct ubik_client *uclient; static int GetClientAddrsCmd(), SetClientAddrsCmd(), FlushMountCmd(); -static int RxStatProcCmd(), RxStatPeerCmd(), GetFidCmd(), NewUuidCmd(); +static int RxStatProcCmd(), RxStatPeerCmd(), GetFidCmd(), UuidCmd(); extern char *hostutil_GetNameByINet(); extern struct hostent *hostutil_GetHostByName(); @@ -1244,21 +1244,40 @@ FlushVolumeCmd(struct cmd_syndesc *as, char *arock) return error; } +/* + * The Windows version of UuidCmd displays the UUID. + * When the UNIX version is updated to do the same + * be sure to replace the CMD_REQUIRED flag with + * CMD_OPTIONAL in the cmd_AddParam(-generate) call + */ static int -NewUuidCmd(struct cmd_syndesc *as, char *arock) +UuidCmd(struct cmd_syndesc *as, char *arock) { afs_int32 code; struct ViceIoctl blob; blob.in_size = 0; blob.out_size = 0; - code = pioctl(0, VIOC_NEWUUID, &blob, 1); - if (code) { - Die(errno, 0); - return 1; - } + + if (as->parms[0].items) { + if (geteuid()) { + fprintf (stderr, "Permission denied: requires root access.\n"); + return EACCES; + } + + /* generate new UUID */ + code = pioctl(0, VIOC_NEWUUID, &blob, 1); - printf("New uuid generated.\n"); + if (code) { + Die(errno, 0); + return 1; + } + + printf("New uuid generated.\n"); + } else { + /* This will never execute */ + printf("Please add the '-generate' option to generate a new UUID.\n"); + } return 0; } @@ -3460,8 +3479,8 @@ defect 3069 "get fid for file(s)"); cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path"); - ts = cmd_CreateSyntax("newuuid", NewUuidCmd, 0, - "force a new uuid"); + ts = cmd_CreateSyntax("uuid", UuidCmd, 0, "manage the UUID for the cache manager"); + cmd_AddParm(ts, "-generate", CMD_FLAG, CMD_REQUIRED, "generate a new UUID"); code = cmd_Dispatch(argc, argv); if (rxInitDone) diff --git a/src/viced/callback.c b/src/viced/callback.c index 327c17cb6..66f674e22 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -83,7 +83,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/viced/callback.c,v 1.55.2.17 2007/08/21 08:28:37 jaltman Exp $"); + ("$Header: /cvs/openafs/src/viced/callback.c,v 1.55.2.18 2007/10/24 15:37:32 shadow Exp $"); #include #include /* for malloc() */ @@ -1181,7 +1181,7 @@ BreakDelayedCallBacks_r(struct host *host) cbstuff.nbreakers--; /* If we succeeded it's always ok to unset HFE_LATER */ - if (!host->hostFlags & VENUSDOWN) + if (!(host->hostFlags & VENUSDOWN)) host->hostFlags &= ~HFE_LATER; return (host->hostFlags & VENUSDOWN); } diff --git a/src/volser/vos.c b/src/volser/vos.c index 4b5629983..47a8e137f 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -11,7 +11,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/volser/vos.c,v 1.40.2.19 2007/07/19 18:52:40 shadow Exp $"); + ("$Header: /cvs/openafs/src/volser/vos.c,v 1.40.2.20 2007/10/23 14:22:27 shadow Exp $"); #include #ifdef AFS_NT40_ENV @@ -342,21 +342,21 @@ WriteData(struct rx_call *call, char *rock) error = VOLSERBADOP; goto wfail; } + /* test if we have a valid dump */ + hset64(filesize, 0, 0); + USD_SEEK(ufd, filesize, SEEK_END, &currOffset); + hset64(filesize, hgethi(currOffset), hgetlo(currOffset)-sizeof(afs_uint32)); + USD_SEEK(ufd, filesize, SEEK_SET, &currOffset); + USD_READ(ufd, &buffer, sizeof(afs_uint32), &got); + if ((got != sizeof(afs_uint32)) || (ntohl(buffer) != DUMPENDMAGIC)) { + fprintf(STDERR, "Signature missing from end of file '%s'\n", filename); + error = VOLSERBADOP; + goto wfail; + } + /* rewind, we are done */ + hset64(filesize, 0, 0); + USD_SEEK(ufd, filesize, SEEK_SET, &currOffset); } - /* test if we have a valid dump */ - hset64(filesize, 0, 0); - USD_SEEK(ufd, filesize, SEEK_END, &currOffset); - hset64(filesize, hgethi(currOffset), hgetlo(currOffset)-sizeof(afs_uint32)); - USD_SEEK(ufd, filesize, SEEK_SET, &currOffset); - USD_READ(ufd, &buffer, sizeof(afs_uint32), &got); - if ((got != sizeof(afs_uint32)) || (ntohl(buffer) != DUMPENDMAGIC)) { - fprintf(STDERR, "Signature missing from end of file '%s'\n", filename); - error = VOLSERBADOP; - goto wfail; - } - hset64(filesize, 0, 0); - USD_SEEK(ufd, filesize, SEEK_SET, &currOffset); - /* rewind, we are done */ code = SendFile(ufd, call, blksize); if (code) { error = code;