]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE12-macos103-20031024 openafs-stable-1_2_10a
authorEd Moy <emoy@apple.com>
Fri, 24 Oct 2003 07:24:00 +0000 (07:24 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 24 Oct 2003 07:24:00 +0000 (07:24 +0000)
FIXES 2325

support for macos 10.3 for 1.2.10

(cherry picked from commit e2e93aa8920c0b1bfc672a555a59eb4e15dbeaae)

60 files changed:
Makefile.in
src/afs/DARWIN/osi_vfsops.c
src/afs/DARWIN/osi_vnodeops.c
src/afs/Makefile.in
src/afs/VNOPS/afs_vnop_attrs.c
src/afs/sysctl.h [new file with mode: 0644]
src/afsd/Makefile.in
src/afsd/afs.rc.darwin
src/afsd/afs.rc.darwin.plist
src/afsmonitor/afsmonitor.c
src/butc/Makefile.in
src/config/Makefile.ppc_darwin_70.in [new file with mode: 0644]
src/config/afs_sysnames.h
src/config/param.ppc_darwin_70.h [new file with mode: 0644]
src/config/param.ppc_darwin_70_usr.h [new file with mode: 0644]
src/libadmin/samples/cm_client_config.c
src/libadmin/samples/cm_list_cells.c
src/libadmin/samples/cm_local_cell.c
src/libadmin/samples/cm_server_prefs.c
src/libadmin/samples/rxdebug_basic_stats.c
src/libadmin/samples/rxdebug_conns.c
src/libadmin/samples/rxdebug_peers.c
src/libadmin/samples/rxdebug_rx_stats.c
src/libadmin/samples/rxdebug_supported_stats.c
src/libadmin/samples/rxdebug_version.c
src/libadmin/samples/rxstat_clear_peer.c
src/libadmin/samples/rxstat_clear_process.c
src/libadmin/samples/rxstat_disable_peer.c
src/libadmin/samples/rxstat_disable_process.c
src/libadmin/samples/rxstat_enable_peer.c
src/libadmin/samples/rxstat_enable_process.c
src/libadmin/samples/rxstat_get_peer.c
src/libadmin/samples/rxstat_get_process.c
src/libadmin/samples/rxstat_get_version.c
src/libadmin/samples/rxstat_query_peer.c
src/libadmin/samples/rxstat_query_process.c
src/libadmin/test/afscp.c
src/libafs/MakefileProto.DARWIN.in
src/libafs/afs.ppc_darwin_70.plist.in [new file with mode: 0644]
src/libafsrpc/Makefile.in
src/lwp/Makefile.in
src/packaging/MacOS/Makefile [new file with mode: 0644]
src/packaging/MacOS/OpenAFS.Description.plist [new file with mode: 0644]
src/packaging/MacOS/OpenAFS.Info.plist [new file with mode: 0644]
src/packaging/MacOS/OpenAFS.post_install
src/packaging/MacOS/afssettings.m [new file with mode: 0644]
src/packaging/MacOS/buildpkg.sh
src/packaging/MacOS/settings.plist [new file with mode: 0644]
src/ptserver/Makefile.in
src/rxgen/rpc_scan.c
src/rxkad/Makefile.in
src/shlibafsrpc/Makefile.in
src/sys/Makefile.in
src/tviced/Makefile.in
src/util/flipbase64.c
src/util/softsig.c
src/viced/Makefile.in
src/vol/Makefile.in
src/vol/fstab.c [new file with mode: 0644]
src/vol/partition.c

index c7e97ee11ab6214f656d031ec7100947fd2f1f91..bea42a37cc658a7e8d954773f23a8309c4a723ac 100644 (file)
@@ -4,6 +4,8 @@
 # This software has been released under the terms of the IBM Public
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
+#
+# Portions Copyright (c) 2003 Apple Computer, Inc.
 
 SHELL=/bin/sh
 DEST=@DEST@
@@ -89,7 +91,7 @@ dest_only_libafs: only_libafs dest_dirs
 
 packages: dest
        @case ${SYS_NAME} in \
-       ppc_darwin* ) \
+       *_darwin_* ) \
                ${COMPILE_PART1} packaging/MacOS && sh ./buildpkg.sh ${DEST} ;; \
        hp_ux110 ) \
                ${COMPILE_PART1} packaging/HP-UX && swpackage -s  psf-1.2.10-transarc-paths-11.00 ;; \
@@ -259,6 +261,10 @@ tviced: project viced vlserver libafsrpc libafsauthent
        case ${SYS_NAME} in \
        alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \
                ${COMPILE_PART1} tviced  ${COMPILE_PART2} ;; \
+       *_darwin_[1-6][0-9]) \
+               echo Not building MT viced for ${SYS_NAME} ;; \
+       *_darwin_*) \
+               ${COMPILE_PART1} tviced  ${COMPILE_PART2} ;; \
        *) \
                echo Not building MT viced for ${SYS_NAME} ;; \
        esac
@@ -278,7 +284,7 @@ null: project
 
 gtx: project null auth # kauth rxkad ?
        case ${SYS_NAME} in \
-         rs_aix* | sun*_5? | sgi_6? | *linux* | ppc_darwin* | *fbsd* | ia64_hpux*) \
+         rs_aix* | sun*_5? | sgi_6? | *linux* | *_darwin_* | *fbsd* | ia64_hpux*) \
                $(RM) -f ${TOP_LIBDIR}/libtermlib.a; \
                ln -s libnull.a ${TOP_LIBDIR}/libtermlib.a; \
                ${COMPILE_PART1} gtx ${COMPILE_PART2};; \
@@ -309,7 +315,7 @@ bozo: project ntp audit
 vfsck: vol
        set -x; \
        case ${SYS_NAME} in \
-       sgi_* | *linux* | rs_aix42 | ppc_darwin* | hp_ux* | ia64_hpux* | *fbsd* | *_obsd* | sun*_4* ) \
+       sgi_* | *linux* | rs_aix42 | *_darwin_* | hp_ux* | ia64_hpux* | *fbsd* | *_obsd* | sun*_4* ) \
                echo skip vfsck for ${SYS_NAME} ;; \
         * ) \
                ${COMPILE_PART1} vfsck ${COMPILE_PART2} ;; \
@@ -336,7 +342,7 @@ login: project kauth rxkad
                else \
                        echo Skipping pam for ${SYS_NAME} ; \
                fi ;; \
-       ppc_darwin* | *_obsd* ) \
+       *_darwin_* | *_obsd* ) \
                echo Skipping login for ${SYS_NAME} ;; \
        * ) \
                ${COMPILE_PART1} login ${COMPILE_PART2} ;; \
@@ -459,6 +465,10 @@ libafsrpc: rx rxkad des
        case ${SYS_NAME} in \
        alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*fbsd*) \
        ${COMPILE_PART1} libafsrpc  ${COMPILE_PART2} ;; \
+       *_darwin_[1-6][0-9]) \
+               echo Not building MT libafsrpc for ${SYS_NAME} ;; \
+       *_darwin_*) \
+       ${COMPILE_PART1} libafsrpc  ${COMPILE_PART2} ;; \
        *) \
                echo Not building MT libafsrpc for ${SYS_NAME} ;; \
        esac
@@ -467,8 +477,12 @@ libafsauthent: ubik auth kauth libafsrpc
        case ${SYS_NAME} in \
        alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*fbsd*) \
        ${COMPILE_PART1} libafsauthent  ${COMPILE_PART2} ;; \
+       *_darwin_[1-6][0-9]) \
+               echo Not building MT libafsauthent for ${SYS_NAME} ;; \
+       *_darwin_*) \
+       ${COMPILE_PART1} libafsauthent  ${COMPILE_PART2} ;; \
        *) \
-               echo Not building MT libafsrpc for ${SYS_NAME} ;; \
+               echo Not building MT libafsauthent for ${SYS_NAME} ;; \
        esac
 
 shlibafsrpc: rx rxkad des
@@ -488,7 +502,7 @@ shlibafsauthent: ubik auth kauth shlibafsrpc
        alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \
        ${COMPILE_PART1} shlibafsauthent ${COMPILE_PART2} ;; \
        *) \
-               echo Not building shared libafsrpc for ${SYS_NAME} ;; \
+               echo Not building shared libafsauthent for ${SYS_NAME} ;; \
        esac
 
 libadmin_real: 
@@ -507,6 +521,10 @@ libadmin: libafsauthent bozo
        case ${SYS_NAME} in \
        alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \
                        $(MAKE) libadmin_real ;; \
+       *_darwin_[1-6][0-9]) \
+               echo Not building MT libadmin for ${SYS_NAME} ;; \
+       *_darwin_*) \
+                       $(MAKE) libadmin_real ;; \
        *) \
                echo Not building MT libadmin for ${SYS_NAME} ;; \
        esac
@@ -793,7 +811,7 @@ package.files: package
 ntp: project volser
        @case ${WITH_OBSOLETE} in \
        YES)    case ${SYS_NAME} in \
-               sun*_5[89] | *linux* | *fbsd* | ppc_darwin* ) echo skipping ntp for ${SYS_NAME} ;; \
+               sun*_5[89] | *linux* | *fbsd* | *_darwin_* ) echo skipping ntp for ${SYS_NAME} ;; \
                * ) ${COMPILE_PART1} ntp ${COMPILE_PART2} ;; \
                esac ;; \
        *)      echo skipping deprecated target: ntp ;; \
index 2ca43a862d9078e85ce856e1952a8d910876342a..b98f7f2a5b45b7c04eb9ef444846e8d5fcfcea4e 100644 (file)
@@ -1,3 +1,6 @@
+/*
+ * Portions Copyright (c) 2003 Apple Computer, Inc.  All rights reserved.
+ */
 #include <afsconfig.h>
 #include <afs/param.h>
 
@@ -10,6 +13,8 @@ RCSID("$Header$");
 #include <sys/namei.h>
 #include <sys/conf.h>
 #include <sys/syscall.h>
+#include <sys/sysctl.h>
+#include "../afs/sysctl.h"
 
 struct vcache *afs_globalVp = 0;
 struct mount *afs_globalVFS = 0;
@@ -275,8 +280,39 @@ struct prioc *p;
 return 0;
 }
 
-int afs_sysctl() {
-   return EOPNOTSUPP;
+u_int32_t afs_darwin_realmodes = 0;
+
+int afs_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
+int *name;
+u_int namelen;
+void *oldp;
+size_t *oldlenp;
+void *newp;
+size_t newlen;
+struct proc *p;
+{
+    int error;
+
+    switch (name[0]) {
+    case AFS_SC_ALL:
+       /* nothing defined */
+       break;
+    case AFS_SC_DARWIN:
+       if (namelen < 3)
+           return ENOENT;
+       switch (name[1]) {
+       case AFS_SC_DARWIN_ALL:
+           switch (name[2]) {
+           case AFS_SC_DARWIN_ALL_REALMODES:
+               return sysctl_int(oldp, oldlenp, newp, newlen,
+                 &afs_darwin_realmodes);
+           }
+           break;
+       /* darwin version specific sysctl's goes here */
+       }
+       break;
+    }
+    return EOPNOTSUPP;
 }
 
 
index 81982745bdeaa044ed46b78d09bdcf48f47a48d1..c14fddfac3ddaee4d2180c1338c94915997c8685 100644 (file)
@@ -1,3 +1,6 @@
+/*
+ * Portions Copyright (c) 2003 Apple Computer, Inc.  All rights reserved.
+ */
 #include <afsconfig.h>
 #include <afs/param.h>
 
@@ -9,6 +12,9 @@ RCSID("$Header$");
 #include <sys/malloc.h>
 #include <sys/namei.h>
 #include <sys/ubc.h>
+#if defined(AFS_DARWIN70_ENV)
+#include <vfs/vfs_support.h>
+#endif /* defined(AFS_DARWIN70_ENV) */
 
 int afs_vop_lookup(struct vop_lookup_args *);
 int afs_vop_create(struct vop_create_args *);
@@ -35,7 +41,9 @@ int afs_vop_rmdir(struct vop_rmdir_args *);
 int afs_vop_symlink(struct vop_symlink_args *);
 int afs_vop_readdir(struct vop_readdir_args *);
 int afs_vop_readlink(struct vop_readlink_args *);
+#if !defined(AFS_DARWIN70_ENV)
 extern int ufs_abortop(struct vop_abortop_args *);
+#endif /* !defined(AFS_DARWIN70_ENV) */
 int afs_vop_inactive(struct vop_inactive_args *);
 int afs_vop_reclaim(struct vop_reclaim_args *);
 int afs_vop_lock(struct vop_lock_args *);
@@ -89,9 +97,13 @@ struct vnodeopv_entry_desc afs_vnodeop_entries[] = {
        { &vop_symlink_desc, afs_vop_symlink },        /* symlink */
        { &vop_readdir_desc, afs_vop_readdir },        /* readdir */
        { &vop_readlink_desc, afs_vop_readlink },      /* readlink */
+#if defined(AFS_DARWIN70_ENV)
+       { &vop_abortop_desc, nop_abortop },             /* abortop */
+#else /* ! defined(AFS_DARWIN70_ENV) */
        /* Yes, we use the ufs_abortop call.  It just releases the namei
           buffer stuff */
        { &vop_abortop_desc, ufs_abortop },             /* abortop */
+#endif /* defined(AFS_DARWIN70_ENV) */
        { &vop_inactive_desc, afs_vop_inactive },      /* inactive */
        { &vop_reclaim_desc, afs_vop_reclaim },        /* reclaim */
        { &vop_lock_desc, afs_vop_lock },              /* lock */
@@ -277,17 +289,37 @@ afs_vop_open(ap)
        } */ *ap;
 {
     int error;
-    struct vcache *vc = VTOAFS(ap->a_vp);
+    struct vnode *vp = ap->a_vp;
+    struct vcache *vc = VTOAFS(vp);
+#ifdef AFS_DARWIN14_ENV
+    int didhold = 0;
+    /*----------------------------------------------------------------
+     * osi_VM_TryReclaim() removes the ubcinfo of a vnode, but that vnode
+     * can later be passed to vn_open(), which will skip the call to
+     * ubc_hold(), and when the ubcinfo is later added, the ui_refcount
+     * will be off.  So we compensate by calling ubc_hold() ourselves
+     * when ui_refcount is less than 2.  If an error occurs in afs_open()
+     * we must call ubc_rele(), which is what vn_open() would do if it
+     * was able to call ubc_hold() in the first place.
+     *----------------------------------------------------------------*/
+    if (vp->v_type == VREG && !(vp->v_flag & VSYSTEM)
+      && vp->v_ubcinfo->ui_refcount < 2)
+       didhold = ubc_hold(vp);
+#endif /* AFS_DARWIN14_ENV */
     AFS_GLOCK();
     error = afs_open(&vc, ap->a_mode, ap->a_cred);
 #ifdef DIAGNOSTIC
-    if (AFSTOV(vc) != ap->a_vp)
+    if (AFSTOV(vc) != vp)
        panic("AFS open changed vnode!");
 #endif
     afs_BozonLock(&vc->pvnLock, vc);
     osi_FlushPages(vc, ap->a_cred);
     afs_BozonUnlock(&vc->pvnLock, vc);
     AFS_GUNLOCK();
+#ifdef AFS_DARWIN14_ENV
+    if (error && didhold)
+       ubc_rele(vp);
+#endif /* AFS_DARWIN14_ENV */
     return error;
 }
 
@@ -1281,6 +1313,17 @@ afs_vop_pathconf(ap)
       case _PC_PIPE_BUF:
        return EINVAL;
        break;
+#if defined(AFS_DARWIN70_ENV)
+      case _PC_NAME_CHARS_MAX:
+       *ap->a_retval = NAME_MAX;
+       break;
+      case _PC_CASE_SENSITIVE:
+       *ap->a_retval = 1;
+       break;
+      case _PC_CASE_PRESERVING:
+       *ap->a_retval = 1;
+       break;
+#endif /* defined(AFS_DARWIN70_ENV) */
       default:
        return EINVAL;
     }
index d29933b062cbbe421ca965dc3ba89d08e293b6e6..0fb644b8e66c3d257e3902bb099ae57dca4f1b12 100644 (file)
@@ -4,6 +4,8 @@
 # This software has been released under the terms of the IBM Public
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
+#
+# Portions Copyright (c) 2003 Apple Computer, Inc.
 
 DEST=@DEST@
 TOP_INCDIR=@TOP_INCDIR@
@@ -30,7 +32,7 @@ UKERNELDIR = ../libuafs
 
 include ../config/Makefile.${SYS_NAME}
 
-all: kinstall ukinstall ${TOP_INCDIR}/afs/afs.h ${TOP_INCDIR}/afs/osi_inode.h ${TOP_INCDIR}/afs/afs_stats.h ${TOP_INCDIR}/afs/exporter.h ${TOP_INCDIR}/afs/nfsclient.h
+all: kinstall ukinstall ${TOP_INCDIR}/afs/afs.h ${TOP_INCDIR}/afs/osi_inode.h ${TOP_INCDIR}/afs/afs_stats.h ${TOP_INCDIR}/afs/exporter.h ${TOP_INCDIR}/afs/nfsclient.h ${TOP_INCDIR}/afs/sysctl.h
        case ${SYS_NAME} in \
                pmax_ul43 | pmax_ul43a) \
                        ${INSTALL} longc_procs.h ${TOP_INCDIR}/afs ;; \
@@ -56,7 +58,7 @@ afszcm.cat: afs_trace.msf
                        /usr/etc/gencat afszcm.cat afs_trace.msf ;; \
                *_linux* | *_umlinux* ) \
                        gencat --new afszcm.cat afs_trace.msf ;; \
-               ppc_darwin* | i386_fbsd*) \
+               *_darwin_* | i386_fbsd*) \
                        echo No gencat for ${SYS_NAME} ;; \
                * ) \
                        gencat afszcm.cat afs_trace.msf ;; \
@@ -74,7 +76,7 @@ ukinstall: ${UKERNELDIR}/afs AFS_component_version_number.c afs_trace.h
 ${UKERNELDIR}/afs:
        mkdir -p $@
 
-install:   ${DESTDIR}${includedir}/afs/afs.h  ${DESTDIR}${includedir}/afs/osi_inode.h ${DESTDIR}${includedir}/afs/afs_stats.h ${DESTDIR}${includedir}/afs/exporter.h ${DESTDIR}${includedir}/afs/nfsclient.h
+install:   ${DESTDIR}${includedir}/afs/afs.h  ${DESTDIR}${includedir}/afs/osi_inode.h ${DESTDIR}${includedir}/afs/afs_stats.h ${DESTDIR}${includedir}/afs/exporter.h ${DESTDIR}${includedir}/afs/nfsclient.h ${DESTDIR}${includedir}/afs/sysctl.h
        case ${SYS_NAME} in \
                pmax_ul43 | pmax_ul43a) \
                        ${INSTALL} longc_procs.h ${DESTDIR}${includedir}/afs ;; \
@@ -117,11 +119,20 @@ ${DEST}/include/afs/afs_stats.h: afs_stats.h
 ${DESTDIR}${includedir}/afs/afs_stats.h: afs_stats.h
        ${INSTALL} $? $@
 
-
 ${TOP_INCDIR}/afs/afs_stats.h: afs_stats.h
        ${INSTALL} $? $@
 
 
+${DEST}/include/afs/sysctl.h: sysctl.h
+       ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/sysctl.h: sysctl.h
+       ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/sysctl.h: sysctl.h
+       ${INSTALL} $? $@
+
+
 ${DEST}/include/afs/exporter.h: exporter.h
        ${INSTALL} $? $@
 
@@ -144,13 +155,13 @@ ${TOP_INCDIR}/afs/nfsclient.h: nfsclient.h
        ${INSTALL} $? $@
 
 
-dest:   ${DEST}/include/afs/afs.h ${DEST}/include/afs/osi_inode.h ${DEST}/include/afs/afs_stats.h ${DEST}/include/afs/exporter.h ${DEST}/include/afs/nfsclient.h
+dest:   ${DEST}/include/afs/afs.h ${DEST}/include/afs/osi_inode.h ${DEST}/include/afs/afs_stats.h ${DEST}/include/afs/exporter.h ${DEST}/include/afs/nfsclient.h ${DEST}/include/afs/sysctl.h
        case ${SYS_NAME} in \
                pmax_ul43 | pmax_ul43a) \
                        ${INSTALL} longc_procs.h ${DEST}/include/afs ;; \
        esac
        case ${SYS_NAME} in \
-               next_mach30 | vax_ul43 | ppc_darwin* | i386_fbsd* ) \
+               next_mach30 | vax_ul43 | *_darwin_* | i386_fbsd* ) \
                        echo skipping afszcm.cat install for ${SYS_NAME} ;; \
                * ) \
                        ${INSTALL} afszcm.cat ${DEST}/root.client/usr/vice/etc/C ;; \
index f8ed5f7bf5f24ea60d1fd0b47cf19f62f76475b7..3bc50ae87a91384a036870210574bb740d5e5359 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -68,20 +70,26 @@ afs_CopyOutAttrs(avc, attrs)
            attrs->va_mode &= ~(VSUID|VSGID);
     }
 #if defined(AFS_DARWIN_ENV)
-    /* Mac OS X uses the mode bits to determine whether a file or directory
-     * is accessible, and believes them, even though under AFS they're almost
-     * assuredly wrong, especially if the local uid does not match the AFS
-     * ID.  So we set the mode bits conservatively.
-     */
-    if (S_ISDIR(attrs->va_mode)) {
-      /* all access bits need to be set for directories, since even
-       * a mode 0 directory can still be used normally.
-       */
-      attrs->va_mode |= ACCESSPERMS;
-    } else {
-      /* for other files, replicate the user bits to group and other */
-      mode_t ubits = (attrs->va_mode & S_IRWXU) >> 6;
-      attrs->va_mode |= ubits | (ubits << 3);
+    {
+       extern u_int32_t afs_darwin_realmodes;
+       if (!afs_darwin_realmodes) {
+           /* Mac OS X uses the mode bits to determine whether a file or
+            * directory is accessible, and believes them, even though under
+            * AFS they're almost assuredly wrong, especially if the local uid
+            * does not match the AFS ID.  So we set the mode bits
+            * conservatively.
+            */
+           if (S_ISDIR(attrs->va_mode)) {
+             /* all access bits need to be set for directories, since even
+              * a mode 0 directory can still be used normally.
+              */
+             attrs->va_mode |= ACCESSPERMS;
+           } else {
+             /* for other files, replicate the user bits to group and other */
+             mode_t ubits = (attrs->va_mode & S_IRWXU) >> 6;
+             attrs->va_mode |= ubits | (ubits << 3);
+           }
+       }
     }
 #endif /* AFS_DARWIN_ENV */
     attrs->va_uid = fakedir ? 0 : avc->m.Owner;
@@ -96,7 +104,11 @@ afs_CopyOutAttrs(avc, attrs)
 #ifdef AFS_OSF_ENV
     attrs->va_fsid = avc->v.v_mount->m_stat.f_fsid.val[0]; 
 #else
+#ifdef AFS_DARWIN70_ENV
+    attrs->va_fsid = avc->v.v_mount->mnt_stat.f_fsid.val[0]; 
+#else /* ! AFS_DARWIN70_ENV */
     attrs->va_fsid = 1;
+#endif /* AFS_DARWIN70_ENV */
 #endif
 #endif
 #endif /* AFS_SUN56_ENV */
diff --git a/src/afs/sysctl.h b/src/afs/sysctl.h
new file mode 100644 (file)
index 0000000..5af1e2f
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+#ifndef AFS_SYSCTL_H
+#define AFS_SYSCTL_H
+
+/* top level AFS names */
+#define AFS_SC_ALL                             0
+#define AFS_SC_DARWIN                          1
+
+/* AFS_SC_ALL: platform-independent sysctls */
+       /* nothing defined */
+
+/* AFS_SC_DARWIN: darwin-specific sysctls */
+#define AFS_SC_DARWIN_ALL                      0
+#define AFS_SC_DARWIN_12                       1
+#define AFS_SC_DARWIN_13                       2
+#define AFS_SC_DARWIN_14                       3
+#define AFS_SC_DARWIN_60                       4
+#define AFS_SC_DARWIN_70                       5
+
+/* AFS_SC_DARWIN_ALL: darwin version-independent sysctls */
+#define AFS_SC_DARWIN_ALL_REALMODES            1
+
+/* AFS_SC_DARWIN_12: darwin 1.2 sysctls */
+       /* nothing defined */
+
+/* AFS_SC_DARWIN_13: darwin 1.3 sysctls */
+       /* nothing defined */
+
+/* AFS_SC_DARWIN_14: darwin 1.4 sysctls */
+       /* nothing defined */
+
+/* AFS_SC_DARWIN_60: darwin 6.x sysctls */
+       /* nothing defined */
+
+/* AFS_SC_DARWIN_70: darwin 7.x sysctls */
+       /* nothing defined */
+
+#endif /* AFS_SYSCTL_H */
index 1a628cf905f378e651f27274118b3526baf0e0fe..53424ab2f1ec356e6f2e672241f93ed3b55ef356 100644 (file)
@@ -5,6 +5,8 @@
 # This software has been released under the terms of the IBM Public
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
+#
+# Portions Copyright (c) 2003 Apple Computer, Inc.
 
 # afsd makefile
 DEST=@DEST@
@@ -52,7 +54,7 @@ afsd: afsd.o $(AFSLIBS)
                ${CC} ${CFLAGS} -o afsd afsd.o $(NON_SHARED) $(LDFLAGS) $(AFSLIBS) ${XLIBS} /usr/lib/libdwarf.a /usr/lib/libelf.a ;; \
        sgi_64 | sgi_65 ) \
                ${CC} ${CFLAGS} -o afsd afsd.o $(NON_SHARED) $(LDFLAGS) $(AFSLIBS) ${XLIBS} /usr/lib32/libdwarf.a /usr/lib32/libelf.a ;; \
-       ppc_darwin* ) \
+       *_darwin_* ) \
                ${CC} ${CFLAGS} -o afsd afsd.o $(NON_SHARED) $(LDFLAGS) $(AFSLIBS) ${XLIBS} -F/System/Library/PrivateFrameworks -framework DiskArbitration ;; \
        * ) \
                ${CC} ${CFLAGS} -o afsd afsd.o $(NON_SHARED) $(LDFLAGS) $(AFSLIBS) ${XLIBS} ;; \
@@ -124,7 +126,7 @@ dest: ${DEST}/root.client/usr/vice/etc/afsd ${DEST}/etc/vsys
                *linux* ) \
                        ${INSTALLex} -f afs.rc.linux ${DEST}/root.client/usr/vice/etc/afs.rc; \
                        ${INSTALL} -f afs.conf.linux ${DEST}/root.client/usr/vice/etc/afs.conf ;; \
-               ppc_darwin*) \
+               *_darwin_*) \
                        ${INSTALLex} -f afs.rc.darwin ${DEST}/root.client/usr/vice/etc/afs.rc ; \
                        ${INSTALL} -f afs.rc.darwin.plist ${DEST}/root.client/usr/vice/etc/StartupParameters.plist ;; \
                *fbsd*) \
index ed95303ab8e23a747166f9817df809ba0e534c9b..269734e119879060c9a70ae41a1052f8b899611d 100644 (file)
@@ -5,6 +5,8 @@
 # This software has been released under the terms of the IBM Public
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
+#
+# Portions Copyright (c) 2003 Apple Computer, Inc.
 
 . /etc/rc.common
 
@@ -101,6 +103,14 @@ done
 echo "Starting afsd"
 $AFSD $OPTIONS
 
+#
+# Call afssettings (if it exists) to set customizable parameters
+#
+if [ -x $VICEETC/config/afssettings ]; then
+    sleep 2
+    $VICEETC/config/afssettings
+fi
+
 #
 # Run package to update the disk
 #
index 4c05dd1f09888e4c168fca729a68ba8eccf47098..5e3054e2625962390532ed1b4457e61b6dfee92c 100644 (file)
@@ -1,7 +1,7 @@
 {
   Description     = "OpenAFS network file system";
   Provides        = ("AFS");
-  Requires        = ("Resolver");
+  Requires        = ("Resolver", "Disks");
   OrderPreference = "None";
   Messages =
   {
index 0bef79996ae94bd25965a5d1bdaad599edb04ff8..5618dadf2562e8a7dffaffcbb4616bc44c99b771 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -274,7 +276,7 @@ extern char *cm_categories[]; /* cache manager data category names */
 
 
 
-#ifndef AFS_FBSD_ENV
+#if !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN70_ENV)
 /*     
         strcasestr(): Return first occurence of pattern s2 in s1, case 
        insensitive. 
index a937b8fb4dfa6fb94a324f1c86acdefbd1694c66..b4316e81f6d79545d9b9d4f8450d8bf04f25eb9f 100644 (file)
@@ -4,6 +4,8 @@
 # This software has been released under the terms of the IBM Public
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
+#
+# Portions Copyright (c) 2003 Apple Computer, Inc.
 
 DEST=@DEST@
 TOP_INCDIR=@TOP_INCDIR@
@@ -109,6 +111,11 @@ install:
        @case ${SYS_NAME} in \
        alpha_dux*|sgi_*|sun*|rs_aix4*|*linux*|hp_ux*) \
                echo "Don't install butc for ${SYS_NAME} (will install from tbutc)" ;; \
+       *_darwin_[1-6][0-9]) \
+               echo ${INSTALL} butc ${DESTDIR}${sbindir}/butc ; \
+               ${INSTALL} butc ${DESTDIR}${sbindir}/butc ;; \
+       *_darwin_*) \
+               echo "Don't install butc for ${SYS_NAME} (will install from tbutc)" ;; \
        *) \
                echo ${INSTALL} butc ${DESTDIR}${sbindir}/butc ; \
                ${INSTALL} butc ${DESTDIR}${sbindir}/butc ;; \
@@ -120,6 +127,11 @@ dest:
        @case ${SYS_NAME} in \
        alpha_dux*|sgi_*|sun*|rs_aix4*|*linux*|hp_ux*) \
                echo "Don't install butc for ${SYS_NAME} (will install from tbutc)" ;; \
+       *_darwin_[1-6][0-9]) \
+               echo ${INSTALL} butc ${DEST}/etc/butc ; \
+               ${INSTALL} butc ${DEST}/etc/butc ;; \
+       *_darwin_*) \
+               echo "Don't install butc for ${SYS_NAME} (will install from tbutc)" ;; \
        *) \
                echo ${INSTALL} butc ${DEST}/etc/butc ; \
                ${INSTALL} butc ${DEST}/etc/butc ;; \
diff --git a/src/config/Makefile.ppc_darwin_70.in b/src/config/Makefile.ppc_darwin_70.in
new file mode 100644 (file)
index 0000000..b18fce4
--- /dev/null
@@ -0,0 +1,47 @@
+# Portions Copyright (c) 2003 Apple Computer, Inc.  All rights reserved.
+#
+# Keep macros within each section in sorted order for clean diff displays.
+#
+# AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
+AFS_OSTYPE = DARWIN
+#
+#
+# compilation and link editor flags
+XCFLAGS=
+MT_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV ${XCFLAGS}
+MT_CC=cc
+KROOT=
+KINCLUDES=-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers
+LWP_OPTMZ=-O2
+OPTMZ=-O2
+DBG=-g
+REGEX_OBJ=regex.o
+
+
+#
+# libraries
+XLIBS=@LIB_AFSDB@
+TXLIBS=-lncurses
+#MTLIBS=
+#XLIBELFA=
+#XLIBKVM=
+#
+SHLIB_SUFFIX=
+SHLIB_CFLAGS=
+#
+# programs
+AR=ar
+AS=as
+CC=cc
+CP=cp
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
+LEX=lex -l
+LD= ld
+LORDER = lorder
+MV=mv
+RANLIB=ranlib
+RM=rm
+STRIP= strip
+
+# override getfsent
+EXTRA_VLIBOBJS=fstab.o
index 330204aa0d206d1c91aefa0cd6fdc72c689f7b02..97d00a6ecdca575a45f5c1509036899c484715c8 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 #define SYS_NAME_ID_i386_umlinux2      2700
@@ -58,6 +60,7 @@
 #define SYS_NAME_ID_ppc_darwin_13        504
 #define SYS_NAME_ID_ppc_darwin_14        505
 #define SYS_NAME_ID_ppc_darwin_60        506
+#define SYS_NAME_ID_ppc_darwin_70        507
 
 #define SYS_NAME_ID_next_mach20                 601
 #define SYS_NAME_ID_next_mach30                 602
diff --git a/src/config/param.ppc_darwin_70.h b/src/config/param.ppc_darwin_70.h
new file mode 100644 (file)
index 0000000..e13e24e
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Portions Copyright (c) 2003 Apple Computer, Inc.  All rights reserved.
+ */
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+#define AFS_ENV                 1
+#define AFS_64BIT_ENV           1       /* Defines afs_int32 as int, not long. */
+#define AFS_64BIT_IOPS_ENV 1
+#define AFS_PPC_ENV 1
+#define AFS_VFSINCL_ENV 1
+
+#include <afs/afs_sysnames.h>
+
+#define AFS_DARWIN_ENV
+#define AFS_DARWIN13_ENV
+#define AFS_DARWIN14_ENV
+#define AFS_DARWIN60_ENV
+#define AFS_DARWIN70_ENV
+#define AFS_NONFSTRANS
+#define AFS_SYSCALL             230
+#define AFS_NAMEI_ENV 1
+
+/* File system entry (used if mount.h doesn't define MOUNT_AFS */
+#define AFS_MOUNT_AFS    "afs"
+
+/* Machine / Operating system information */
+#define sys_ppc_darwin_12   1
+#define sys_ppc_darwin_13   1
+#define sys_ppc_darwin_14   1
+#define sys_ppc_darwin_60   1
+#define sys_ppc_darwin_70   1
+#define SYS_NAME        "ppc_darwin_70"
+#define SYS_NAME_ID     SYS_NAME_ID_ppc_darwin_70
+#define AFSBIG_ENDIAN   1
+#define AFS_HAVE_FFS    1       /* Use system's ffs. */
+
+#define AFS_GCPAGS                1       /* if nonzero, garbage collect PAGs */
+#define RXK_LISTENER_ENV         1
+
+#ifdef KERNEL
+#undef MACRO_BEGIN
+#undef MACRO_END
+#include <kern/macro_help.h>
+#define AFS_GLOBAL_SUNLOCK        1
+#define AFS_VFS34       1       /* What is VFS34??? */
+#define afsio_iov       uio_iov
+#define afsio_iovcnt    uio_iovcnt
+#define afsio_offset    uio_offset
+#define afsio_seg       uio_segflg
+#define afsio_resid     uio_resid
+#define AFS_UIOSYS      UIO_SYSSPACE
+#define AFS_UIOUSER     UIO_USERSPACE
+#define AFS_CLBYTES     CLBYTES
+#define osi_GetTime(x)  microtime(x)
+#define AFS_KALLOC(x)   kalloc(x)
+#define AFS_KFREE(x,y)  kfree(x,y)
+#define v_count         v_usecount
+#define v_vfsp          v_mount
+#define vfs_bsize       mnt_stat.f_bsize
+#define vfs_fsid        mnt_stat.f_fsid
+#define va_nodeid       va_fileid
+#define vfs_vnodecovered mnt_vnodecovered
+#define direct          dirent
+#define vnode_t         struct vnode
+
+#define VN_RELE(vp)     vrele(((struct vnode *)(vp)))
+#define VN_HOLD(vp)     VREF(((struct vnode *)(vp)))
+
+#endif
+
+#define BIND_8_COMPAT
+
+#endif /* AFS_PARAM_H */
diff --git a/src/config/param.ppc_darwin_70_usr.h b/src/config/param.ppc_darwin_70_usr.h
new file mode 100644 (file)
index 0000000..1167c80
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Portions Copyright (c) 2003 Apple Computer, Inc.  All rights reserved.
+ */
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+#define AFS_VFSINCL_ENV 1       /* NOBODY uses this.... */
+#define AFS_ENV                 1
+#define AFS_64BIT_ENV           1       /* Defines afs_int32 as int, not long. */
+#define AFS_PPC_ENV 1
+
+#include <afs/afs_sysnames.h>
+#define AFS_USERSPACE_ENV
+#define AFS_USR_DARWIN_ENV
+#define AFS_USR_DARWIN13_ENV
+#define AFS_USR_DARWIN14_ENV
+#define AFS_USR_DARWIN60_ENV
+#define AFS_USR_DARWIN70_ENV
+#define AFS_NONFSTRANS 
+#define AFS_SYSCALL             230
+
+/* File system entry (used if mount.h doesn't define MOUNT_AFS */
+#define AFS_MOUNT_AFS    "afs"
+
+/* Machine / Operating system information */
+#define sys_ppc_darwin_12   1
+#define sys_ppc_darwin_13   1
+#define sys_ppc_darwin_14   1
+#define sys_ppc_darwin_60   1
+#define sys_ppc_darwin_70   1
+#define SYS_NAME        "ppc_darwin_70"
+#define SYS_NAME_ID     SYS_NAME_ID_ppc_darwin_70
+#define AFSBIG_ENDIAN   1
+#define AFS_HAVE_FFS    1       /* Use system's ffs. */
+
+#define AFS_UIOSYS      UIO_SYSSPACE
+#define AFS_UIOUSER     UIO_USERSPACE
+
+#define AFS_GCPAGS                0       /* if nonzero, garbage collect PAGs */
+#define RXK_LISTENER_ENV          1
+
+#define AFS_VFS34       1       /* What is VFS34??? */
+#define afsio_iov       uio_iov
+#define afsio_iovcnt    uio_iovcnt
+#define afsio_offset    uio_offset
+#define afsio_seg       uio_segflg
+#define afsio_resid     uio_resid
+#define AFS_UIOSYS      UIO_SYSSPACE
+#define AFS_UIOUSER     UIO_USERSPACE
+#define        VATTR_NULL      usr_vattr_null
+
+#define AFS_DIRENT
+#ifndef CMSERVERPREF
+#define CMSERVERPREF
+#endif
+
+#define BIND_8_COMPAT
+
+#endif /* AFS_PARAM_H */
index 63a7dfe59595051877382b0745310ff4750759a5..c15d1d6894e0418d2a766f949796c0ae8c62a479 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 void Usage()
 {
     fprintf(stderr,
index a2e51db3df1a9d99d69e69aab76370abe7cc26ce..486067dc85e37c5d6673611bcfb72de7a9a46195 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 void Usage()
 {
     fprintf(stderr,
index f363cf5756eaa1266b9f19eb1138fba4ca27e14b..2bbf4b0730ad51af25721f4f16e9f8f8b47a2f21 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 void Usage()
 {
     fprintf(stderr,
index 19367a085c247b8d0d54ba587e4b52828268c753..28c0e193be08cacc4eaffa14e20aa46c9647cd0c 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 void Usage()
 {
     fprintf(stderr,
index c467c6f7f9143023337b638add4b759225c03207..ed54904b62fb0036c929238dfe158fb3e48f56d0 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 void Usage()
 {
     fprintf(stderr,
index aeb2906cbf88975314ec3ccf5a6c60bef09b37bf..9a7953cf0a6dbbda3a122f495682e76fd635a596 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 void Usage()
 {
     fprintf(stderr,
index 84b6d862945c2868af318162f534b9327313b29a..e339f3f2ca6c9553282a8472c67563d025eb96b1 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 void Usage()
 {
     fprintf(stderr,
index 063233bff4cf346fc55c69f924ec26b605a54b2a..74ac0d4038217894a97759ce60e07bd21149813c 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 void Usage()
 {
     fprintf(stderr,
index 07a0b0628e569dcaa99abd42dc9204d9192d8deb..56ea411c49885c1a09187af500bdde3e6af8641c 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 void Usage()
 {
     fprintf(stderr,
index 190a2cddf614f4507c9a45842f0e9e3ec11d90ba..fc9c344a137cef625bbf3932798388c1d4e6bb24 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 void Usage()
 {
     fprintf(stderr,
index f3a7d78ef5380ef77743a778ceb0f9a67056a150..2d7070922044e7e461a9eb48b15c513ae5d1e484 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 extern int RXSTATS_ClearPeerRPCStats();
 
 void Usage()
index a06f1dfff6c6579d10b3701eff30bf28a7561c19..e0d1950b051c676892b23cf6e0c99490ebe8b344 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 extern int RXSTATS_ClearProcessRPCStats();
 
 void Usage()
index 617ac9e395085b9445eacb01824844f4180d6e30..af2a85440a51ff84b056bcd1f9eca49efd8e035e 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 extern int RXSTATS_DisablePeerRPCStats();
 
 void Usage()
index 29be295baaeb870e436b97b3ac49ffc3d8865f27..9f072d587b8cedc33a0ce1cb3dc38ad95dc27a30 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 extern int RXSTATS_DisableProcessRPCStats();
 
 void Usage()
index 5da0718357b22c527da1644e6eacc467e1821ab6..5c5f1b2d9273616e7c756f337fe265a98a148d10 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 extern int RXSTATS_EnablePeerRPCStats();
 
 void Usage()
index ea07075d37ce29e53a1a29f9182e3c2e3987c0c6..2953a9360ac070cf10942b4b1d02f35d35ebf3ad 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 extern int RXSTATS_EnableProcessRPCStats();
 
 void Usage()
index fce89e5371369539300b1bc3cb0969cc8ff03da0..c0896c8229710fe22a28da57061f0b821c1b0ead 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,13 @@ RCSID("$Header$");
 #include <afs/afs_AdminErrors.h>
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
+
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 #include <rx/rxstat.h>
 #include <afs/afsint.h>
 #define FSINT_COMMON_XG
index 3324efadbadc73d1caf02e50fa0919ca975239ec..9bb8e2b772d37ece268ba49b0ce140f2ab215f8a 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,13 @@ RCSID("$Header$");
 #include <afs/afs_AdminErrors.h>
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
+
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 #include <rx/rxstat.h>
 #include <afs/afsint.h>
 #define FSINT_COMMON_XG
index 8678c901f0a4b134de6ea291f2c40fa6db22b6c2..a3b8d540f589a06d7e55f231741ca26afe5cf80e 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 void Usage()
 {
     fprintf(stderr,
index ca6508919be0d8fd47edd3d69a18bf0627d2b065..15ab9bbeddabb6b5a15cccd92831da837b10261d 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 extern int RXSTATS_QueryPeerRPCStats();
 
 void Usage()
index 6a6662a28121653729c0af79b4d5a96f1154a570..63487e121aee34731b7463664b572e917c82ff68 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -24,6 +26,12 @@ RCSID("$Header$");
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
+
 extern int RXSTATS_QueryProcessRPCStats();
 
 void Usage()
index 80f132cd5a9753c72845b00ec85b4e33dcec0055..6c5f91f37154c291fea19dd98dee10f1acb00b0a 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /* Test driver for admin functions. */
@@ -44,6 +46,11 @@ RCSID("$Header$");
 
 void *cellHandle;
 void *tokenHandle;
+#ifdef AFS_DARWIN_ENV
+pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* AFS_DARWIN_ENV */
 
 /*
  * Before processing any command, process the common arguments and
index efbc760bbc88dbb2a3c3d82f1c4a1a5e79b039d2..32562169e49ab4dd8e3a11430c5807bdb3ef4c39 100644 (file)
@@ -1,4 +1,5 @@
 #/* Copyright (C) 1995, 1989 Transarc Corporation - All rights reserved */
+#/* Portions Copyright (c) 2003 Apple Computer, Inc. */
 # $Header$
 # 
 # MakefileProto for Digital Unix systems
@@ -46,6 +47,8 @@ AFS_OS_NONFSOBJS = osi_vfsops.o
 KDEFS=
 DBUG = 
 DEFINES= -D_KERNEL -DKERNEL -DKERNEL_PRIVATE -DDIAGNOSTIC -DUSE_SELECT -DMACH_USER_API -DMACH_KERNEL
+<ppc_darwin_70>
+KOPTS=-static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch 
 <ppc_darwin_60>
 KOPTS=-no-cpp-precomp -static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch 
 <ppc_darwin_14 ppc_darwin_13 ppc_darwin_12>
diff --git a/src/libafs/afs.ppc_darwin_70.plist.in b/src/libafs/afs.ppc_darwin_70.plist.in
new file mode 100644 (file)
index 0000000..09fb063
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>English</string>
+       <key>CFBundleExecutable</key>
+       <string>afs</string>
+       <key>CFBundleIdentifier</key>
+       <string>org.openafs.filesystems.afs</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string>afs</string>
+       <key>CFBundlePackageType</key>
+       <string>KEXT</string>
+       <key>CFBundleShortVersionString</key>
+       <string>1.2.10</string>
+       <key>CFBundleSignature</key>
+       <string>????</string>
+       <key>CFBundleVersion</key>
+       <string>1.2.10</string>
+       <key>OSBundleLibraries</key>
+       <dict>
+               <key>com.apple.kernel.bsd</key>
+               <string>6.9.9</string>
+               <key>com.apple.kernel.mach</key>
+               <string>6.9.9</string>
+       </dict>
+</dict>
+</plist>
index cc2fee5d17dd0167e6105dc06587fe49d87ad873..8abaadd2ba562b4e5cc8dd6935881a8b04c6c42e 100644 (file)
@@ -4,6 +4,8 @@
 # This software has been released under the terms of the IBM Public
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
+#
+# Portions Copyright (c) 2003 Apple Computer, Inc.
 
 # This is a pthread safe library containing rx, rxkad and des.
 
@@ -347,7 +349,7 @@ syscall.o: ${SYS}/syscall.s
                /usr/ccs/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
                as -o syscall.o syscall.ss;             \
                $(RM) syscall.ss;;                              \
-        sgi_* | ppc_darwin* ) \
+        sgi_* | *_darwin_* ) \
                 ${CC} ${CFLAGS} -c ${SYS}/syscall.s;;          \
         alpha_dux?? ) \
                ${AS} -P ${CFLAGS} -D_NO_PROTO -DMACH -DOSF -nostdinc -traditional -DASSEMBLER ${SYS}/syscall.s; \
index eaa044e7881d495a3eb7574bbb91123586a7c8ad..0c459c1b1601a5a4225aa78146803b58e261d5df 100644 (file)
@@ -4,6 +4,8 @@
 # This software has been released under the terms of the IBM Public
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
+#
+# Portions Copyright (c) 2003 Apple Computer, Inc.
 
 DEST=@DEST@
 TOP_INCDIR=@TOP_INCDIR@
@@ -67,7 +69,7 @@ process.o     : process.s process.c
                /lib/cpp -P -I${TOP_INCDIR} process.s >process.ss; \
                ${AS} -ahlns process.ss -o process.o >process.lst; \
                $(RM) process.ss ;; \
-       ppc_darwin* ) \
+       *_darwin_* ) \
                $(CC) -c ${XCFLAGS} -I${TOP_INCDIR} process.s;; \
        i386_fbsd* ) \
                /usr/bin/cpp -P process.fbsd.s > process.ss; \
diff --git a/src/packaging/MacOS/Makefile b/src/packaging/MacOS/Makefile
new file mode 100644 (file)
index 0000000..42cf315
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
+#
+# @APPLE_LICENSE_HEADER_START@
+# 
+# This file contains Original Code and/or Modifications of Original Code
+# as defined in and that are subject to the Apple Public Source License
+# Version 2.0 (the 'License'). You may not use this file except in
+# compliance with the License. Please obtain a copy of the License at
+# http://www.opensource.apple.com/apsl/ and read it before using this
+# file.
+# 
+# The Original Code and all software distributed under the License are
+# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+# Please see the License for the specific language governing rights and
+# limitations under the License.
+# 
+# @APPLE_LICENSE_HEADER_END@
+
+AFSINCLUDE = /Library/OpenAFS/Tools/include
+CFLAGS = -O -I$(AFSINCLUDE)
+LIBS = -framework Foundation
+ALL = afssettings
+
+all: $(ALL)
+
+afssettings : afssettings.m
+       cc $(CFLAGS) -o $@ $^ $(LIBS)
+
+clean:
+       @rm -f *.o $(ALL)
diff --git a/src/packaging/MacOS/OpenAFS.Description.plist b/src/packaging/MacOS/OpenAFS.Description.plist
new file mode 100644 (file)
index 0000000..d7c2cb8
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>IFPkgDescriptionDeleteWarning</key>
+       <string></string>
+       <key>IFPkgDescriptionDescription</key>
+       <string>Mac OS X version of OpenAFS client and server.</string>
+       <key>IFPkgDescriptionTitle</key>
+       <string>OpenAFS</string>
+       <key>IFPkgDescriptionVersion</key>
+       <string>1.2.10</string>
+</dict>
+</plist>
diff --git a/src/packaging/MacOS/OpenAFS.Info.plist b/src/packaging/MacOS/OpenAFS.Info.plist
new file mode 100644 (file)
index 0000000..c50b198
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleGetInfoString</key>
+       <string>OpenAFS 1.2.10</string>
+       <key>CFBundleIdentifier</key>
+       <string>org.openafs.OpenAFS.pkg</string>
+       <key>CFBundleName</key>
+       <string>OpenAFS</string>
+       <key>CFBundleShortVersionString</key>
+       <string>1.2.10</string>
+       <key>IFMajorVersion</key>
+       <integer>1</integer>
+       <key>IFMinorVersion</key>
+       <integer>2</integer>
+       <key>IFPkgFlagAllowBackRev</key>
+       <false/>
+       <key>IFPkgFlagAuthorizationAction</key>
+       <string>RootAuthorization</string>
+       <key>IFPkgFlagDefaultLocation</key>
+       <string>/</string>
+       <key>IFPkgFlagInstallFat</key>
+       <false/>
+       <key>IFPkgFlagIsRequired</key>
+       <false/>
+       <key>IFPkgFlagRelocatable</key>
+       <false/>
+       <key>IFPkgFlagRestartAction</key>
+       <string>RecommendedRestart</string>
+       <key>IFPkgFlagRootVolumeOnly</key>
+       <true/>
+       <key>IFPkgFlagUpdateInstalledLanguages</key>
+       <false/>
+       <key>IFPkgFlagUseUserMask</key>
+       <false/>
+       <key>IFPkgFormatVersion</key>
+       <real>0.10000000149011612</real>
+</dict>
+</plist>
index 82f2534b799807f9dddf0b574b8b75c95dfa43c3..8987bb8dc56a2e06cb87c4d786026b084d812ff4 100644 (file)
@@ -1,10 +1,24 @@
 #!/bin/sh
+# Portions Copyright (c) 2003 Apple Computer, Inc.  All rights reserved.
 if [ -d /afs -a ! -h /afs ]; then
    rmdir /afs
 fi
-mkdir -p /Network/afs
-if [ ! -h /afs ]; then
-  ln -s /Network/afs /afs
+majorvers=`uname -r | sed 's/\..*//'`
+if [ $majorvers -ge 7 ]; then
+  # /Network is now readonly, so put AFS in /afs; make sure /afs is a directory
+  if [ -e /afs ]; then
+    if [ -h /afs -o ! -d /afs ]; then
+      rm -f /afs
+      mkdir /afs
+    fi
+  else
+    mkdir /afs
+  fi
+else
+  mkdir -p /Network/afs
+  if [ ! -h /afs ]; then
+    ln -s /Network/afs /afs
+  fi
 fi
 
 cd /var/db/openafs/etc
@@ -49,3 +63,13 @@ if [ -z "$done" ]; then
     cp CellServDB.master CellServDB
   fi
 fi
+
+if [ $majorvers -ge 7 ]; then
+  # make config/settings.plist if it doesn't exist
+  if [ ! -e config/settings.plist -a -e config/settings.plist.orig ]; then
+    cp config/settings.plist.orig config/settings.plist
+  fi
+elif [ -e config/afssettings ]; then
+  # turn off execution of afssettings
+  chmod a-x config/afssettings
+fi
diff --git a/src/packaging/MacOS/afssettings.m b/src/packaging/MacOS/afssettings.m
new file mode 100644 (file)
index 0000000..c1e647a
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+#import <Foundation/Foundation.h>
+#import <stdio.h>
+#import <err.h>
+#import <sys/types.h>
+#import <sys/mount.h>
+#import <sys/sysctl.h>
+#import <afs/sysctl.h>
+
+enum Type {
+    TypeNode = 0,
+    TypeNum,
+    TypeStr
+};
+
+typedef struct _setting {
+    NSString *key;
+    int selector;
+    enum Type type;
+    struct _setting *children;
+} Setting;
+
+Setting s_darwin_all[] = {
+    {@"RealModes", AFS_SC_DARWIN_ALL_REALMODES, TypeNum, NULL},
+    {NULL, 0, 0, NULL}
+};
+Setting s_darwin[] = {
+    {@"All", AFS_SC_DARWIN_ALL, TypeNode, s_darwin_all},
+    {@"Darwin12", AFS_SC_DARWIN_12, TypeNode, NULL},
+    {@"Darwin13", AFS_SC_DARWIN_13, TypeNode, NULL},
+    {@"Darwin14", AFS_SC_DARWIN_14, TypeNode, NULL},
+    {@"Darwin60", AFS_SC_DARWIN_60, TypeNode, NULL},
+    {@"Darwin70", AFS_SC_DARWIN_70, TypeNode, NULL},
+    {NULL, 0, 0, NULL}
+};
+Setting s_first[] = {
+    {@"All", AFS_SC_ALL, TypeNode, NULL},
+    {@"Darwin", AFS_SC_DARWIN, TypeNode, s_darwin},
+    {NULL, 0, 0, NULL}
+};
+Setting s_top = {NULL, -1, TypeNode, s_first};
+
+int oid[CTL_MAXNAME] = {CTL_VFS};
+NSString *path = @"/var/db/openafs/etc/config/settings.plist";
+
+char *oidString(int *oid, int len);
+void init(void);
+void walk(id obj, Setting *s, int level);
+
+void
+init(void)
+{
+    int oidmax[] = {CTL_VFS, VFS_GENERIC, VFS_MAXTYPENUM};
+    int oidvfs[] = {CTL_VFS, VFS_GENERIC, VFS_CONF, 0};
+    int max;
+    struct vfsconf conf;
+    size_t len;
+    int i;
+
+    len = sizeof(max);
+    if(sysctl(oidmax, 3, &max, &len, NULL, NULL) < 0)
+       err(1, "sysctl VFS_MAXTYPENUM");
+    for(i = max; --i >= 0; ) {
+       oidvfs[3] = i;
+       len = sizeof(conf);
+       if(sysctl(oidvfs, 4, &conf, &len, NULL, NULL) < 0)
+           continue;
+       if(strcmp("afs", conf.vfc_name) == 0) {
+           s_top.selector = conf.vfc_typenum;
+           break;
+       }
+    }
+    if(s_top.selector < 0)
+       errx(1, "AFS is not loaded");
+}
+
+char *
+oidString(int *oid, int len)
+{
+    static char buf[256];
+    char *cp = buf;
+
+    for(;;) {
+       sprintf(cp, "%d", *oid++);
+       if(--len <= 0)
+           break;
+       cp += strlen(cp);
+       *cp++ = '.';
+    }
+    return buf;
+}
+
+void
+walk(id obj, Setting *s, int level)
+{
+    Setting *child;
+    id newobj;
+    int intval;
+    const char *cp;
+    int level1 = level + 1;
+
+    oid[level] = s->selector;
+    switch(s->type) {
+      case TypeNode:
+       for(child = s->children; child->key; child++) {
+           if(child->type == TypeNode && !child->children)
+               continue;
+           newobj = [obj objectForKey: child->key];
+           if(newobj)
+               walk(newobj, child, level1);
+       }
+       break;
+      case TypeNum:
+       intval = [obj intValue];
+       if(sysctl(oid, level1, NULL, NULL, &intval, sizeof(intval)) < 0)
+           err(1, "sysctl %s => %d", oidString(oid, level1), intval);
+       break;
+      case TypeStr:
+       cp = [obj UTF8String];
+       if(sysctl(oid, level1, NULL, NULL, (void *)cp, strlen(cp)) < 0)
+           err(1, "sysctl %s => %s", oidString(oid, level1), cp);
+       break;
+    }
+}
+
+main()
+{
+    NSData *plistData;
+    id plist;
+    NSString *error;
+    NSPropertyListFormat format;
+    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+
+    init();
+    plistData = [NSData dataWithContentsOfFile: path];
+    if(plistData) {
+       plist = [NSPropertyListSerialization propertyListFromData: plistData
+         mutabilityOption: NSPropertyListImmutable
+         format: &format
+         errorDescription: &error
+       ];
+       if(plist)
+           walk(plist, &s_top, 1);
+       else
+           errx(1, "%s: %s", [path UTF8String], [error UTF8String]);
+    }
+
+    [pool release];
+    return 0;
+}
index 183a7e57639a245a563065d89e66148af0739f85..efe482b9a5cb81d282a07e0a0550e9a7951ff3db 100644 (file)
@@ -1,4 +1,5 @@
 #!/bin/sh
+# Portions Copyright (c) 2003 Apple Computer, Inc.  All rights reserved.
 
 if [ -z "$1" ]; then
    echo Usage: buildpkg binary-dir
@@ -6,15 +7,28 @@ if [ -z "$1" ]; then
 fi
 BINDEST=$1
 RESSRC=`pwd`
-if [ ! -f /usr/bin/package ]; then
-   echo "/usr/bin/package does not exist. Please run this script on a MacOS X system"
-  echo "with the BSD subsystem installed"
-  exit 1
-fi
-if grep -q 'set resDir = ""' /usr/bin/package ; then
-   echo /usr/bin/package is buggy.
-   echo remove the line \''set resDir = ""'\' from /usr/bin/package and try again
-   exit 1
+majorvers=`uname -r | sed 's/\..*//'`
+if [ $majorvers -ge 7 ]; then
+    SEP=:
+    package=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
+    if [ ! -x $package ]; then
+       echo "PackageMaker does not exist. Please run this script on a MacOS X system"
+      echo "with the DeveloperTools package installed"
+      exit 1
+    fi
+else
+    SEP=.
+    package=/usr/bin/package
+    if [ ! -f $package ]; then
+       echo "$package does not exist. Please run this script on a MacOS X system"
+      echo "with the BSD subsystem installed"
+      exit 1
+    fi
+    if grep -q 'set resDir = ""' $package ; then
+       echo $package is buggy.
+       echo remove the line \''set resDir = ""'\' from $package and try again
+       exit 1
+    fi
 fi
 
 if [ -x /usr/bin/curl ]; then
@@ -54,22 +68,21 @@ rm -rf pkgroot pkgres
 mkdir -p $PKGROOT $PKGRES
 
 mkdir $PKGROOT/Library
-chown -R root.admin $PKGROOT
+chown -R root${SEP}admin $PKGROOT
 chmod -R 775 $PKGROOT
 mkdir $PKGROOT/Library/OpenAFS $PKGROOT/Library/OpenAFS/Tools
 cd $BINDEST
 pax -rw * $PKGROOT/Library/OpenAFS/Tools
 cd $RESSRC
-mkdir $PKGROOT/Library
 mkdir $PKGROOT/Library/StartupItems 
 mkdir $PKGROOT/Library/StartupItems/OpenAFS
 cp $BINDEST/root.client/usr/vice/etc/afs.rc  $PKGROOT/Library/StartupItems/OpenAFS/OpenAFS
 chmod a+x $PKGROOT/Library/StartupItems/OpenAFS/OpenAFS
 cp $BINDEST/root.client/usr/vice/etc/StartupParameters.plist  $PKGROOT/Library/StartupItems/OpenAFS/StartupParameters.plist
-chown -R root.admin $PKGROOT/Library
+chown -R root${SEP}admin $PKGROOT/Library
 chmod -R o-w $PKGROOT/Library
 chmod -R g+w $PKGROOT/Library
-chown -R root.wheel $PKGROOT/Library/OpenAFS/Tools
+chown -R root${SEP}wheel $PKGROOT/Library/OpenAFS/Tools
 chmod -R og-w $PKGROOT/Library/OpenAFS/Tools
 
 mkdir $PKGROOT/private $PKGROOT/private/var $PKGROOT/private/var/db
@@ -77,14 +90,22 @@ mkdir $PKGROOT/private/var/db/openafs $PKGROOT/private/var/db/openafs/cache
 mkdir $PKGROOT/private/var/db/openafs/etc $PKGROOT/private/var/db/openafs/etc/config
 cp $RESSRC/CellServDB $PKGROOT/private/var/db/openafs/etc/CellServDB.master
 echo andrew.cmu.edu > $PKGROOT/private/var/db/openafs/etc/ThisCell.sample
-echo /Network/afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
+if [ $majorvers -ge 7 ]; then
+    echo /afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
+    make AFSINCLUDE=$BINDEST/include
+    cp afssettings $PKGROOT/private/var/db/openafs/etc/config
+    cp settings.plist $PKGROOT/private/var/db/openafs/etc/config/settings.plist.orig
+    make clean
+else
+    echo /Network/afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
+fi
 #echo '-stat 2000 -dcache 800 -daemons 3 -volumes 70 -rootvol root.afs.local' > $PKGROOT/private/var/db/openafs/etc/config/afsd.options.sample
 
 strip -X -S $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
 
 cp -RP $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext $PKGROOT/private/var/db/openafs/etc
 
-chown -R root.wheel $PKGROOT/private
+chown -R root${SEP}wheel $PKGROOT/private
 chmod -R og-w $PKGROOT/private
 chmod  og-rx $PKGROOT/private/var/db/openafs/cache
 
@@ -102,26 +123,41 @@ done
 
 ln -s ../../Library/OpenAFS/Tools/root.client/usr/vice/etc/afsd $PKGROOT/usr/sbin/afsd
 
-chown -R root.wheel $PKGROOT/usr
+chown -R root${SEP}wheel $PKGROOT/usr
 chmod -R og-w $PKGROOT/usr
 
-cp License.rtf ReadMe.rtf OpenAFS.post_install OpenAFS.pre_upgrade $PKGRES
-cp OpenAFS.post_install $PKGRES/OpenAFS.post_upgrade
-chmod a+x $PKGRES/OpenAFS.post_install $PKGRES/OpenAFS.post_upgrade $PKGRES/OpenAFS.pre_upgrade
+if [ $majorvers -ge 7 ]; then
+    cp OpenAFS.post_install $PKGRES/postinstall
+    cp OpenAFS.pre_upgrade $PKGRES/preupgrade
+    cp OpenAFS.post_install $PKGRES/postupgrade
+    chmod a+x $PKGRES/postinstall $PKGRES/postupgrade $PKGRES/preupgrade
+else
+    cp OpenAFS.post_install OpenAFS.pre_upgrade $PKGRES
+    cp OpenAFS.post_install $PKGRES/OpenAFS.post_upgrade
+    chmod a+x $PKGRES/OpenAFS.post_install $PKGRES/OpenAFS.post_upgrade $PKGRES/OpenAFS.pre_upgrade
+fi
+cp License.rtf ReadMe.rtf $PKGRES
 cp csrvdbmerge.pl $PKGRES
 chmod a+x $PKGRES/csrvdbmerge.pl
 cp CellServDB.list $PKGRES
-chown -R root.wheel $PKGRES
+chown -R root${SEP}wheel $PKGRES
 rm -rf OpenAFS.pkg
-echo /usr/bin/package $PKGROOT OpenAFS.info -r $PKGRES
-/usr/bin/package $PKGROOT OpenAFS.info -r $PKGRES
-#old versions of package didn't handle this properly
-if [ ! -r OpenAFS.pkg/Contents ]; then
-       mkdir OpenAFS.pkg/Contents OpenAFS.pkg/Contents/Resources
-       mv OpenAFS.pkg/OpenAFS.* OpenAFS.pkg/Contents/Resources
-       mv OpenAFS.pkg/*.rtf OpenAFS.pkg/Contents/Resources
-       mv OpenAFS.pkg/csrvdbmerge.pl OpenAFS.pkg/Contents/Resources
-       mv OpenAFS.pkg/CellServDB* OpenAFS.pkg/Contents/Resources
+if [ $majorvers -ge 7 ]; then
+    echo $package -build -p $RESSRC/OpenAFS.pkg -f $PKGROOT -r $PKGRES \
+       -i OpenAFS.Info.plist -d OpenAFS.Description.plist
+    $package -build -p $RESSRC/OpenAFS.pkg -f $PKGROOT -r $PKGRES \
+       -i OpenAFS.Info.plist -d OpenAFS.Description.plist
+else
+    echo $package $PKGROOT OpenAFS.info -r $PKGRES
+    $package $PKGROOT OpenAFS.info -r $PKGRES
+    #old versions of package didn't handle this properly
+    if [ ! -r OpenAFS.pkg/Contents ]; then
+           mkdir OpenAFS.pkg/Contents OpenAFS.pkg/Contents/Resources
+           mv OpenAFS.pkg/OpenAFS.* OpenAFS.pkg/Contents/Resources
+           mv OpenAFS.pkg/*.rtf OpenAFS.pkg/Contents/Resources
+           mv OpenAFS.pkg/csrvdbmerge.pl OpenAFS.pkg/Contents/Resources
+           mv OpenAFS.pkg/CellServDB* OpenAFS.pkg/Contents/Resources
+    fi
 fi
 
 rm -rf pkgroot pkgres
diff --git a/src/packaging/MacOS/settings.plist b/src/packaging/MacOS/settings.plist
new file mode 100644 (file)
index 0000000..36e8977
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>Darwin</key>
+       <dict>
+               <key>All</key>
+               <dict>
+                       <key>RealModes</key>
+                       <false/>
+               </dict>
+       </dict>
+</dict>
+</plist>
index 4a1028d56da1ca6edc793481e284a4543f2810bb..f65a11681229910776ec00464fac92a38ea8e792 100644 (file)
@@ -4,6 +4,8 @@
 # This software has been released under the terms of the IBM Public
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
+#
+# Portions Copyright (c) 2003 Apple Computer, Inc.
 DEST=@DEST@
 TOP_INCDIR=@TOP_INCDIR@
 TOP_LIBDIR=@TOP_LIBDIR@
@@ -132,7 +134,7 @@ readpwd.o: readpwd.c ${LINCLS} AFS_component_version_number.c
 
 testpt: testpt.o libprot.a ${TOP_LIBDIR}/libcmd.a $(LIBS)
        case "$(SYS_NAME)" in \
-       ppc_darwin_12 ) \
+       *_darwin_12 ) \
                $(CC) ${CFLAGS} -o testpt testpt.o ${TOP_LIBDIR}/libcmd.a libprot.a $(LIBS) ;; \
        * ) \
                $(CC) ${CFLAGS} -o testpt testpt.o -lm ${TOP_LIBDIR}/libcmd.a libprot.a $(LIBS) ${XLIBS} ;; \
index 1e1713fda130473bdf2bd0522942cbe7c5c33c66..c0e52b4e69474d42387c00d93ce0bf5353b41cb0 100644 (file)
@@ -32,6 +32,8 @@
  * rpc_scan.c, Scanner for the RPC protocol compiler 
  * Copyright (C) 1987, Sun Microsystems, Inc. 
  */
+
+/* Portions Copyright (c) 2003 Apple Computer, Inc. */
 #include <afsconfig.h>
 #include <afs/param.h>
 
@@ -208,6 +210,10 @@ get_token(tokp)
                                if (commenting) {
                                        break;
                                } else if (cppline(curline)) {
+#if defined(AFS_DARWIN_ENV)
+                                       if (strncmp(curline, "#pragma", 7) == 0)
+                                               continue;
+#endif /* defined(AFS_DARWIN_ENV) */
                                        docppline(curline, &linenum, 
                                                  &infilename);
                                } else if (directive(curline)) {
index 0b23f9e298409832063ce5452d0e67ae59162fe7..4640d7a2fc8e9ba55e075a4451f1e683e344c5ca 100644 (file)
@@ -4,6 +4,8 @@
 # This software has been released under the terms of the IBM Public
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
+#
+# Portions Copyright (c) 2003 Apple Computer, Inc.
 
 # */
 
@@ -37,7 +39,7 @@ CFLAGS=${OPTMZ} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I. ${XCFLAGS}
 INCLS=${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
        rxkad.h v5gen.h
 
-OBJS=rxkad_client.o rxkad_server.o rxkad_common.o ticket.o rxkad_errs.o \
+OBJS=rxkad_client.o rxkad_server.o rxkad_common.o rxkad_errs.o \
        fcrypt.o crypt_conn.o ticket.o ticket5.o crc.o
 
 fc_test_OBJS=fc_test.o
index 55b55b8530b37ba99ce5c89c8e20edf7dc10c940..adbc781064c7ce915046ec6b8a467518f3391ee4 100644 (file)
@@ -9,6 +9,8 @@ LIBAFSRPCMINOR=0
 # This software has been released under the terms of the IBM Public
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
+#
+# Portions Copyright (c) 2003 Apple Computer, Inc.
 
 # This is a pthread safe library containing rx, rxkad and des.
 
@@ -355,7 +357,7 @@ syscall.o: ${SYS}/syscall.s
                /usr/ccs/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
                as -o syscall.o syscall.ss;             \
                $(RM) syscall.ss;;                              \
-        sgi_* | ppc_darwin* ) \
+        sgi_* | *_darwin_* ) \
                 ${CC} ${CFLAGS} -c ${SYS}/syscall.s;;          \
         alpha_dux?? ) \
                ${AS} -P ${CFLAGS} -D_NO_PROTO -DMACH -DOSF -nostdinc -traditional -DASSEMBLER ${SYS}/syscall.s; \
index f144aa216a3a218ec20f2c74056bf6e47e26a47c..4ae50f3baa00a0dbdceff0b47003e888b1329953 100644 (file)
@@ -4,6 +4,8 @@
 # This software has been released under the terms of the IBM Public
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
+#
+# Portions Copyright (c) 2003 Apple Computer, Inc.
 
 # System calls.
 
@@ -102,7 +104,7 @@ syscall.o: syscall.s
                /usr/ccs/lib/cpp  ${SFLAGS} syscall.s syscall.ss; \
                as -o syscall.o syscall.ss;             \
                $(RM) syscall.ss;;                              \
-        sgi_* |ppc_darwin* ) \
+        sgi_* |*_darwin_* ) \
                 ${CC} ${CFLAGS} -c syscall.s;;          \
         alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux?? ) \
                ${AS} -P ${CFLAGS} -D_NO_PROTO -DMACH -DOSF -nostdinc -traditional -DASSEMBLER syscall.s; \
index 3b624ad50fd30179fe4d2026514c783e79ccb8e4..cd37dcd6602bfb4c69aa0c5f7e4ad683fb9c46c8 100644 (file)
@@ -4,6 +4,8 @@
 # This software has been released under the terms of the IBM Public
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
+#
+# Portions Copyright (c) 2003 Apple Computer, Inc.
 
 DEST=@DEST@
 TOP_INCDIR=@TOP_INCDIR@
@@ -55,7 +57,8 @@ UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o volparse.o
 DIROBJS=buffer.o dir.o salvage.o
 
 VOLOBJS= vnode.o volume.o vutil.o partition.o fssync.o purge.o \
-        clone.o devname.o common.o ihandle.o listinodes.o namei_ops.o
+        clone.o devname.o common.o ihandle.o listinodes.o namei_ops.o \
+        ${EXTRA_VLIBOBJS}
 
 FSINTOBJS= afsaux.o afscbint.cs.o afsint.ss.o afsint.xdr.o
 
@@ -167,6 +170,10 @@ nuke.o: ${VOL}/nuke.c
 devname.o: ${VOL}/devname.c
        ${COMPILE}
 
+# only for darwin
+fstab.o: ${VOL}/fstab.c
+       ${COMPILE}
+
 common.o: ${VOL}/common.c
        ${COMPILE}
 
index 416feeb5064cb39bc10d635d9b74f68cec0e46e8..c56a8028d9a929f12665e995867ee940cb6c00a9 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 #include <afsconfig.h>
@@ -22,9 +24,53 @@ RCSID("$Header$");
  */
 /* This table needs to be in lexical order to efficiently map back from
  * characters to the numerical value.
+ *
+ * In c_reverse, we use 99 to represent an illegal value, rather than -1
+ * which would assume "char" is signed.
  */
+#ifdef AFS_DARWIN_ENV
+static char c_xlate[80] =
+        "!\"#$%&()*+,-0123456789:;<=>?@[]^_`abcdefghijklmnopqrstuvwxyz{|}~";
+static char c_reverse[] = {
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99,  0,  1,  2,  3,  4,  5, 99,  6,  7,  8,  9, 10, 11, 99, 99,
+    12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+    28, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 29, 99, 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, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99
+};
+#else /* AFS_DARWIN_ENV */
 static char c_xlate[80] =
        "+=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+static char c_reverse[] = {
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,  0, 99, 99, 99, 99,
+     2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 99, 99, 99,  1, 99, 99,
+    99, 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, 99, 99, 99, 99, 99,
+    99, 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, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99
+};
+#endif /* AFS_DARWIN_ENV */
 
 /* int_to_base64
  * Create a base 64 string representation of a number.
@@ -57,7 +103,6 @@ char *int64_to_flipbase64(lb64_string_t s, u_int64_t a)
 }
 
 
-/* Mapping: +=0, ==1, 0-9 = 2-11, A-Z = 12-37, a-z = 38-63 */
 #ifdef AFS_64BIT_ENV
 afs_int64 flipbase64_to_int64(char *s)
 #else
@@ -73,20 +118,13 @@ int64_t flipbase64_to_int64(char *s)
 #endif
     int shift;
 
-    for (shift = 0; *s; s++, shift += 6) {
-       if (*s == '+') n = 0;
-       else if (*s == '=') n = 1;
-       else if (*s <= '9') {
-           n = 2 + (int)(*s - '0');
-       }
-       else if (*s <= 'Z') {
-           n = 12 + (int)(*s - 'A');
-       }
-       else if (*s <= 'z') {
-           n = 38 + (int)(*s - 'a');
-       }
+    for (shift = 0; *s; s++) {
+       n = c_reverse[*(unsigned char *)s];
+       if (n >= 64)    /* should never happen */
+           continue;
        n <<= shift;
        result |= n ;
+       shift += 6;
     }
     return result;
 }
index 6d8a9f9b2947462d52982ceb4c20d547ad8b8b76..9f41e3dc5bd21f1a7fe18984080e9bc2165bcd78 100644 (file)
@@ -5,8 +5,13 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
+#include <afsconfig.h>
+#include <afs/param.h>
+
 #define _POSIX_PTHREAD_SEMANTICS
 #include <assert.h>
 #include <stdio.h>
 
 #include "pthread_nosigs.h"
 
+/*------------------------------------------------------------------------
+ * Under Darwin 6.x (including 7.0), sigwait() is broken, so we use
+ * sigsuspend() instead.  We also don't block signals we don't know
+ * about, so they should kill us, rather than us returning zero status.
+ *------------------------------------------------------------------------*/
+
 static pthread_t softsig_tid;
 static struct {
   void (*handler) (int);
   int pending;
+#if !defined(AFS_DARWIN60_ENV)
   int fatal;
+#endif /* !defined(AFS_DARWIN60_ENV) */
   int inited;
 } softsig_sigs[NSIG];
 
@@ -35,12 +48,17 @@ softsig_thread (void *arg)
   pthread_sigmask (SIG_BLOCK, &ss, &os);
   pthread_sigmask (SIG_SETMASK, &os, NULL);
   sigaddset (&ss, SIGUSR1);
+#if defined(AFS_DARWIN60_ENV)
+  pthread_sigmask (SIG_BLOCK, &ss, NULL);
+  sigdelset (&os, SIGUSR1);
+#else /* !defined(AFS_DARWIN60_ENV) */
   for (i = 0; i < NSIG; i++) {
     if (!sigismember(&os, i) && i != SIGSTOP && i != SIGKILL) {
       sigaddset(&ss, i);
       softsig_sigs[i].fatal = 1;
     }
   }
+#endif /* defined(AFS_DARWIN60_ENV) */
 
   while (1) {
     void (*h) (int) = NULL;
@@ -51,6 +69,10 @@ softsig_thread (void *arg)
     for (i = 0; i < NSIG; i++) {
       if (softsig_sigs[i].handler && !softsig_sigs[i].inited) {
        sigaddset(&ss, i);
+#if defined(AFS_DARWIN60_ENV)
+       pthread_sigmask (SIG_BLOCK, &ss, NULL);
+       sigdelset (&os, i);
+#endif /* defined(AFS_DARWIN60_ENV) */
        softsig_sigs[i].inited = 1;
       }
       if (softsig_sigs[i].pending) {
@@ -60,17 +82,29 @@ softsig_thread (void *arg)
       }
     }
     if (i == NSIG) {
+#if defined(AFS_DARWIN60_ENV)
+      sigsuspend (&os);
+#else /* !defined(AFS_DARWIN60_ENV) */
       sigwait (&ss, &sigw);
       if (sigw != SIGUSR1) {
        if (softsig_sigs[sigw].fatal)
          exit(0);
        softsig_sigs[sigw].pending=1;
       }
+#endif /* defined(AFS_DARWIN60_ENV) */
     } else if (h)
       h (i);
   }
 }
 
+#if defined(AFS_DARWIN60_ENV)
+static void
+softsig_usr1 (int signo)
+{
+  signal (SIGUSR1, softsig_usr1);
+}
+#endif /* defined(AFS_DARWIN60_ENV) */
+
 void
 softsig_init ()
 {
@@ -80,6 +114,9 @@ softsig_init ()
   rc = pthread_create (&softsig_tid, NULL, &softsig_thread, NULL);
   assert(0 == rc);
   AFS_SIGSET_RESTORE();
+#if defined(AFS_DARWIN60_ENV)
+  signal (SIGUSR1, softsig_usr1);
+#endif /* defined(AFS_DARWIN60_ENV) */
 }
 
 static void
index b14a84256bf50f95eddcc47999d3b6d5eb293983..5503c6bfd715db8e01eda9e64ba42cb51d69bfc7 100644 (file)
@@ -4,6 +4,8 @@
 # This software has been released under the terms of the IBM Public
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
+#
+# Portions Copyright (c) 2003 Apple Computer, Inc.
 
 DEST=@DEST@
 TOP_INCDIR=@TOP_INCDIR@
@@ -109,6 +111,11 @@ ${DEST}/root.server/usr/afs/bin/fileserver: fileserver
        @case ${SYS_NAME} in \
        alpha_dux4*|*linux*|rs_aix*|sgi_6*|sun*) \
        echo "Don't install fileserver for ${SYS_NAME}" ;; \
+       *_darwin_[1-6][0-9]) \
+       echo ${INSTALL} -ns $? $@ ; \
+       ${INSTALL} -ns $? $@ ;; \
+       *_darwin_*) \
+       echo "Don't install fileserver for ${SYS_NAME}" ;; \
        *) \
        echo ${INSTALL} -ns $? $@ ; \
        ${INSTALL} -ns $? $@ ;; \
@@ -127,6 +134,11 @@ ${DESTDIR}${afssrvlibexecdir}/fileserver: fileserver
        @case ${SYS_NAME} in \
        alpha_dux4*|*linux*|rs_aix*|sgi_6*|sun*) \
        echo "Don't install fileserver for ${SYS_NAME}" ;; \
+       *_darwin_[1-6][0-9]) \
+       echo ${INSTALL} -ns $? $@ ; \
+       ${INSTALL} -ns $? $@ ;; \
+       *_darwin_*) \
+       echo "Don't install fileserver for ${SYS_NAME}" ;; \
        *) \
        echo ${INSTALL} -ns $? $@ ; \
        ${INSTALL} -ns $? $@ ;; \
index e36f8564dd2183d0f549b271f21f0a5e7f922d49..e02c96f233b8f99e05d0b1c8dbd11b981c0aaf61 100644 (file)
@@ -4,6 +4,8 @@
 # This software has been released under the terms of the IBM Public
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
+#
+# Portions Copyright (c) 2003 Apple Computer, Inc.
 
 DEST=@DEST@
 TOP_INCDIR=@TOP_INCDIR@
@@ -42,7 +44,7 @@ PUBLICHEADERS=nfs.h vnode.h viceinode.h volume.h voldefs.h partition.h\
 
 VLIBOBJS=vnode.o volume.o vutil.o partition.o fssync.o purge.o \
         clone.o nuke.o devname.o listinodes.o common.o ihandle.o \
-        namei_ops.o
+        namei_ops.o ${EXTRA_VLIBOBJS}
 
 OBJECTS=${VLIBOBJS} physio.o vol-salvage.o vol-info.o 
 
diff --git a/src/vol/fstab.c b/src/vol/fstab.c
new file mode 100644 (file)
index 0000000..46e5801
--- /dev/null
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ * Copyright (c) 1980, 1988, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(AFS_DARWIN_ENV)
+/*-----------------------------------------------------------------------
+ * This version of fstab.c is intended to be used on Darwin systems to
+ * replace getfsent() and family.  It has been modified so that rather
+ * than read /etc/fstab, it calls getfsstat() to get the real list of
+ * mounted volumes.
+ *-----------------------------------------------------------------------*/
+
+#include <errno.h>
+#include <fstab.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/param.h>
+#include <sys/ucred.h>
+#include <sys/mount.h>
+
+#define        STDERR_FILENO   2
+
+static struct fstab _fs_fstab;
+static struct statfs *_fs_buf;
+static struct statfs *_fs_ptr;
+static int _fs_count;
+
+static error __P((int));
+static fstabscan __P((void));
+
+static
+fstabscan()
+{
+       if(_fs_count <= 0)
+               return(0);
+       _fs_fstab.fs_spec = _fs_ptr->f_mntfromname;
+       _fs_fstab.fs_file = _fs_ptr->f_mntonname;
+       _fs_fstab.fs_vfstype = _fs_ptr->f_fstypename;
+       _fs_fstab.fs_mntops = _fs_ptr->f_fstypename;    // no mount options given
+       _fs_fstab.fs_type = (_fs_ptr->f_flags & MNT_RDONLY) ? FSTAB_RO : FSTAB_RW;
+       _fs_fstab.fs_freq = 0;
+       _fs_fstab.fs_passno = 0;
+
+       _fs_ptr++;
+       _fs_count--;
+       return(1);
+}
+
+struct fstab *
+getfsent()
+{
+       if (!_fs_buf && !setfsent() || !fstabscan())
+               return((struct fstab *)NULL);
+       return(&_fs_fstab);
+}
+
+struct fstab *
+getfsspec(name)
+       register const char *name;
+{
+       if (setfsent())
+               while (fstabscan())
+                       if (!strcmp(_fs_fstab.fs_spec, name))
+                               return(&_fs_fstab);
+       return((struct fstab *)NULL);
+}
+
+struct fstab *
+getfsfile(name)
+       register const char *name;
+{
+       if (setfsent())
+               while (fstabscan())
+                       if (!strcmp(_fs_fstab.fs_file, name))
+                               return(&_fs_fstab);
+       return((struct fstab *)NULL);
+}
+
+setfsent()
+{
+       long bufsize;
+
+       if (_fs_buf) {
+               free(_fs_buf);
+               _fs_buf = NULL;
+       }
+       if((_fs_count = getfsstat(NULL, 0, MNT_WAIT)) < 0) {
+               error(errno);
+               return(0);
+       }
+       bufsize = (long)_fs_count * sizeof(struct statfs);
+       if((_fs_buf = malloc(bufsize)) == NULL) {
+               error(errno);
+               return(0);
+       }
+       if(getfsstat(_fs_buf, bufsize, MNT_WAIT) < 0) {
+               error(errno);
+               return(0);
+       }
+       _fs_ptr = _fs_buf;
+       return(1);
+}
+
+void
+endfsent()
+{
+       if (_fs_buf) {
+               free(_fs_buf);
+               _fs_buf = NULL;
+       }
+       _fs_count = 0;
+}
+
+static
+error(err)
+       int err;
+{
+       char *p;
+
+       (void)write(STDERR_FILENO, "fstab: ", 7);
+       (void)write(STDERR_FILENO, _PATH_FSTAB, sizeof(_PATH_FSTAB) - 1);
+       (void)write(STDERR_FILENO, ": ", 1);
+       p = strerror(err);
+       (void)write(STDERR_FILENO, p, strlen(p));
+       (void)write(STDERR_FILENO, "\n", 1);
+}
+#endif /* defined(AFS_DARWIN_ENV) */
index d42bc05ae1c70fbb0d199949171fd4e4ce047ca3..9e7ace8c25c8b084959c266bfb9bb7a74025a981 100644 (file)
@@ -5,6 +5,8 @@
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Portions Copyright (c) 2003 Apple Computer, Inc.
  */
 
 /*
@@ -1033,6 +1035,9 @@ void VLockPartition_r(char *name)
     unsigned int       *globalMask;
     int                        globalMaskIndex;
 #endif /* defined(AFS_HPUX_ENV) */
+#if defined(AFS_DARWIN_ENV)
+    char lockfile[MAXPATHLEN];
+#endif /* defined(AFS_DARWIN_ENV) */
     
     if (!dp) return;   /* no partition, will fail later */
     if (dp->lock_fd != -1) return;
@@ -1040,13 +1045,21 @@ void VLockPartition_r(char *name)
 #if    defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV)
     partitionName = dp->devName;
     code = O_RDWR;
+#elif defined(AFS_DARWIN_ENV)
+    strlcpy((partitionName = lockfile), dp->name, sizeof(lockfile));
+    strlcat(lockfile, "/.lock.afs", sizeof(lockfile));
+    code = O_RDONLY | O_CREAT;
 #else
     partitionName = dp->name;
     code = O_RDONLY;
 #endif
 
     for (retries=25; retries; retries--) {
+#if defined(AFS_DARWIN_ENV)
+        dp->lock_fd = open(partitionName, code, 0600);
+#else /* ! defined(AFS_DARWIN_ENV) */
         dp->lock_fd = open(partitionName, code);
+#endif /* defined(AFS_DARWIN_ENV) */
         if (dp->lock_fd != -1) break;
         pausing.tv_sec = 0;
         pausing.tv_usec = 500000;