From: Russ Allbery Date: Mon, 20 Aug 2007 05:25:23 +0000 (+0000) Subject: * Switch to quilt for managing patches to the upstream source. X-Git-Tag: debian/1.4.4.dfsg1-7~9 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=7e7d860bc972651672701d7d91aa004f594b7f5e;p=packages%2Fo%2Fopenafs.git * Switch to quilt for managing patches to the upstream source. --- diff --git a/Makefile.in b/Makefile.in index e94284d18..7f2f42c42 100644 --- a/Makefile.in +++ b/Makefile.in @@ -515,6 +515,8 @@ libafsauthent: ubik auth kauth libafsrpc # pthread based user space RX library shlibafsrpc: rx rxkad des case ${SYS_NAME} in \ + amd64_linux24) \ + echo Skipping shlibafsrpc for amd64_linux24 ;; \ alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ ${COMPILE_PART1} shlibafsrpc ${COMPILE_PART2} ;; \ *) \ @@ -523,6 +525,8 @@ shlibafsrpc: rx rxkad des shlibafsauthent: ubik auth kauth shlibafsrpc case ${SYS_NAME} in \ + amd64_linux24) \ + echo Skipping shlibafsauthent for amd64_linux24 ;; \ alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ ${COMPILE_PART1} shlibafsauthent ${COMPILE_PART2} ;; \ *) \ diff --git a/acinclude.m4 b/acinclude.m4 index d7ee559da..8209ee634 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -611,7 +611,6 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_FS_STRUCT_FOP_HAS_FLOCK LINUX_KERNEL_LINUX_SYSCALL_H LINUX_KERNEL_LINUX_SEQ_FILE_H - LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG LINUX_KERNEL_SELINUX LINUX_KERNEL_SOCK_CREATE LINUX_KERNEL_PAGE_FOLLOW_LINK @@ -627,7 +626,6 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TGID LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO - LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_THREAD_INFO LINUX_EXPORTS_TASKLIST_LOCK LINUX_GET_SB_HAS_STRUCT_VFSMOUNT LINUX_STATFS_TAKES_DENTRY @@ -769,9 +767,6 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then AC_DEFINE(RECALC_SIGPENDING_TAKES_VOID, 1, [define if your recalc_sigpending takes void]) fi - if test "x$ac_cv_linux_kernel_posix_lock_file_wait_arg" = "xyes" ; then - AC_DEFINE(POSIX_LOCK_FILE_WAIT_ARG, 1, [define if your linux kernel uses 3 arguments for posix_lock_file]) - fi if test "x$ac_cv_linux_kernel_is_selinux" = "xyes" ; then AC_DEFINE(LINUX_KERNEL_IS_SELINUX, 1, [define if your linux kernel uses SELinux features]) fi @@ -817,9 +812,6 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) if test "x$ac_cv_linux_sched_struct_task_struct_has_todo" = "xyes"; then AC_DEFINE(STRUCT_TASK_STRUCT_HAS_TODO, 1, [define if your struct task_struct has todo]) fi - if test "x$ac_cv_linux_sched_struct_task_struct_has_thread_info" = "xyes"; then - AC_DEFINE(STRUCT_TASK_STRUCT_HAS_THREAD_INFO, 1, [define if your struct task_struct has thread_info]) - fi if test "x$ac_cv_linux_get_sb_has_struct_vfsmount" = "xyes"; then AC_DEFINE(GET_SB_HAS_STRUCT_VFSMOUNT, 1, [define if your get_sb_nodev needs a struct vfsmount argument]) fi diff --git a/debian/changelog b/debian/changelog index 0ce09616e..304ee3ae2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ openafs (1.4.4.dfsg1-7) unstable; urgency=low + * Switch to quilt for managing patches to the upstream source. * Restructure the source for the module package. The build files for the module build are now in debian/module in the source package and there is a completely separate rules file. This way, the module build diff --git a/debian/patches/README b/debian/patches/README deleted file mode 100644 index d337dfab9..000000000 --- a/debian/patches/README +++ /dev/null @@ -1,9 +0,0 @@ -This directory contains patches relative to the upstream OpenAFS source. -It is not used automatically as part of the build process and is not -guaranteed to be completely up-to-date; it is intended as documentation of -significant divergences, a place to store patches that should be sent -upstream, and a place to document the current status of patches. - -Simple Debian-specific changes that aren't of interest to upstream will -not be included here, such as updating config.{guess,sub} or changing -paths to fit with the FHS. diff --git a/debian/patches/amd64-syscall-probe b/debian/patches/amd64-syscall-probe new file mode 100644 index 000000000..e658dc2eb --- /dev/null +++ b/debian/patches/amd64-syscall-probe @@ -0,0 +1,111 @@ +Patch the syscall probing to check for readability as well as writability, +fixing problems with the latest AMD64 kernel. Pulled from upstream +stable branch, will be in 1.4.5. + +--- openafs.orig/src/afs/LINUX/osi_probe.c ++++ openafs/src/afs/LINUX/osi_probe.c +@@ -59,6 +59,7 @@ + #include "afsincludes.h" + #endif + #include ++#include + #ifdef CONFIG_H_EXISTS + #include + #endif +@@ -153,6 +154,7 @@ + * 0x0010 - detail - check_harder + * 0x0020 - detail - check_harder/zapped + * 0x0040 - automatically ignore setgroups and afs_syscall ++ * 0x0080 - detail - check_table_readable + */ + static int probe_debug = 0x41; + #ifdef module_param +@@ -298,6 +300,10 @@ + int debug_ignore_NR[4]; /* syscalls to ignore for debugging */ + } probectl; + ++#if defined(AFS_I386_LINUX26_ENV) || defined(AFS_AMD64_LINUX26_ENV) ++static int check_access(unsigned long, int); ++static int check_table_readable(probectl *, PROBETYPE *); ++#endif + + + /********** Probing Configuration: sys_call_table **********/ +@@ -940,6 +946,11 @@ + PROBETYPE *x; + int i, j; + ++#if defined(AFS_I386_LINUX26_ENV) || defined(AFS_AMD64_LINUX26_ENV) ++ i = check_table_readable(P, ptr); ++ if (i >= 0) return i; ++#endif ++ + for (x = ptr, i = 0; i < _SS(NR_syscalls); i++, x++) { + #ifdef OSI_PROBE_DEBUG + if (probe_debug & 0x0040) { +@@ -1062,6 +1073,11 @@ + unsigned long ip1; + int i, s; + ++#if defined(AFS_I386_LINUX26_ENV) || defined(AFS_AMD64_LINUX26_ENV) ++ i = check_table_readable(P, p); ++ if (i >= 0) return 0; ++#endif ++ + /* Check zapped syscalls */ + for (i = 1; i < P->n_zapped_syscalls; i++) { + if (p[_SS(P->zapped_syscalls[i])] != p[_SS(P->zapped_syscalls[0])]) { +@@ -1349,7 +1365,7 @@ + } + + #if defined(AFS_I386_LINUX26_ENV) || defined(AFS_AMD64_LINUX26_ENV) +-static int check_writable(unsigned long address) ++static int check_access(unsigned long address, int mode) + { + pgd_t *pgd = pgd_offset_k(address); + #ifdef PUD_SIZE +@@ -1374,10 +1390,34 @@ + pte = (pte_t *)pmd; + else + pte = pte_offset_kernel(pmd, address); +- if (pte_none(*pte) || !pte_present(*pte) || !pte_write(*pte)) ++ if (pte_none(*pte) || !pte_present(*pte)) ++ return 0; ++ if (mode && !pte_write(*pte)) + return 0; + return 1; + } ++ ++static int check_table_readable(probectl *P, PROBETYPE *ptr) ++{ ++ PROBETYPE *next_page; ++ int i = 0, delta; ++ ++ while (i < _SS(NR_syscalls)) { ++ next_page = (PROBETYPE *)PAGE_ALIGN((unsigned long)(ptr+1)); ++ delta = next_page - ptr; ++ if (!check_access((unsigned long)ptr, 0)) { ++#ifdef OSI_PROBE_DEBUG ++ if (probe_debug & 0x0080) ++ printk("<7>osi_probe: %s 0x%016lx not readable; delta=0x%lx\n", ++ P->symbol, (unsigned long)ptr, delta); ++#endif ++ return delta - 1; ++ } ++ ptr += delta; ++ i += delta; ++ } ++ return -1; ++} + #endif + + void *osi_find_syscall_table(int which) +@@ -1405,7 +1445,7 @@ + } + printk("Found %s at 0x%lx (%s)\n", P->desc, (unsigned long)answer, method); + #if defined(AFS_I386_LINUX26_ENV) || defined(AFS_AMD64_LINUX26_ENV) +- if (!check_writable((unsigned long)answer)) { ++ if (!check_access((unsigned long)answer, 1)) { + printk("Address 0x%lx is not writable.\n", (unsigned long)answer); + printk("System call hooks will not be installed; proceeding anyway\n"); + return 0; diff --git a/debian/patches/bos-permissions b/debian/patches/bos-permissions index d26193c59..cae2297fe 100644 --- a/debian/patches/bos-permissions +++ b/debian/patches/bos-permissions @@ -1,11 +1,12 @@ -Allow a broader range of permissions on /etc/openafs/server and -/etc/openafs/server-local because we use different permissions than -upstream. The /etc/openafs/server-local change would probably be -acceptable upstream. The /etc/openafs/server change isn't, since upstream -supports having bos create /usr/vice/etc as links to the ETC_DIRPATH. +Expect the server directory to be mode 0700 since that's where the AFS +KeyFile is stored. Allow the local directory to be mode 0755, since +there's no reason for it to be more restrictive. Allowing the server +directory to be mode 0700 causes problems upstream if people symlink the +client configuration to the server directory, which is recommended by +some documentation. ---- openafs-1.3.87.orig/src/bozo/bosoprocs.c -+++ openafs-1.3.87/src/bozo/bosoprocs.c +--- openafs.orig/src/bozo/bosoprocs.c ++++ openafs/src/bozo/bosoprocs.c @@ -1324,12 +1324,12 @@ struct bozo_bosEntryStats bozo_bosEntryStats[] = { diff --git a/debian/patches/compiler-flags b/debian/patches/compiler-flags new file mode 100644 index 000000000..28ee1d8b3 --- /dev/null +++ b/debian/patches/compiler-flags @@ -0,0 +1,213 @@ +Use $CC for the compiler instead of forcing cc or gcc and add -fPIC in +a few more places. The latter should be committed upstream. The former +is waiting for upstream work to separate the kernel compiler from the +userspace compiler, since $CC should only be used for the latter on other +platforms. + +Also combines the sparc sysnames together, which is suitable upstream. + +--- openafs.orig/src/cf/osconf.m4 ++++ openafs/src/cf/osconf.m4 +@@ -4,9 +4,8 @@ + dnl defaults, override in case below as needed + XCFLAGS='${DBG} ${OPTMZ}' + SHLIB_SUFFIX="so" +-CC="cc" +-CCOBJ="cc" +-MT_CC="cc" ++CCOBJ=$CC ++MT_CC=$CC + XLIBS="${LIB_AFSDB}" + + dnl debugging and optimization flag defaults +@@ -244,6 +243,7 @@ + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" ++ SHLIB_CFLAGS="-fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE -G0" +@@ -271,6 +271,7 @@ + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" ++ SHLIB_CFLAGS="-fPIC" + TXLIBS="/usr/lib64/libncurses.so" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + SHLIB_LINKER="${MT_CC} -shared" +@@ -291,14 +292,14 @@ + ;; + + i386_umlinux22) +- CC="gcc -pipe" +- CCOBJ="gcc -pipe" +- MT_CC="gcc -pipe" ++ CCOBJ="${CC} -pipe" ++ MT_CC="${CC} -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" ++ SHLIB_CFLAGS="-fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" +@@ -307,9 +308,8 @@ + ;; + + i386_linux*) +- CC="gcc -pipe" +- CCOBJ="gcc -pipe" +- MT_CC="gcc -pipe" ++ CCOBJ="${CC} -pipe" ++ MT_CC="${CC} -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' +@@ -320,6 +320,7 @@ + LWP_OPTMZ=-O2 + OPTMZ=-O2 + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" ++ SHLIB_CFLAGS="-fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" +@@ -327,9 +328,8 @@ + ;; + + i386_umlinux24) +- CC="gcc -pipe" +- CCOBJ="gcc -pipe" +- MT_CC="gcc -pipe" ++ CCOBJ="${CC} -pipe" ++ MT_CC="${CC} -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' +@@ -340,6 +340,7 @@ + LWP_OPTMZ=-O2 + OPTMZ=-O2 + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" ++ SHLIB_CFLAGS="-fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" +@@ -347,9 +348,8 @@ + ;; + + i386_umlinux26) +- CC="gcc -pipe" +- CCOBJ="gcc -pipe" +- MT_CC="gcc -pipe" ++ CCOBJ="${CC} -pipe" ++ MT_CC="${CC} -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' +@@ -360,6 +360,7 @@ + LWP_OPTMZ=-O2 + OPTMZ=-O2 + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" ++ SHLIB_CFLAGS="-fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" +@@ -385,6 +386,7 @@ + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" ++ SHLIB_CFLAGS="-fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" +@@ -555,8 +557,7 @@ + ;; + + s390_linux22) +- CC="gcc" +- CCOBJ="gcc" ++ CCOBJ="$CC" + LD="ld" + KERN_OPTMZ=-O2 + LEX="flex -l" +@@ -564,6 +565,7 @@ + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" ++ SHLIB_CFLAGS="-fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O -g -D_LARGEFILE64_SOURCE" +@@ -572,8 +574,7 @@ + ;; + + s390_linux24|s390_linux26) +- CC="gcc" +- CCOBJ="gcc" ++ CCOBJ="$CC" + LD="ld" + KERN_OPTMZ=-O2 + LEX="flex -l" +@@ -581,6 +582,7 @@ + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" ++ SHLIB_CFLAGS="-fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O -g -D_LARGEFILE64_SOURCE" +@@ -589,8 +591,7 @@ + ;; + + s390x_linux24|s390x_linux26) +- CC="gcc" +- CCOBJ="gcc -fPIC" ++ CCOBJ="$CC" + LD="ld" + KERN_OPTMZ=-O2 + LEX="flex -l" +@@ -598,6 +599,7 @@ + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" ++ SHLIB_CFLAGS="-fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x -Xlinker -Bsymbolic" + TXLIBS="-lncurses" + XCFLAGS="-O -g -D_LARGEFILE64_SOURCE -D__s390x__" +@@ -667,12 +669,13 @@ + SHLIB_LINKER="${CC} -shared" + ;; + +- sparc64_linux*) ++ sparc*_linux*) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" ++ SHLIB_CFLAGS="-fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" +@@ -682,19 +685,6 @@ + SHLIB_LINKER="${MT_CC} -shared" + ;; + +- sparc_linux22) +- KERN_OPTMZ=-O2 +- LEX="flex -l" +- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' +- MT_LIBS="-lpthread" +- PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" +- SHLIB_LDFLAGS="-shared -Xlinker -x" +- TXLIBS="-lncurses" +- XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" +- YACC="bison -y" +- SHLIB_LINKER="${MT_CC} -shared" +- ;; +- + sun4_413) + CCXPG2="/usr/xpg2bin/cc" + CC="gcc" diff --git a/debian/patches/des-alignment b/debian/patches/des-alignment new file mode 100644 index 000000000..758969d6e --- /dev/null +++ b/debian/patches/des-alignment @@ -0,0 +1,30 @@ +Fix the DES library alignment, which was otherwise causing problems on +SPARC Linux. Pulled from the upstream stable branch, will be in 1.4.5. + +--- openafs.orig/src/des/des.h ++++ openafs/src/des/des.h +@@ -20,7 +20,10 @@ + typedef unsigned char des_cblock[8]; /* crypto-block size */ + /* Key schedule */ + typedef struct des_ks_struct { +- des_cblock _; ++ union { ++ afs_uint32 i[2]; ++ des_cblock _; ++ } _; + } des_key_schedule[16]; + + #define DES_KEY_SZ (sizeof(des_cblock)) +--- openafs.orig/src/des/pcbc_encrypt.c ++++ openafs/src/des/pcbc_encrypt.c +@@ -24,9 +24,9 @@ + #ifndef KERNEL + #include + #endif +-#include + #include + #include ++#include + #include "des_prototypes.h" + + RCSID diff --git a/debian/patches/dfsg b/debian/patches/dfsg new file mode 100644 index 000000000..51a63ba8e --- /dev/null +++ b/debian/patches/dfsg @@ -0,0 +1,62 @@ +Patch upstream Makefiles to remove references to files that had to be +removed from the source package for DFSG freeness reasons. Not suitable +upstream for obvious reasons. + +--- openafs.orig/src/afs/Makefile.in ++++ openafs/src/afs/Makefile.in +@@ -13,7 +13,7 @@ + all: depinstall + + depinstall: ${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 afszcm.cat AFS_component_version_number.c ${TOP_INCDIR}/afs/unified_afs.h ${TOP_INCDIR}/afs/sysctl.h ++ ${TOP_INCDIR}/afs/exporter.h ${TOP_INCDIR}/afs/nfsclient.h afszcm.cat AFS_component_version_number.c ${TOP_INCDIR}/afs/unified_afs.h + case ${SYS_NAME} in \ + pmax_ul43 | pmax_ul43a) \ + ${INSTALL} longc_procs.h ${TOP_INCDIR}/afs ;; \ +@@ -43,7 +43,7 @@ + gencat afszcm.cat afs_trace.msf ;; \ + esac + +-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/unified_afs.h ${DESTDIR}${includedir}/afs/sysctl.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/unified_afs.h + case ${SYS_NAME} in \ + pmax_ul43 | pmax_ul43a) \ + ${INSTALL} longc_procs.h ${DESTDIR}${includedir}/afs ;; \ +@@ -131,7 +131,7 @@ + ${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}/include/afs/unified_afs.h ${DEST}/include/afs/sysctl.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/unified_afs.h + case ${SYS_NAME} in \ + pmax_ul43 | pmax_ul43a) \ + ${INSTALL} longc_procs.h ${DEST}/include/afs ;; \ +--- openafs.orig/src/tviced/Makefile.in ++++ openafs/src/tviced/Makefile.in +@@ -38,8 +38,7 @@ + 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 \ +- fstab.o ++ clone.o devname.o common.o ihandle.o listinodes.o namei_ops.o + + FSINTOBJS= afsaux.o afscbint.cs.o afsint.ss.o afsint.xdr.o + +--- openafs.orig/src/util/Makefile.in ++++ openafs/src/util/Makefile.in +@@ -12,7 +12,7 @@ + + objects = assert.o base64.o casestrcpy.o ktime.o volparse.o hostparse.o \ + hputil.o kreltime.o isathing.o get_krbrlm.o uuid.o serverLog.o \ +- dirpath.o fileutil.o netutils.o flipbase64.o fstab.o \ ++ dirpath.o fileutil.o netutils.o flipbase64.o \ + afs_atomlist.o afs_lhash.o snprintf.o strlcat.o strlcpy.o \ + daemon.o rxkstats.o ${REGEX_OBJ} + +@@ -392,4 +392,4 @@ + assert.c base64.c casestrcpy.c ktime.c volparse.c hostparse.c \ + hputil.c kreltime.c isathing.c get_krbrlm.c uuid.c serverLog.c \ + dirpath.c fileutil.c netutils.c flipbase64.c \ +- afs_atomlist.c afs_lhash.c snprintf.c fstab.c ++ afs_atomlist.c afs_lhash.c snprintf.c diff --git a/debian/patches/fstrace-paths b/debian/patches/fstrace-paths new file mode 100644 index 000000000..bdc45baff --- /dev/null +++ b/debian/patches/fstrace-paths @@ -0,0 +1,27 @@ +fstrace uses the NLS functions to do message translation and needs a +message catalog installed. The default paths are rather broken. Patch +the source to look for it in /usr/share/openafs instead. Not suitable +upstream with the hard-coded paths, but something more sophisticated +would be appropriate. + +--- openafs.orig/src/venus/fstrace.c ++++ openafs/src/venus/fstrace.c +@@ -1471,7 +1471,7 @@ + */ + + #ifndef RPC_NLS_FORMAT +-#define RPC_NLS_FORMAT "%s.cat" ++#define RPC_NLS_FORMAT "/usr/share/openafs/%s.cat" + #endif + + dce1_error_inq_text(status_to_convert, error_text, status) +@@ -1488,7 +1488,8 @@ + char component_name[4]; + char *facility_name; + char filename_prefix[7]; +- char nls_filename[11]; ++ /* strlen("/usr/share/openafs/") + 6 + strlen(".cat") + 1 */ ++ char nls_filename[19 + 6 + 4 + 1]; + char alt_filename[80]; + char *message; + #if defined(AFS_64BITPOINTER_ENV) diff --git a/debian/patches/glibc-ucontext b/debian/patches/glibc-ucontext deleted file mode 100644 index 8967b12b1..000000000 --- a/debian/patches/glibc-ucontext +++ /dev/null @@ -1,144 +0,0 @@ -=== src/config/param.alpha_linux_26.h -================================================================== ---- src/config/param.alpha_linux_26.h (revision 2485) -+++ src/config/param.alpha_linux_26.h (local) -@@ -81,6 +81,11 @@ - #define SYS_NAME_ID SYS_NAME_ID_alpha_linux_26 - - -+#ifdef __GLIBC__ -+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -+#define USE_UCONTEXT -+#endif -+#endif - #endif /* AFS_PARAM_H */ - - #else /* !defined(UKERNEL) */ -=== src/config/param.ia64_linux26.h -================================================================== ---- src/config/param.ia64_linux26.h (revision 2485) -+++ src/config/param.ia64_linux26.h (local) -@@ -97,6 +97,11 @@ - #endif /* KERNEL */ - - -+#ifdef __GLIBC__ -+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -+#define USE_UCONTEXT -+#endif -+#endif - #endif /* _PARAM_IA64_LINUX20_H_ */ - - #else /* !defined(UKERNEL) */ -=== src/config/param.parisc_linux24.h -================================================================== ---- src/config/param.parisc_linux24.h (revision 2485) -+++ src/config/param.parisc_linux24.h (local) -@@ -70,6 +70,11 @@ - #endif - #endif /* KERNEL */ - -+#ifdef __GLIBC__ -+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -+#define USE_UCONTEXT -+#endif -+#endif - #endif /* AFS_PARAM_H */ - - #else /* !defined(UKERNEL) */ -=== src/config/param.ppc64_linux26.h -================================================================== ---- src/config/param.ppc64_linux26.h (revision 2485) -+++ src/config/param.ppc64_linux26.h (local) -@@ -76,6 +76,11 @@ - #endif - #endif /* KERNEL */ - -+#ifdef __GLIBC__ -+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -+#define USE_UCONTEXT -+#endif -+#endif - #endif /* _PARAM_PPC64_LINUX20_H_ */ - - #else /* !defined(UKERNEL) */ -=== src/config/param.ppc_linux26.h -================================================================== ---- src/config/param.ppc_linux26.h (revision 2485) -+++ src/config/param.ppc_linux26.h (local) -@@ -74,6 +74,11 @@ - #endif - #endif /* KERNEL */ - -+#ifdef __GLIBC__ -+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -+#define USE_UCONTEXT -+#endif -+#endif - #endif /* AFS_PARAM_H */ - - #else /* !defined(UKERNEL) */ -=== src/config/param.s390_linux26.h -================================================================== ---- src/config/param.s390_linux26.h (revision 2485) -+++ src/config/param.s390_linux26.h (local) -@@ -86,6 +86,11 @@ - #endif - #endif /* KERNEL */ - -+#ifdef __GLIBC__ -+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -+#define USE_UCONTEXT -+#endif -+#endif - #endif /* AFS_PARAM_H */ - - #else /* !defined(UKERNEL) */ -=== src/config/param.s390x_linux26.h -================================================================== ---- src/config/param.s390x_linux26.h (revision 2485) -+++ src/config/param.s390x_linux26.h (local) -@@ -89,6 +89,11 @@ - #endif - #endif /* KERNEL */ - -+#ifdef __GLIBC__ -+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -+#define USE_UCONTEXT -+#endif -+#endif - #endif /* AFS_PARAM_H */ - - #else /* !defined(UKERNEL) */ -=== src/config/param.sparc64_linux26.h -================================================================== ---- src/config/param.sparc64_linux26.h (revision 2485) -+++ src/config/param.sparc64_linux26.h (local) -@@ -95,6 +95,11 @@ - #endif - #endif - -+#ifdef __GLIBC__ -+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -+#define USE_UCONTEXT -+#endif -+#endif - #endif /* _PARAM_SPARC64_LINUX26_H_ */ - - #else /* !defined(UKERNEL) */ -=== src/config/param.sparc_linux24.h -================================================================== ---- src/config/param.sparc_linux24.h (revision 2485) -+++ src/config/param.sparc_linux24.h (local) -@@ -98,6 +98,11 @@ - #endif - #endif - -+#ifdef __GLIBC__ -+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -+#define USE_UCONTEXT -+#endif -+#endif - #endif /* AFS_PARAM_H */ - - #else /* !defined(UKERNEL) */ diff --git a/debian/patches/hpux-smp b/debian/patches/hpux-smp deleted file mode 100644 index 2565cd393..000000000 --- a/debian/patches/hpux-smp +++ /dev/null @@ -1,16 +0,0 @@ -A hack for 2.4 HPPA. I don't completely understand what this does or why -it helps (and whether it's still needed). - ---- openafs-1.3.87.orig/src/lwp/process.c -+++ openafs-1.3.87/src/lwp/process.c -@@ -101,7 +101,9 @@ - #elif defined(AFS_HPUX_ENV) - #define LWP_SP 1 - #elif defined(AFS_LINUX20_ENV) --#if defined(AFS_PPC_LINUX20_ENV) || defined(AFS_PPC64_LINUX20_ENV) -+#if defined(AFS_PARISC_LINUX24_ENV ) -+#define LWP_SP 1 -+#elif defined(AFS_PPC_LINUX20_ENV)|| defined(AFS_PPC64_LINUX20_ENV) - #define LWP_SP 0 - #elif defined(AFS_I386_LINUX20_ENV) - #define LWP_SP 4 diff --git a/debian/patches/ka-forwarder b/debian/patches/ka-forwarder new file mode 100644 index 000000000..d9d5beea0 --- /dev/null +++ b/debian/patches/ka-forwarder @@ -0,0 +1,436 @@ +Add the ka-forwarder program, needed for some migration scenarios from +the AFS kaserver. Pulled from upstream, will be in 1.4.5. + +--- openafs.orig/src/aklog/Makefile.in ++++ openafs/src/aklog/Makefile.in +@@ -16,7 +16,7 @@ + SRCS= aklog.c aklog_main.c krb_util.c linked_list.c + OBJS= aklog.o aklog_main.o krb_util.o linked_list.o + +-all: aklog asetkey ++all: aklog asetkey ka-forwarder + + aklog: ${OBJS} ${AFSLIBS} + ${CC} -o $@ ${CFLAGS} ${OBJS} ${AKLIBS} ${AFSLIBS} ${XLIBS} +@@ -24,11 +24,16 @@ + asetkey: asetkey.o ${AFSLIBS} + ${CC} -o $@ ${CFLAGS} asetkey.o ${AKLIBS} ${AFSLIBS} ${XLIBS} + ++ka-forwarder: ka-forwarder.o ++ ${CC} -o $@ ${CFLAGS} ka-forwarder.o ${LIBS} ${XLIBS} ++ + # + # Installation targets + # + install: \ +- ${DESTDIR}${bindir}/aklog ${DESTDIR}${afssrvbindir}/asetkey ++ ${DESTDIR}${bindir}/aklog \ ++ ${DESTDIR}${afssrvbindir}/asetkey \ ++ ${DESTDIR}${afssrvbindir}/ka-forwarder + + ${DESTDIR}${bindir}/aklog: aklog + ${INSTALL} $? $@ +@@ -36,8 +41,13 @@ + ${DESTDIR}${afssrvbindir}/asetkey: asetkey + ${INSTALL} $? $@ + ++${DESTDIR}${afssrvbindir}/ka-forwarder: ka-forwarder ++ ${INSTALL} $? $@ ++ + dest: \ +- ${DEST}/bin/aklog ${DEST}/root.server/usr/afs/bin/asetkey ++ ${DEST}/bin/aklog \ ++ ${DEST}/root.server/usr/afs/bin/asetkey \ ++ ${DEST}/root.server/usr/afs/bin/ka-forwarder + + ${DEST}/bin/aklog: aklog + ${INSTALL} $? $@ +@@ -45,11 +55,14 @@ + ${DEST}/root.server/usr/afs/bin/asetkey: asetkey + ${INSTALL} $? $@ + ++${DEST}/root.server/usr/afs/bin/ka-forwarder: ka-forwarder ++ ${INSTALL} $? $@ ++ + # + # Misc. targets + # + clean: +- $(RM) -f *.o ${OBJS} aklog asetkey ++ $(RM) -f *.o ${OBJS} aklog asetkey ka-forwarder + + include ../config/Makefile.version + +--- /dev/null ++++ openafs/src/aklog/ka-forwarder.c +@@ -0,0 +1,282 @@ ++/* ++ * COPYRIGHT NOTICE ++ * Copyright (c) 1994 Carnegie Mellon University ++ * All Rights Reserved. ++ * ++ * See for use and distribution information. ++ */ ++ ++/* ++ * HISTORY ++ * $Log: ka-forwarder.c,v $ ++ * Revision 1.1 1997/06/03 18:23:54 kenh ++ * . ++ * ++ * Revision 1.4 1996/08/09 01:00:21 jhutz ++ * When initializing the array of fakeka servers, remember to set ++ * the address family of each server; otherwise SunOS complains. ++ * [1996/08/09 00:58:46 jhutz] ++ * ++ * Revision 1.3 1996/08/09 00:17:19 jhutz ++ * Merged in changes from Chuck Silvers: ++ * - Support for more than one fakeka server ++ * - Support for specifying ports for each fakeka server separately from the ++ * others, and from the port we listen on. ++ * ++ * Plus a minor bug fix to Chuck's code. ++ * Basically, this version is designed to provide both reliability and ++ * load-balancing cheaply. Basically, we forward packets to all of the ++ * fakeka servers in round-robin fashion. So, if a client is losing on ++ * one server, its retry should go to a different one, if more than one ++ * is specified. ++ * [1996/08/03 02:13:36 jhutz] ++ * ++ * Revision 1.2 1995/02/23 18:26:36 chs ++ * Created. ++ * [1995/02/23 18:26:03 chs] ++ * ++ * $EndLog$ ++ */ ++ ++/* ++ * This program is intended to run on afs DB servers. ++ * Its function is to forward KA requests to a fakeka server ++ * running on an MIT kerberos server. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#if HAVE_GETOPT_H ++#include ++#else ++int getopt (int, char * const *, const char *); ++int optind, opterr; ++char *optarg; ++#endif ++ ++#define BUFFER_SIZE 2048 ++ ++ ++char *prog; ++ ++int num_servers, cur_server; ++struct sockaddr_in *servers; ++ ++ ++void ++perrorexit(str) ++char *str; ++{ ++ perror(str); ++ exit(1); ++} ++ ++ ++void ++setup_servers(argc, argv) ++int argc; ++char **argv; ++{ ++ int i; ++ u_int fwdaddr; ++ u_short fwdport; ++ ++ num_servers = argc; ++ ++ servers = malloc(sizeof(*servers) * num_servers); ++ if (servers == NULL) ++ perrorexit("malloc failed"); ++ ++ for (i = 0; i < num_servers; i++) { ++ char *host, *port; ++ ++ fwdport = htons(7004); ++ ++ host = argv[i]; ++ port = strchr(host, '/'); ++ if (port != NULL) { ++ *port++ = 0; ++ ++ if (isdigit(port[0])) { ++ fwdport = htons(atoi(port)); ++ } ++ else { ++ struct servent *srv = getservbyname(port, "udp"); ++ if (!srv) { ++ fprintf(stderr, "%s: unknown service %s\n", prog, port); ++ exit(1); ++ } ++ fwdport = srv->s_port; ++ } ++ } ++ ++ if (isdigit(host[0])) { ++ fwdaddr = inet_addr(host); ++ } ++ else { ++ struct hostent *h = gethostbyname(host); ++ if (!h) { ++ fprintf(stderr, "%s: unknown host %s\n", prog, host); ++ exit(1); ++ } ++ bcopy(h->h_addr, &fwdaddr, 4); ++ } ++ ++ servers[i].sin_family = AF_INET; ++ servers[i].sin_addr.s_addr = fwdaddr; ++ servers[i].sin_port = fwdport; ++ } ++} ++ ++ ++int ++setup_socket(port) ++u_short port; ++{ ++ int s, rv; ++ struct sockaddr_in sin; ++ ++ s = socket(AF_INET, SOCK_DGRAM, 0); ++ if (s < 0) ++ perrorexit("Couldn't create socket"); ++ ++ sin.sin_family = AF_INET; ++ sin.sin_addr.s_addr = 0; ++ sin.sin_port = htons(port); ++ ++ rv = bind(s, (struct sockaddr *)&sin, sizeof(sin)); ++ if (rv < 0) ++ perrorexit("Couldn't bind socket"); ++ ++ return s; ++} ++ ++ ++int ++packet_is_reply(from) ++struct sockaddr_in *from; ++{ ++ int i; ++ ++ for (i = 0; i < num_servers; i++) { ++ struct sockaddr_in *sin = &servers[i]; ++ ++ if (from->sin_addr.s_addr == sin->sin_addr.s_addr && ++ from->sin_port == sin->sin_port) ++ { ++ return 1; ++ } ++ } ++ ++ return 0; ++} ++ ++ ++int ++main(argc, argv) ++int argc; ++char **argv; ++{ ++ int c, s, rv; ++ u_short port; ++ ++ if (argc < 2) { ++ fprintf(stderr, ++ "usage: %s [-p port] [/port] [host/port ...]\n", ++ argv[0]); ++ exit(1); ++ } ++ ++ prog = argv[0]; ++ port = 7004; ++ ++ while ((c = getopt(argc, argv, "p:")) != -1) { ++ switch (c) { ++ case 'p': ++ port = atoi(optarg); ++ break; ++ default: ++ fprintf(stderr, "%s: invalid option '%c'\n", prog, c); ++ exit(1); ++ } ++ } ++ ++ /* ++ * hmm, different implementations of getopt seem to do different things ++ * when there aren't any options. linux sets optind = 1, which I would ++ * call correct, but sunos sets optind = 0. try to do the right thing. ++ */ ++ if (optind == 0) ++ optind = 1; ++ ++ setup_servers(argc - optind, argv + optind); ++ s = setup_socket(port); ++ ++ openlog("ka-forwarder", LOG_PID, LOG_DAEMON); ++ ++ for (;;) { ++ char buf[BUFFER_SIZE], *bufp, *sendptr; ++ struct sockaddr_in from, reply, *to; ++ int fromlen, sendlen; ++ ++ bufp = buf + 8; ++ fromlen = sizeof(from); ++ ++ rv = recvfrom(s, bufp, sizeof(buf) - 8, ++ 0, (struct sockaddr *)&from, &fromlen); ++ if (rv < 0) { ++ syslog(LOG_ERR, "recvfrom: %m"); ++ sleep(1); ++ continue; ++ } ++ ++ if (packet_is_reply(&from)) { ++ /* this is a reply, forward back to user */ ++ ++ to = &reply; ++ reply.sin_family = AF_INET; ++ bcopy(bufp, &reply.sin_addr.s_addr, 4); ++ bcopy(bufp + 4, &reply.sin_port, 2); ++ sendptr = bufp + 8; ++ sendlen = rv - 8; ++ } ++ else { ++ /* this is a request, forward to server */ ++ ++ cur_server = (cur_server + 1) % num_servers; ++ to = &servers[cur_server]; ++ ++ bcopy(&from.sin_addr.s_addr, bufp - 8, 4); ++ bcopy(&from.sin_port, bufp - 4, 2); ++ ++ sendptr = bufp - 8; ++ sendlen = rv + 8; ++ } ++ ++ { ++ char a1[16], a2[16]; ++ strcpy(a1, inet_ntoa(from.sin_addr)); ++ strcpy(a2, inet_ntoa(to->sin_addr)); ++ ++ syslog(LOG_INFO, "forwarding %d bytes from %s/%d to %s/%d\n", ++ sendlen, a1, htons(from.sin_port), a2, htons(to->sin_port)); ++ } ++ ++ rv = sendto(s, sendptr, sendlen, ++ 0, (struct sockaddr *)to, sizeof(*to)); ++ if (rv < 0) { ++ syslog(LOG_ERR, "sendto: %m"); ++ } ++ } ++} +--- /dev/null ++++ openafs/doc/man-pages/pod8/ka-forwarder.pod +@@ -0,0 +1,85 @@ ++=head1 NAME ++ ++ka-forwarder - Forward AFS Authentication Server requests to another server ++ ++=head1 SYNOPSIS ++ ++=for html ++
++ ++B S<<< [B<-p> >] >>> >[/>] [...] ++ ++=for html ++
++ ++=head1 DESCRIPTION ++ ++B listens for requests for an AFS Authentication Server and ++forwards them to a remove B server. B is a server that ++answers AFS Authentication Server protocol requests using a regular ++Kerberos KDC and is provided with some Kerberos 5 implementations. ++B has to run on the same host as the Kerberos KDC, however, and ++AFS clients send all native AFS authentication requests to the AFS ++database servers. If you don't want to run your Kerberos KDCs and your ++AFS database servers on the same host, run B on the AFS ++database servers and point it to B running on the Kerberos KDCs. ++ ++B takes one or more servers to which to forward the ++requests. The default port on the remote server to which to forward the ++command is 7004, but a different port can be specified by following the ++server name with a slash (C) and the port number. If multiple servers ++are given, B will send queries to each server in turn in a ++round-robin fashion. ++ ++=head1 CAUTIONS ++ ++Due to the way that B distinguishes from client requests and ++server responses, any messages from one of the servers to which ++B is forwarding will be considered a reply rather than a ++command and will not be forwarded. This means that the servers running ++B will not be able to use native AFS authentication requests and ++rely on B to send the requests to the right server. ++ ++B does not background itself. It should either be run in ++the background via the shell, or run via the Basic OverSeer Server (see ++L). ++ ++=head1 OPTIONS ++ ++=over 4 ++ ++=item B<-p> > ++ ++By default, B listens to the standard AFS Authentication ++Server port (7004). To listen to a different port, specify it with the ++B<-p> option. ++ ++=back ++ ++=head1 EXAMPLES ++ ++Forward AFS Authentication Server reqests to the B servers on ++kdc1.example.com and kdc2.example.com: ++ ++ % ka-forwarder kdc1.example.com kdc2.example.com & ++ ++Note the C<&> to tell the shell to run this command in the background. ++ ++=head1 PRIVILEGE REQUIRED ++ ++B only has to listen to port 7004 and therefore does not ++require any special privileges unless a privileged port is specified with ++the B<-p> option. ++ ++=head1 SEE ALSO ++ ++L, ++fakeka(8), ++L ++ ++=head1 COPYRIGHT ++ ++Copyright 2006 Russ Allbery ++ ++This documentation is covered by the IBM Public License Version 1.0. This ++man page was written by Russ Allbery for OpenAFS. diff --git a/debian/patches/kbuild-assembly b/debian/patches/kbuild-assembly new file mode 100644 index 000000000..7e818b3a3 --- /dev/null +++ b/debian/patches/kbuild-assembly @@ -0,0 +1,15 @@ +Change the expected source file name for assembly code in the kernel. +Only used by the PowerPC build, but fixes build problems on that +platform. Pulled from the upstream stable branch, will be in 1.4.5. + +--- openafs.orig/src/libafs/make_kbuild_makefile.pl ++++ openafs/src/libafs/make_kbuild_makefile.pl +@@ -79,7 +79,7 @@ + foreach (@objects) { + die "No source known for $_\n" unless exists $deps{$_}; + if($deps{$_} =~ /\.s$/) { +- ($src = $_) =~ s/\.o$/.s/; ++ ($src = $_) =~ s/\.o$/.S/; + } else { + ($src = $_) =~ s/\.o$/.c/; + } diff --git a/debian/patches/linux-2.6.22 b/debian/patches/linux-2.6.22 new file mode 100644 index 000000000..0704933cd --- /dev/null +++ b/debian/patches/linux-2.6.22 @@ -0,0 +1,164 @@ +Add support for the kernel structure changes in 2.6.22. Pulled from the +upstream stable branch, will be in 1.4.5. + +--- openafs.orig/acinclude.m4 ++++ openafs/acinclude.m4 +@@ -611,6 +611,7 @@ + LINUX_FS_STRUCT_FOP_HAS_FLOCK + LINUX_KERNEL_LINUX_SYSCALL_H + LINUX_KERNEL_LINUX_SEQ_FILE_H ++ LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG + LINUX_KERNEL_SELINUX + LINUX_KERNEL_SOCK_CREATE + LINUX_KERNEL_PAGE_FOLLOW_LINK +@@ -626,6 +627,7 @@ + LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE + LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TGID + LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO ++ LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_THREAD_INFO + LINUX_EXPORTS_TASKLIST_LOCK + LINUX_GET_SB_HAS_STRUCT_VFSMOUNT + LINUX_STATFS_TAKES_DENTRY +@@ -767,6 +769,9 @@ + if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then + AC_DEFINE(RECALC_SIGPENDING_TAKES_VOID, 1, [define if your recalc_sigpending takes void]) + fi ++ if test "x$ac_cv_linux_kernel_posix_lock_file_wait_arg" = "xyes" ; then ++ AC_DEFINE(POSIX_LOCK_FILE_WAIT_ARG, 1, [define if your linux kernel uses 3 arguments for posix_lock_file]) ++ fi + if test "x$ac_cv_linux_kernel_is_selinux" = "xyes" ; then + AC_DEFINE(LINUX_KERNEL_IS_SELINUX, 1, [define if your linux kernel uses SELinux features]) + fi +@@ -812,6 +817,9 @@ + if test "x$ac_cv_linux_sched_struct_task_struct_has_todo" = "xyes"; then + AC_DEFINE(STRUCT_TASK_STRUCT_HAS_TODO, 1, [define if your struct task_struct has todo]) + fi ++ if test "x$ac_cv_linux_sched_struct_task_struct_has_thread_info" = "xyes"; then ++ AC_DEFINE(STRUCT_TASK_STRUCT_HAS_THREAD_INFO, 1, [define if your struct task_struct has thread_info]) ++ fi + if test "x$ac_cv_linux_get_sb_has_struct_vfsmount" = "xyes"; then + AC_DEFINE(GET_SB_HAS_STRUCT_VFSMOUNT, 1, [define if your get_sb_nodev needs a struct vfsmount argument]) + fi +--- openafs.orig/src/afs/LINUX/osi_sleep.c ++++ openafs/src/afs/LINUX/osi_sleep.c +@@ -205,7 +205,11 @@ + #if defined(STRUCT_TASK_STRUCT_HAS_TODO) + !current->todo + #else ++#if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO) + test_ti_thread_flag(current->thread_info, TIF_FREEZE) ++#else ++ test_ti_thread_flag(task_thread_info(current), TIF_FREEZE) ++#endif + #endif + #endif + ) +@@ -303,7 +307,11 @@ + #if defined(STRUCT_TASK_STRUCT_HAS_TODO) + !current->todo + #else ++#if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO) + test_ti_thread_flag(current->thread_info, TIF_FREEZE) ++#else ++ test_ti_thread_flag(task_thread_info(current), TIF_FREEZE) ++#endif + #endif + #endif + ) +--- openafs.orig/src/afs/LINUX/osi_vfsops.c ++++ openafs/src/afs/LINUX/osi_vfsops.c +@@ -292,8 +292,10 @@ + { + struct vcache *vcp = (struct vcache *) foo; + ++#if defined(SLAB_CTOR_VERIFY) + if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == + SLAB_CTOR_CONSTRUCTOR) ++#endif + inode_init_once(AFSTOV(vcp)); + } + +--- openafs.orig/src/afs/LINUX/osi_vnodeops.c ++++ openafs/src/afs/LINUX/osi_vnodeops.c +@@ -473,11 +473,11 @@ + #ifdef AFS_LINUX24_ENV + if ((code == 0 || flp->fl_type == F_UNLCK) && + (cmd == F_SETLK || cmd == F_SETLKW)) { +-#ifdef AFS_LINUX26_ENV ++#ifdef POSIX_LOCK_FILE_WAIT_ARG ++ code = posix_lock_file(fp, flp, 0); ++#else + flp->fl_flags &=~ FL_SLEEP; + code = posix_lock_file(fp, flp); +-#else +- code = posix_lock_file(fp, flp, 0); + #endif + if (code && flp->fl_type != F_UNLCK) { + struct AFS_FLOCK flock2; +--- openafs.orig/src/cf/linux-test4.m4 ++++ openafs/src/cf/linux-test4.m4 +@@ -444,6 +444,18 @@ + AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_exit_state)]) + + ++AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_THREAD_INFO], [ ++ AC_MSG_CHECKING([for thread_info in struct task_struct]) ++ AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_thread_info], [ ++ AC_TRY_KBUILD( ++[#include ], ++[struct task_struct _tsk; ++printk("%d\n", _tsk.thread_info);], ++ ac_cv_linux_sched_struct_task_struct_has_thread_info=yes, ++ ac_cv_linux_sched_struct_task_struct_has_thread_info=no)]) ++ AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_thread_info)]) ++ ++ + AC_DEFUN([LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE], [ + AC_MSG_CHECKING([for alloc_inode in struct super_operations]) + AC_CACHE_VAL([ac_cv_linux_fs_struct_super_has_alloc_inode], [ +@@ -456,6 +468,17 @@ + AC_MSG_RESULT($ac_cv_linux_fs_struct_super_has_alloc_inode)]) + + ++AC_DEFUN([LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG], [ ++ AC_MSG_CHECKING([for 3rd argument in posix_lock_file found in new kernels]) ++ AC_CACHE_VAL([ac_cv_linux_kernel_posix_lock_file_wait_arg], [ ++ AC_TRY_KBUILD( ++[#include ], ++[posix_lock_file(0,0,0);], ++ ac_cv_linux_kernel_posix_lock_file_wait_arg=yes, ++ ac_cv_linux_kernel_posix_lock_file_wait_arg=no)]) ++ AC_MSG_RESULT($ac_cv_linux_kernel_posix_lock_file_wait_arg)]) ++ ++ + AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [ + AC_MSG_CHECKING([for 5th argument in sock_create found in some SELinux kernels]) + AC_CACHE_VAL([ac_cv_linux_kernel_sock_create_v], [ +--- openafs.orig/src/rx/LINUX/rx_kmutex.c ++++ openafs/src/rx/LINUX/rx_kmutex.c +@@ -122,7 +122,11 @@ + #if defined(STRUCT_TASK_STRUCT_HAS_TODO) + !current->todo + #else ++#if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO) + test_ti_thread_flag(current->thread_info, TIF_FREEZE) ++#else ++ test_ti_thread_flag(task_thread_info(current), TIF_FREEZE) ++#endif + #endif + #endif + ) +--- openafs.orig/src/rx/LINUX/rx_knet.c ++++ openafs/src/rx/LINUX/rx_knet.c +@@ -173,7 +173,11 @@ + #if defined(STRUCT_TASK_STRUCT_HAS_TODO) + !current->todo + #else ++#if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO) + test_ti_thread_flag(current->thread_info, TIF_FREEZE) ++#else ++ test_ti_thread_flag(task_thread_info(current), TIF_FREEZE) ++#endif + #endif + #endif + ) diff --git a/debian/patches/linux-2.6.22.1-proc b/debian/patches/linux-2.6.22.1-proc new file mode 100644 index 000000000..96aa78ac5 --- /dev/null +++ b/debian/patches/linux-2.6.22.1-proc @@ -0,0 +1,104 @@ +Fix for the proc structure changes in 2.6.22.1. Pulled from the upstream +stable branch, will be in 1.4.5. + +--- openafs.orig/src/afs/LINUX/osi_sysctl.c ++++ openafs/src/afs/LINUX/osi_sysctl.c +@@ -1,7 +1,7 @@ + /* + * osi_sysctl.c: Linux sysctl interface to OpenAFS + * +- * $Id: osi_sysctl.c,v 1.7.2.4 2007/02/22 21:49:01 shadow Exp $ ++ * $Id: osi_sysctl.c,v 1.7.2.5 2007/06/12 18:28:49 shadow Exp $ + * + * Written Jan 30, 2002 by Kris Van Hees (Sine Nomine Associates) + */ +@@ -27,35 +27,64 @@ + static struct ctl_table_header *afs_sysctl = NULL; + + static ctl_table afs_sysctl_table[] = { +- {1, "hm_retry_RO", +- &hm_retry_RO, sizeof(afs_int32), 0644, NULL, +- &proc_dointvec} +- , +- {2, "hm_retry_RW", +- &hm_retry_RW, sizeof(afs_int32), 0644, NULL, +- &proc_dointvec} +- , +- {3, "hm_retry_int", +- &hm_retry_int, sizeof(afs_int32), 0644, NULL, +- &proc_dointvec} +- , +- {4, "GCPAGs", +- &afs_gcpags, sizeof(afs_int32), 0644, NULL, +- &proc_dointvec} +- , +- {5, "rx_deadtime", +- &afs_rx_deadtime, sizeof(afs_int32), 0644, NULL, +- &proc_dointvec} +- , +- {6, "bkVolPref", +- &afs_bkvolpref, sizeof(afs_int32), 0644, NULL, +- &proc_dointvec} +- , ++ { ++ .ctl_name = 1, ++ .procname = "hm_retry_RO", ++ .data = &hm_retry_RO, ++ .maxlen = sizeof(afs_int32), ++ .mode = 0644, ++ .proc_handler = &proc_dointvec ++ }, ++ { ++ .ctl_name = 2, ++ .procname = "hm_retry_RW", ++ .data = &hm_retry_RW, ++ .maxlen = sizeof(afs_int32), ++ .mode = 0644, ++ .proc_handler = &proc_dointvec ++ }, ++ { ++ .ctl_name = 3, ++ .procname = "hm_retry_int", ++ .data = &hm_retry_int, ++ .maxlen = sizeof(afs_int32), ++ .mode = 0644, ++ .proc_handler = &proc_dointvec ++ }, ++ { ++ .ctl_name = 4, ++ .procname = "GCPAGs", ++ .data = &afs_gcpags, ++ .maxlen = sizeof(afs_int32), ++ .mode = 0644, ++ .proc_handler = &proc_dointvec ++ }, ++ { ++ .ctl_name = 5, ++ .procname = "rx_deadtime", ++ .data = &afs_rx_deadtime, ++ .maxlen = sizeof(afs_int32), ++ .mode = 0644, ++ .proc_handler = &proc_dointvec ++ }, ++ { ++ .ctl_name = 6, ++ .procname = "bkVolPref", ++ .data = &afs_bkvolpref, ++ .maxlen = sizeof(afs_int32), ++ .mode = 0644, ++ .proc_handler = &proc_dointvec ++ }, + {0} + }; + + static ctl_table fs_sysctl_table[] = { +- {1, "afs", NULL, 0, 0555, afs_sysctl_table}, ++ { ++ .ctl_name = 1, ++ .procname = "afs", ++ .mode = 0555, ++ .child = afs_sysctl_table ++ }, + {0} + }; + diff --git a/debian/patches/module-name b/debian/patches/module-name index 148d2d837..8f13bcb96 100644 --- a/debian/patches/module-name +++ b/debian/patches/module-name @@ -1,14 +1,31 @@ -Upstream uses libafs as the module name, mostly for historic reasons. It -also uses a different module name depending on whether the module is built -for SMP systems, something that Debian deals with by creating separate -packages. This patch changes the name of the module to openafs and -removes the separate name for the SMP version. +Build the kernel module as openafs.ko instead of libafs.ko. This should +really be done upstream as well, but it poses backwards compatibility +problems and it's always been called libafs on other platforms, so it's +controversial. -Probably not acceptable upstream. - ---- openafs-1.3.87.orig/src/libafs/MakefileProto.LINUX.in -+++ openafs-1.3.87/src/libafs/MakefileProto.LINUX.in -@@ -216,8 +216,8 @@ +--- openafs.orig/src/config/linux-version ++++ openafs/src/config/linux-version +@@ -38,7 +38,7 @@ + CAN_BUILD="" + + for VERS in $LINUX_VERS ; do +- dir=$LINUX_SRCDIR$VERS ++ dir=$LINUX_SRCDIR + if [ ! -d $dir ] ; then + dir=$LINUX_SRCDIR + if [ ! -d $dir ] ; then +@@ -47,7 +47,7 @@ + continue + fi + fi +- header=$LINUX_SRCDIR$VERS/include/linux/version.h ++ header=$LINUX_SRCDIR/include/linux/version.h + if [ ! -f $header ] ; then + header=$LINUX_SRCDIR/include/linux/version.h + if [ ! -f $header ] ; then +--- openafs.orig/src/libafs/MakefileProto.LINUX.in ++++ openafs/src/libafs/MakefileProto.LINUX.in +@@ -222,8 +222,8 @@ # Below this line are targets when in the COMMON directory: # For Linux there is no kernel NFS server. @@ -19,7 +36,7 @@ Probably not acceptable upstream. LIBAFS_EP = libafs-${CLIENT}.ep.${LINUX_MODULE_EXT} LIBAFS_BM = libafs-${CLIENT}.bm.${LINUX_MODULE_EXT} -@@ -226,10 +226,8 @@ +@@ -232,10 +232,8 @@ INST_LIBAFS_EP = ${DESTDIR}${afskerneldir}/${LIBAFS_EP} INST_LIBAFS_BM = ${DESTDIR}${afskerneldir}/${LIBAFS_BM} @@ -32,7 +49,7 @@ Probably not acceptable upstream. libafs: $(LIBAFS) -@@ -245,11 +243,11 @@ +@@ -251,11 +249,11 @@ echo BM Build Complete diff --git a/debian/patches/null-uuid-client b/debian/patches/null-uuid-client new file mode 100644 index 000000000..e749d544f --- /dev/null +++ b/debian/patches/null-uuid-client @@ -0,0 +1,15 @@ +Tell the client to never generate an all-zero UUID, even if the client +apparently doesn't have any network interfaces. Fixed upstream a +different way, so this patch can be dropped after 1.4.5 is released. + +--- openafs.orig/src/afs/afs_call.c ++++ openafs/src/afs/afs_call.c +@@ -858,6 +858,8 @@ + #if (!defined(AFS_NONFSTRANS)) || defined(AFS_AIX_IAUTH_ENV) + afs_nfsclient_init(); + #endif ++ if (afs_cb_interface.numberOfInterfaces < 1) ++ afs_uuid_create(&afs_cb_interface.uuid); + printf("found %d non-empty cache files (%d%%).\n", + afs_stats_cmperf.cacheFilesReused, + (100 * afs_stats_cmperf.cacheFilesReused) / diff --git a/debian/patches/null-uuid-server b/debian/patches/null-uuid-server new file mode 100644 index 000000000..b676a0e9c --- /dev/null +++ b/debian/patches/null-uuid-server @@ -0,0 +1,41 @@ +Treat clients that provide an all-zero UUID as if they don't support +UUIDs at all. Pulled from the upstream stable branch, will be in 1.4.5. + +--- openafs.orig/src/viced/host.c ++++ openafs/src/viced/host.c +@@ -74,6 +74,7 @@ + extern int lwps; /* the max number of server threads */ + extern afsUUID FS_HostUUID; + ++afsUUID nulluuid; + int CEs = 0; /* active clients */ + int CEBlocks = 0; /* number of blocks of CEs */ + struct client *CEFree = 0; /* first free client */ +@@ -1329,7 +1330,8 @@ + rx_PutConnection(cb_conn); + cb_conn=NULL; + H_LOCK; +- if (code == RXGEN_OPCODE) { ++ if ((code == RXGEN_OPCODE) || ++ (afs_uuid_equal(&interf.uuid, &nulluuid))) { + identP = (struct Identity *)malloc(sizeof(struct Identity)); + if (!identP) { + ViceLog(0, ("Failed malloc in h_GetHost_r\n")); +@@ -1452,7 +1454,8 @@ + rx_PutConnection(cb_conn); + cb_conn=NULL; + H_LOCK; +- if (code == RXGEN_OPCODE) { ++ if ((code == RXGEN_OPCODE) || ++ afs_uuid_equal(&interf.uuid, &nulluuid)) { + if (!identP) + identP = + (struct Identity *)malloc(sizeof(struct Identity)); +@@ -1662,6 +1665,7 @@ + void + h_InitHostPackage() + { ++ memset(&nulluuid, 0, sizeof(afsUUID)); + afsconf_GetLocalCell(confDir, localcellname, PR_MAXNAMELEN); + if (!local_realm[0]) { + if (afs_krb_get_lrealm(local_realm, 0) != 0 /*KSUCCESS*/) { diff --git a/debian/patches/os-config b/debian/patches/os-config deleted file mode 100644 index 77829c305..000000000 --- a/debian/patches/os-config +++ /dev/null @@ -1,150 +0,0 @@ -Various changes to fix OS configuration. Use PIC for shared library -builds on all Linux platforms so that the shared library objects are -useful for the PIC PAM modules, support 32-bit SPARC builds with the 2.4 -and 2.6 kernels (hopefully), and allow hppa as well as parisc (needed for -the new config.guess). - -This should be okay upstream. The PIC part has been submitted. - ---- openafs-1.3.87.orig/src/cf/osconf.m4 -+++ openafs-1.3.87/src/cf/osconf.m4 -@@ -241,6 +241,7 @@ - MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' - MT_LIBS="-lpthread" - PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" -+ SHLIB_CFLAGS="-fPIC" - SHLIB_LDFLAGS="-shared -Xlinker -x" - TXLIBS="-lncurses" - XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE -G0" -@@ -268,6 +269,7 @@ - MT_LIBS="-lpthread" - PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" - SHLIB_LDFLAGS="-shared -Xlinker -x" -+ SHLIB_CFLAGS="-fPIC" - TXLIBS="/usr/lib64/libncurses.so" - XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" - SHLIB_LINKER="${MT_CC} -shared" -@@ -296,6 +298,7 @@ - MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' - MT_LIBS="-lpthread" - PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" -+ SHLIB_CFLAGS="-fPIC" - SHLIB_LDFLAGS="-shared -Xlinker -x" - TXLIBS="-lncurses" - XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" -@@ -317,6 +320,7 @@ - LWP_OPTMZ=-O2 - OPTMZ=-O2 - PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" -+ SHLIB_CFLAGS="-fPIC" - SHLIB_LDFLAGS="-shared -Xlinker -x" - TXLIBS="-lncurses" - XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" -@@ -337,6 +341,7 @@ - LWP_OPTMZ=-O2 - OPTMZ=-O2 - PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" -+ SHLIB_CFLAGS="-fPIC" - SHLIB_LDFLAGS="-shared -Xlinker -x" - TXLIBS="-lncurses" - XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" -@@ -357,6 +362,7 @@ - LWP_OPTMZ=-O2 - OPTMZ=-O2 - PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" -+ SHLIB_CFLAGS="-fPIC" - SHLIB_LDFLAGS="-shared -Xlinker -x" - TXLIBS="-lncurses" - XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" -@@ -381,6 +387,7 @@ - MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' - MT_LIBS="-lpthread" - PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" -+ SHLIB_CFLAGS="-fPIC" - SHLIB_LDFLAGS="-shared -Xlinker -x" - TXLIBS="-lncurses" - XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" -@@ -452,6 +459,7 @@ - MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' - MT_LIBS="-lpthread" - PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" -+ SHLIB_CFLAGS="-fPIC" - SHLIB_LDFLAGS="-shared -Xlinker -x" - TXLIBS="-lncurses" - XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" -@@ -530,6 +538,7 @@ - MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' - MT_LIBS="-lpthread" - PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" -+ SHLIB_CFLAGS="-fPIC" - SHLIB_LDFLAGS="-shared -Xlinker -x" - TXLIBS="-lncurses" - XCFLAGS="-O -g -D_LARGEFILE64_SOURCE" -@@ -547,6 +556,7 @@ - MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' - MT_LIBS="-lpthread" - PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" -+ SHLIB_CFLAGS="-fPIC" - SHLIB_LDFLAGS="-shared -Xlinker -x" - TXLIBS="-lncurses" - XCFLAGS="-O -g -D_LARGEFILE64_SOURCE" -@@ -564,6 +574,7 @@ - MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' - MT_LIBS="-lpthread" - PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" -+ SHLIB_CFLAGS="-fPIC" - SHLIB_LDFLAGS="-shared -Xlinker -x -Xlinker -Bsymbolic" - TXLIBS="-lncurses" - XCFLAGS="-O -g -D_LARGEFILE64_SOURCE -D__s390x__" -@@ -633,38 +644,13 @@ - SHLIB_LINKER="${CC} -shared" - ;; - -- sparc64_linux22) -- KERN_OPTMZ=-O2 -- LEX="flex -l" -- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' -- MT_LIBS="-lpthread" -- PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" -- SHLIB_LDFLAGS="-shared -Xlinker -x" -- TXLIBS="-lncurses" -- XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" -- YACC="bison -y" -- SHLIB_LINKER="${MT_CC} -shared" -- ;; -- -- sparc64_linux24) -- KERN_OPTMZ=-O2 -- LEX="flex -l" -- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' -- MT_LIBS="-lpthread" -- PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" -- SHLIB_LDFLAGS="-shared -Xlinker -x" -- TXLIBS="-lncurses" -- XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" -- YACC="bison -y" -- SHLIB_LINKER="${MT_CC} -shared" -- ;; -- -- sparc_linux22) -+ sparc*_linux*) - KERN_OPTMZ=-O2 - LEX="flex -l" - MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' - MT_LIBS="-lpthread" - PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" -+ SHLIB_CFLAGS="-fPIC" - SHLIB_LDFLAGS="-shared -Xlinker -x" - TXLIBS="-lncurses" - XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" ---- openafs-1.3.87.orig/acinclude.m4 -+++ openafs-1.3.87/acinclude.m4 -@@ -491,7 +491,7 @@ - i?86-*-linux*) - AFS_SYSNAME="i386_linuxXX" - ;; -- parisc-*-linux-gnu) -+ parisc-*-linux-gnu|hppa-*-linux-gnu) - AFS_SYSNAME="parisc_linuxXX" - enable_pam="no" - ;; diff --git a/debian/patches/pag-cleanup-lock b/debian/patches/pag-cleanup-lock new file mode 100644 index 000000000..da7fb64a2 --- /dev/null +++ b/debian/patches/pag-cleanup-lock @@ -0,0 +1,25 @@ +Make sure the AFS lock is held when a user process in a PAG exits, since +otherwise we may crash. Pulled from the upstream stable branch, will be +in 1.4.5. + +--- openafs.orig/src/afs/LINUX/osi_groups.c ++++ openafs/src/afs/LINUX/osi_groups.c +@@ -594,13 +594,18 @@ + { + afs_uint32 pag = key->payload.value; + struct unixuser *pu; ++ int locked = ISAFS_GLOCK(); + ++ if (!locked) ++ AFS_GLOCK(); + pu = afs_FindUser(pag, -1, READ_LOCK); + if (pu) { + pu->ct.EndTimestamp = 0; + pu->tokenTime = 0; + afs_PutUser(pu, READ_LOCK); + } ++ if (!locked) ++ AFS_GUNLOCK(); + } + + struct key_type key_type_afs_pag = diff --git a/debian/patches/pam b/debian/patches/pam deleted file mode 100644 index c0f00b005..000000000 --- a/debian/patches/pam +++ /dev/null @@ -1,158 +0,0 @@ -The standard upstream source builds the PAM modules against static -libraries, which means they contain non-PIC code. This isn't allowed by -Debian Policy and doesn't work on some supported platforms. - -Two approaches for fixing this have been tried. One is to rebuild the -various object files that are part of the libraries PIC and then link with -those object files. The other, which this implements, is to link with the -object files used to create the libafsauthent and libafsrpc shared -libraries (which can't be shipped since they don't have a stable API or -correct SONAME). The latter means that the PAM modules must also be -linked with libpthread, but that's a feature since that means they'll work -with sshd built threaded. - -Not submitted upstream yet. The call to rx_Init should be submitted -upstream and would probably be accepted. Upstream would probably rather -link the PAM modules against the shared libraries rather than accepting -this hack, which is unsuitable for Debian until the shared libraries are -handled more consistently. - ---- openafs-1.3.87.orig/src/pam/Makefile.in -+++ openafs-1.3.87/src/pam/Makefile.in -@@ -25,7 +25,17 @@ - afs_pam_msg.o afs_message.o AFS_component_version_number.o - OBJS = $(SHOBJS) test_pam.o - INCLUDES=-I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} --CFLAGS = ${DEBUG} ${INCLUDES} ${PAM_CFLAGS} -+CFLAGS = ${DEBUG} ${INCLUDES} ${PAM_CFLAGS} ${MT_CFLAGS} -+ -+# For Debian, we link directly with the object files that would have gone -+# into the libafsrpc and libafsauthent shared libraries. The shared libraries -+# themselves cannot be used because the interface isn't stable and they have -+# no SONAME, but this is the easiest way of getting PIC objects built with the -+# pthread API. -+SHLIB_OBJS := `ls ../shlibafsauthent/*.o | grep -v version_num` \ -+ `ls ../shlibafsrpc/*.o | grep -v version_num` -+KRB_SHLIB_OBJS := `ls ../shlibafsauthent/*.o | egrep -v 'version_num|ktc.o'` \ -+ `ls ../shlibafsrpc/*.o | grep -v version_num` - - all: test_pam ${TOP_LIBDIR}/pam_afs.so.1 ${TOP_LIBDIR}/pam_afs.krb.so.1 - -@@ -39,14 +49,18 @@ - ${CC} ${CFLAGS} -c ${srcdir}/afs_auth.c -o afs_auth.o - - afs_auth_krb.o: afs_auth.c afs_pam_msg.h afs_message.h afs_util.h -- ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/afs_auth.c -o afs_auth_krb.o -+ ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/afs_auth.c -o afs_auth_krb.o - - afs_util.o: afs_util.c afs_pam_msg.h afs_message.h afs_util.h - ${CC} ${CFLAGS} -c ${srcdir}/afs_util.c -o afs_util.o - -+ - afs_util_krb.o: afs_util.c afs_pam_msg.h afs_message.h afs_util.h - ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/afs_util.c -o afs_util_krb.o - -+ktc.o: ${srcdir}/../auth/ktc.c -+ ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/../auth/ktc.c -+ - pam_afs.so.1: $(SHOBJS) afs_setcred.o afs_auth.o afs_util.o - set -x; \ - case "$(SYS_NAME)" in \ -@@ -59,8 +73,9 @@ - afs_setcred.o afs_auth.o afs_util.o \ - $(SHOBJS) $(LIBS) ;; \ - *linux*) \ -- $(CC) $(LDFLAGS) -o $@ afs_setcred.o \ -- afs_auth.o afs_util.o $(SHOBJS) $(LIBS) ;;\ -+ $(CC) $(LDFLAGS) $(PAM_CFLAGS) -o $@ afs_setcred.o \ -+ afs_auth.o afs_util.o $(SHOBJS) $(SHLIB_OBJS) \ -+ $(MT_LIBS) -lpam -lresolv;;\ - *fbsd*| *nbsd*) \ - $(CC) $(LDFLAGS) -o $@ afs_setcred.o \ - afs_auth.o afs_util.o $(SHOBJS) $(LIBS) ;;\ -@@ -68,7 +83,7 @@ - echo No link line for system $(SYS_NAME). ;; \ - esac - --pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o -+pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o ktc.o - set -x; \ - case "$(SYS_NAME)" in \ - hp_ux* | ia64_hpux*) \ -@@ -81,7 +96,8 @@ - $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \ - *linux*) \ - $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o \ -- afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(KLIBS) ;;\ -+ afs_auth_krb.o afs_util_krb.o ktc.o $(SHOBJS) \ -+ $(KRB_SHLIB_OBJS) $(MT_LIBS) -lpam -lresolv;;\ - *fbsd*| *nbsd*) \ - $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o \ - afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(KLIBS) ;;\ ---- openafs-1.3.87.orig/src/pam/afs_setcred.c -+++ openafs-1.3.87/src/pam/afs_setcred.c -@@ -52,7 +52,7 @@ - int refresh_token = 0; - int set_expires = 0; /* the default is to not to set the env variable */ - int use_klog = 0; -- int i; -+ int i, code; - struct pam_conv *pam_convp = NULL; - char my_password_buf[256]; - char *cell_ptr = NULL; -@@ -281,6 +281,11 @@ - #endif - } - -+ if ((code = rx_Init(0)) != 0) { -+ pam_afs_syslog(LOG_ERR, PAMAFS_KAERROR, code); -+ RET(PAM_AUTH_ERR); -+ } -+ - if (flags & PAM_REFRESH_CRED) { - if (use_klog) { - auth_ok = !do_klog(user, password, "00:00:01", cell_ptr); ---- openafs-1.3.87.orig/src/pam/afs_auth.c -+++ openafs-1.3.87/src/pam/afs_auth.c -@@ -314,6 +314,10 @@ - if (cpid <= 0) { /* The child process */ - if (logmask && LOG_MASK(LOG_DEBUG)) - syslog(LOG_DEBUG, "in child"); -+ if ((code = rx_Init(0)) != 0) { -+ pam_afs_syslog(LOG_ERR, PAMAFS_KAERROR, code); -+ exit(0); -+ } - if (refresh_token || set_token) - code = ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION, user, /* kerberos name */ - NULL, /* instance */ -@@ -363,6 +367,10 @@ - pam_afs_syslog(LOG_ERR, PAMAFS_PAMERROR, errno); - } - } else { /* dont_fork, used by httpd */ -+ if ((code = rx_Init(0)) != 0) { -+ pam_afs_syslog(LOG_ERR, PAMAFS_KAERROR, code); -+ RET(PAM_AUTH_ERR); -+ } - if (logmask && LOG_MASK(LOG_DEBUG)) - syslog(LOG_DEBUG, "dont_fork"); - if (refresh_token || set_token) ---- openafs-1.3.87.orig/Makefile.in -+++ openafs-1.3.87/Makefile.in -@@ -507,8 +507,6 @@ - # pthread based user space RX library - shlibafsrpc: rx rxkad des - case ${SYS_NAME} in \ -- amd64_linux24) \ -- echo Skipping shlibafsrpc for amd64_linux24 ;; \ - alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ - ${COMPILE_PART1} shlibafsrpc ${COMPILE_PART2} ;; \ - *) \ -@@ -517,8 +515,6 @@ - - shlibafsauthent: ubik auth kauth shlibafsrpc - case ${SYS_NAME} in \ -- amd64_linux24) \ -- echo Skipping shlibafsauthent for amd64_linux24 ;; \ - alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ - ${COMPILE_PART1} shlibafsauthent ${COMPILE_PART2} ;; \ - *) \ diff --git a/debian/patches/pam-build b/debian/patches/pam-build new file mode 100644 index 000000000..9000aab04 --- /dev/null +++ b/debian/patches/pam-build @@ -0,0 +1,88 @@ +Apply an incredibly ugly hack to build the PAM modules against the shared +objects generated for the shared libraries. Not suitable upstream in its +current form. The right upstream solution is to standardize the shared +library ABI and install it with a real SONAME, and then link the PAM +modules against it. + +--- openafs.orig/Makefile.in ++++ openafs/Makefile.in +@@ -515,8 +515,6 @@ + # pthread based user space RX library + shlibafsrpc: rx rxkad des + case ${SYS_NAME} in \ +- amd64_linux24) \ +- echo Skipping shlibafsrpc for amd64_linux24 ;; \ + alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ + ${COMPILE_PART1} shlibafsrpc ${COMPILE_PART2} ;; \ + *) \ +@@ -525,8 +523,6 @@ + + shlibafsauthent: ubik auth kauth shlibafsrpc + case ${SYS_NAME} in \ +- amd64_linux24) \ +- echo Skipping shlibafsauthent for amd64_linux24 ;; \ + alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ + ${COMPILE_PART1} shlibafsauthent ${COMPILE_PART2} ;; \ + *) \ +--- openafs.orig/src/pam/Makefile.in ++++ openafs/src/pam/Makefile.in +@@ -25,7 +25,17 @@ + afs_pam_msg.o afs_message.o AFS_component_version_number.o + OBJS = $(SHOBJS) test_pam.o + INCLUDES=-I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} +-CFLAGS = ${DEBUG} ${INCLUDES} ${PAM_CFLAGS} ++CFLAGS = ${DEBUG} ${INCLUDES} ${PAM_CFLAGS} ${MT_CFLAGS} ++ ++# For Debian, we link directly with the object files that would have gone ++# into the libafsrpc and libafsauthent shared libraries. The shared libraries ++# themselves cannot be used because the interface isn't stable and they have ++# no SONAME, but this is the easiest way of getting PIC objects built with the ++# pthread API. ++SHLIB_OBJS := `ls ../shlibafsauthent/*.o | grep -v version_num` \ ++ `ls ../shlibafsrpc/*.o | grep -v version_num` ++KRB_SHLIB_OBJS := `ls ../shlibafsauthent/*.o | egrep -v 'version_num|ktc.o'` \ ++ `ls ../shlibafsrpc/*.o | grep -v version_num` + + all: test_pam ${TOP_LIBDIR}/pam_afs.so.1 ${TOP_LIBDIR}/pam_afs.krb.so.1 + +@@ -47,6 +57,9 @@ + afs_util_krb.o: afs_util.c afs_pam_msg.h afs_message.h afs_util.h + ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/afs_util.c -o afs_util_krb.o + ++ktc.o: ${srcdir}/../auth/ktc.c ++ ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/../auth/ktc.c ++ + pam_afs.so.1: $(SHOBJS) afs_setcred.o afs_auth.o afs_util.o + set -x; \ + case "$(SYS_NAME)" in \ +@@ -59,8 +72,9 @@ + afs_setcred.o afs_auth.o afs_util.o \ + $(SHOBJS) $(LIBS) ;; \ + *linux*) \ +- $(CC) $(LDFLAGS) -o $@ afs_setcred.o \ +- afs_auth.o afs_util.o $(SHOBJS) $(LIBS) ;;\ ++ $(CC) $(LDFLAGS) $(PAM_CFLAGS) -o $@ afs_setcred.o \ ++ afs_auth.o afs_util.o $(SHOBJS) $(SHLIB_OBJS) \ ++ $(MT_LIBS) -lpam -lresolv;;\ + *fbsd*| *nbsd*) \ + $(CC) $(LDFLAGS) -o $@ afs_setcred.o \ + afs_auth.o afs_util.o $(SHOBJS) $(LIBS) ;;\ +@@ -68,7 +82,7 @@ + echo No link line for system $(SYS_NAME). ;; \ + esac + +-pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o ++pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o ktc.o + set -x; \ + case "$(SYS_NAME)" in \ + hp_ux* | ia64_hpux*) \ +@@ -81,7 +95,8 @@ + $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \ + *linux*) \ + $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o \ +- afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(KLIBS) ;;\ ++ afs_auth_krb.o afs_util_krb.o ktc.o $(SHOBJS) \ ++ $(KRB_SHLIB_OBJS) $(MT_LIBS) -lpam -lresolv;;\ + *fbsd*| *nbsd*) \ + $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o \ + afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(KLIBS) ;;\ diff --git a/debian/patches/paravirt-workaround b/debian/patches/paravirt-workaround index be20d821e..f1d497bd7 100644 --- a/debian/patches/paravirt-workaround +++ b/debian/patches/paravirt-workaround @@ -1,10 +1,34 @@ -Index: src/afs/LINUX/osi_machdep.h -=================================================================== -RCS file: /cvs/openafs/src/afs/LINUX/osi_machdep.h,v -retrieving revision 1.22.2.17 -diff -u -d -r1.22.2.17 osi_machdep.h ---- src/afs/LINUX/osi_machdep.h 8 Feb 2007 22:41:20 -0000 1.22.2.17 -+++ src/afs/LINUX/osi_machdep.h 18 Apr 2007 23:23:28 -0000 +Work around versions of Linux that don't export the paravirt_ops table +for non-GPL modules, but which redirect core functions through it. This +has been fixed in Linux 2.6.22, so this patch can be dropped when 2.6.22 +makes it into testing. + +--- openafs.orig/src/afs/LINUX/osi_groups.c ++++ openafs/src/afs/LINUX/osi_groups.c +@@ -230,6 +230,7 @@ + struct key *old; + char desc[20]; + unsigned long not_in_quota; ++ unsigned long f; + int code = -EINVAL; + + if (!__key_type_keyring) +@@ -265,11 +266,11 @@ + } + + /* install the keyring */ +- spin_lock_irq(&task->sighand->siglock); ++ SIG_LOCK(task, f); + old = task->signal->session_keyring; + smp_wmb(); + task->signal->session_keyring = keyring; +- spin_unlock_irq(&task->sighand->siglock); ++ SIG_UNLOCK(task, f); + + if (old) + key_put(old); +--- openafs.orig/src/afs/LINUX/osi_machdep.h ++++ openafs/src/afs/LINUX/osi_machdep.h @@ -55,14 +55,14 @@ #endif @@ -26,13 +50,8 @@ diff -u -d -r1.22.2.17 osi_machdep.h #endif #if defined (STRUCT_TASK_STRUCT_HAS_RLIM) -Index: src/afs/LINUX/osi_misc.c -=================================================================== -RCS file: /cvs/openafs/src/afs/LINUX/osi_misc.c,v -retrieving revision 1.34.2.10 -diff -u -d -r1.34.2.10 osi_misc.c ---- src/afs/LINUX/osi_misc.c 11 Jul 2005 19:29:56 -0000 1.34.2.10 -+++ src/afs/LINUX/osi_misc.c 18 Apr 2007 23:23:28 -0000 +--- openafs.orig/src/afs/LINUX/osi_misc.c ++++ openafs/src/afs/LINUX/osi_misc.c @@ -353,10 +353,11 @@ void osi_linux_mask(void) @@ -47,14 +66,9 @@ diff -u -d -r1.34.2.10 osi_misc.c } void -Index: src/afs/LINUX/osi_sleep.c -=================================================================== -RCS file: /cvs/openafs/src/afs/LINUX/osi_sleep.c,v -retrieving revision 1.22.2.10 -diff -u -d -r1.22.2.10 osi_sleep.c ---- src/afs/LINUX/osi_sleep.c 4 Jan 2007 21:26:34 -0000 1.22.2.10 -+++ src/afs/LINUX/osi_sleep.c 18 Apr 2007 23:23:29 -0000 -@@ -240,19 +240,20 @@ +--- openafs.orig/src/afs/LINUX/osi_sleep.c ++++ openafs/src/afs/LINUX/osi_sleep.c +@@ -244,19 +244,20 @@ afs_osi_Sleep(void *event) { sigset_t saved_set; @@ -79,42 +93,8 @@ diff -u -d -r1.22.2.10 osi_sleep.c } /* osi_TimedSleep -Index: src/afs/LINUX/osi_groups.c -=================================================================== -RCS file: /cvs/openafs/src/afs/LINUX/osi_groups.c,v -retrieving revision 1.25.2.8 -diff -u -d -r1.25.2.8 osi_groups.c ---- src/afs/LINUX/osi_groups.c 15 Jan 2007 15:52:46 -0000 1.25.2.8 -+++ src/afs/LINUX/osi_groups.c 18 Apr 2007 23:23:29 -0000 -@@ -230,6 +230,7 @@ - struct key *old; - char desc[20]; - unsigned long not_in_quota; -+ unsigned long f; - int code = -EINVAL; - - if (!__key_type_keyring) -@@ -265,11 +266,11 @@ - } - - /* install the keyring */ -- spin_lock_irq(&task->sighand->siglock); -+ SIG_LOCK(task, f); - old = task->signal->session_keyring; - smp_wmb(); - task->signal->session_keyring = keyring; -- spin_unlock_irq(&task->sighand->siglock); -+ SIG_UNLOCK(task); - - if (old) - key_put(old); -Index: src/rx/LINUX/rx_kmutex.c -=================================================================== -RCS file: /cvs/openafs/src/rx/LINUX/rx_kmutex.c,v -retrieving revision 1.7.2.7 -diff -u -d -r1.7.2.7 rx_kmutex.c ---- src/rx/LINUX/rx_kmutex.c 28 Dec 2006 21:32:09 -0000 1.7.2.7 -+++ src/rx/LINUX/rx_kmutex.c 18 Apr 2007 23:23:29 -0000 +--- openafs.orig/src/rx/LINUX/rx_kmutex.c ++++ openafs/src/rx/LINUX/rx_kmutex.c @@ -104,11 +104,12 @@ MUTEX_EXIT(l); @@ -130,7 +110,7 @@ diff -u -d -r1.7.2.7 rx_kmutex.c } while(seq == cv->seq) { -@@ -140,10 +141,11 @@ +@@ -144,10 +145,11 @@ set_current_state(TASK_RUNNING); if (!sigok) { diff --git a/debian/patches/paths b/debian/patches/paths new file mode 100644 index 000000000..4d9a27c35 --- /dev/null +++ b/debian/patches/paths @@ -0,0 +1,16 @@ +Patch pt_util to use the correct Debian patch for the Protection Server +database. Not suitable upstream in its current form, but will be +obsolete if upstream uses the standard functions to figure out the +database path. + +--- openafs.orig/src/ptserver/pt_util.c ++++ openafs/src/ptserver/pt_util.c +@@ -136,7 +136,7 @@ + struct prentry uentry, gentry; + struct ubik_hdr *uh; + char *dfile = 0; +- char *pfile = "/usr/afs/db/prdb.DB0"; ++ char *pfile = "/var/lib/openafs/db/prdb.DB0"; + struct cmd_parmdesc *tparm; + + tparm = a_as->parms; diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 000000000..203a6a449 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,18 @@ +dfsg +paths +fstrace-paths +module-name +pam-build +bos-permissions +compiler-flags +amd64-syscall-probe +des-alignment +ka-forwarder +kbuild-assembly +linux-2.6.22 +linux-2.6.22.1-proc +null-uuid-client +null-uuid-server +pag-cleanup-lock +ucontext-everywhere +paravirt-workaround diff --git a/debian/patches/ucontext-everywhere b/debian/patches/ucontext-everywhere new file mode 100644 index 000000000..326cc6376 --- /dev/null +++ b/debian/patches/ucontext-everywhere @@ -0,0 +1,151 @@ +Build with UCONTEXT everywhere for current glibc. Patch pulled from +upstream stable branch, will be in 1.4.5. + +--- openafs.orig/src/config/param.alpha_linux_26.h ++++ openafs/src/config/param.alpha_linux_26.h +@@ -81,6 +81,11 @@ + #define SYS_NAME_ID SYS_NAME_ID_alpha_linux_26 + + ++#ifdef __GLIBC__ ++#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) ++#define USE_UCONTEXT ++#endif ++#endif + #endif /* AFS_PARAM_H */ + + #else /* !defined(UKERNEL) */ +--- openafs.orig/src/config/param.ia64_linux24.h ++++ openafs/src/config/param.ia64_linux24.h +@@ -87,6 +87,7 @@ + #endif + #endif /* KERNEL */ + ++#define USE_UCONTEXT /* should be in afsconfig.h */ + + #endif /* _PARAM_IA64_LINUX20_H_ */ + +@@ -157,6 +158,7 @@ + #define CMSERVERPREF + #endif + ++#define USE_UCONTEXT /* should be in afsconfig.h */ + + #endif /* AFS_PARAM_H */ + +--- openafs.orig/src/config/param.ia64_linux26.h ++++ openafs/src/config/param.ia64_linux26.h +@@ -96,6 +96,7 @@ + #endif + #endif /* KERNEL */ + ++#define USE_UCONTEXT /* should be in afsconfig.h */ + + #endif /* _PARAM_IA64_LINUX20_H_ */ + +@@ -167,6 +168,7 @@ + #define CMSERVERPREF + #endif + ++#define USE_UCONTEXT /* should be in afsconfig.h */ + + #endif /* AFS_PARAM_H */ + +--- openafs.orig/src/config/param.parisc_linux24.h ++++ openafs/src/config/param.parisc_linux24.h +@@ -70,6 +70,11 @@ + #endif + #endif /* KERNEL */ + ++#ifdef __GLIBC__ ++#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) ++#define USE_UCONTEXT ++#endif ++#endif + #endif /* AFS_PARAM_H */ + + #else /* !defined(UKERNEL) */ +--- openafs.orig/src/config/param.ppc64_linux26.h ++++ openafs/src/config/param.ppc64_linux26.h +@@ -76,6 +76,11 @@ + #endif + #endif /* KERNEL */ + ++#ifdef __GLIBC__ ++#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) ++#define USE_UCONTEXT ++#endif ++#endif + #endif /* _PARAM_PPC64_LINUX20_H_ */ + + #else /* !defined(UKERNEL) */ +--- openafs.orig/src/config/param.ppc_linux26.h ++++ openafs/src/config/param.ppc_linux26.h +@@ -74,6 +74,11 @@ + #endif + #endif /* KERNEL */ + ++#ifdef __GLIBC__ ++#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) ++#define USE_UCONTEXT ++#endif ++#endif + #endif /* AFS_PARAM_H */ + + #else /* !defined(UKERNEL) */ +--- openafs.orig/src/config/param.s390_linux26.h ++++ openafs/src/config/param.s390_linux26.h +@@ -86,6 +86,11 @@ + #endif + #endif /* KERNEL */ + ++#ifdef __GLIBC__ ++#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) ++#define USE_UCONTEXT ++#endif ++#endif + #endif /* AFS_PARAM_H */ + + #else /* !defined(UKERNEL) */ +--- openafs.orig/src/config/param.s390x_linux26.h ++++ openafs/src/config/param.s390x_linux26.h +@@ -89,6 +89,11 @@ + #endif + #endif /* KERNEL */ + ++#ifdef __GLIBC__ ++#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) ++#define USE_UCONTEXT ++#endif ++#endif + #endif /* AFS_PARAM_H */ + + #else /* !defined(UKERNEL) */ +--- openafs.orig/src/config/param.sparc64_linux26.h ++++ openafs/src/config/param.sparc64_linux26.h +@@ -95,6 +95,11 @@ + #endif + #endif + ++#ifdef __GLIBC__ ++#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) ++#define USE_UCONTEXT ++#endif ++#endif + #endif /* _PARAM_SPARC64_LINUX26_H_ */ + + #else /* !defined(UKERNEL) */ +--- openafs.orig/src/config/param.sparc_linux24.h ++++ openafs/src/config/param.sparc_linux24.h +@@ -98,6 +98,11 @@ + #endif + #endif + ++#ifdef __GLIBC__ ++#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) ++#define USE_UCONTEXT ++#endif ++#endif + #endif /* AFS_PARAM_H */ + + #else /* !defined(UKERNEL) */ diff --git a/doc/man-pages/pod8/ka-forwarder.pod b/doc/man-pages/pod8/ka-forwarder.pod deleted file mode 100644 index 321f900b9..000000000 --- a/doc/man-pages/pod8/ka-forwarder.pod +++ /dev/null @@ -1,85 +0,0 @@ -=head1 NAME - -ka-forwarder - Forward AFS Authentication Server requests to another server - -=head1 SYNOPSIS - -=for html -
- -B S<<< [B<-p> >] >>> >[/>] [...] - -=for html -
- -=head1 DESCRIPTION - -B listens for requests for an AFS Authentication Server and -forwards them to a remove B server. B is a server that -answers AFS Authentication Server protocol requests using a regular -Kerberos KDC and is provided with some Kerberos 5 implementations. -B has to run on the same host as the Kerberos KDC, however, and -AFS clients send all native AFS authentication requests to the AFS -database servers. If you don't want to run your Kerberos KDCs and your -AFS database servers on the same host, run B on the AFS -database servers and point it to B running on the Kerberos KDCs. - -B takes one or more servers to which to forward the -requests. The default port on the remote server to which to forward the -command is 7004, but a different port can be specified by following the -server name with a slash (C) and the port number. If multiple servers -are given, B will send queries to each server in turn in a -round-robin fashion. - -=head1 CAUTIONS - -Due to the way that B distinguishes from client requests and -server responses, any messages from one of the servers to which -B is forwarding will be considered a reply rather than a -command and will not be forwarded. This means that the servers running -B will not be able to use native AFS authentication requests and -rely on B to send the requests to the right server. - -B does not background itself. It should either be run in -the background via the shell, or run via the Basic OverSeer Server (see -L). - -=head1 OPTIONS - -=over 4 - -=item B<-p> > - -By default, B listens to the standard AFS Authentication -Server port (7004). To listen to a different port, specify it with the -B<-p> option. - -=back - -=head1 EXAMPLES - -Forward AFS Authentication Server reqests to the B servers on -kdc1.example.com and kdc2.example.com: - - % ka-forwarder kdc1.example.com kdc2.example.com & - -Note the C<&> to tell the shell to run this command in the background. - -=head1 PRIVILEGE REQUIRED - -B only has to listen to port 7004 and therefore does not -require any special privileges unless a privileged port is specified with -the B<-p> option. - -=head1 SEE ALSO - -L, -fakeka(8), -L - -=head1 COPYRIGHT - -Copyright 2006 Russ Allbery - -This documentation is covered by the IBM Public License Version 1.0. This -man page was written by Russ Allbery for OpenAFS. diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index 1078056e5..c94977e74 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -230,7 +230,6 @@ install_session_keyring(struct task_struct *task, struct key *keyring) struct key *old; char desc[20]; unsigned long not_in_quota; - unsigned long f; int code = -EINVAL; if (!__key_type_keyring) @@ -266,11 +265,11 @@ install_session_keyring(struct task_struct *task, struct key *keyring) } /* install the keyring */ - SIG_LOCK(task, f); + spin_lock_irq(&task->sighand->siglock); old = task->signal->session_keyring; smp_wmb(); task->signal->session_keyring = keyring; - SIG_UNLOCK(task, f); + spin_unlock_irq(&task->sighand->siglock); if (old) key_put(old); @@ -595,18 +594,13 @@ static void afs_pag_destroy(struct key *key) { afs_uint32 pag = key->payload.value; struct unixuser *pu; - int locked = ISAFS_GLOCK(); - if (!locked) - AFS_GLOCK(); pu = afs_FindUser(pag, -1, READ_LOCK); if (pu) { pu->ct.EndTimestamp = 0; pu->tokenTime = 0; afs_PutUser(pu, READ_LOCK); } - if (!locked) - AFS_GUNLOCK(); } struct key_type key_type_afs_pag = diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h index 57b047f2c..836a98df1 100644 --- a/src/afs/LINUX/osi_machdep.h +++ b/src/afs/LINUX/osi_machdep.h @@ -55,14 +55,14 @@ #endif #if defined (STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK) -#define SIG_LOCK(X,flags) spin_lock_irqsave(&X->sigmask_lock,flags) -#define SIG_UNLOCK(X),flags spin_unlock_irqrestore(&X->sigmask_lock,flags) +#define SIG_LOCK(X) spin_lock_irq(&X->sigmask_lock) +#define SIG_UNLOCK(X) spin_unlock_irq(&X->sigmask_lock) #elif defined (STRUCT_TASK_STRUCT_HAS_SIGHAND) -#define SIG_LOCK(X,flags) spin_lock_irqsave(&X->sighand->siglock,flags) -#define SIG_UNLOCK(X,flags) spin_unlock_irqrestore(&X->sighand->siglock,flags) +#define SIG_LOCK(X) spin_lock_irq(&X->sighand->siglock) +#define SIG_UNLOCK(X) spin_unlock_irq(&X->sighand->siglock) #else -#define SIG_LOCK(X,flags) spin_lock_irqsave(&X->sig->siglock,flags) -#define SIG_UNLOCK(X,flags) spin_unlock_irqrestore(&X->sig->siglock,flags) +#define SIG_LOCK(X) spin_lock_irq(&X->sig->siglock) +#define SIG_UNLOCK(X) spin_unlock_irq(&X->sig->siglock) #endif #if defined (STRUCT_TASK_STRUCT_HAS_RLIM) diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c index 72c95d827..41bec5b2a 100644 --- a/src/afs/LINUX/osi_misc.c +++ b/src/afs/LINUX/osi_misc.c @@ -353,11 +353,10 @@ struct task_struct *rxk_ListenerTask; void osi_linux_mask(void) { - unsigned long f; - SIG_LOCK(current, f); + SIG_LOCK(current); sigfillset(¤t->blocked); RECALC_SIGPENDING(current); - SIG_UNLOCK(current, f); + SIG_UNLOCK(current); } void diff --git a/src/afs/LINUX/osi_probe.c b/src/afs/LINUX/osi_probe.c index 1a812367f..16b5322dd 100644 --- a/src/afs/LINUX/osi_probe.c +++ b/src/afs/LINUX/osi_probe.c @@ -59,7 +59,6 @@ #include "afsincludes.h" #endif #include -#include #ifdef CONFIG_H_EXISTS #include #endif @@ -154,7 +153,6 @@ MODULE_PARM_DESC(probe_ignore_syscalls, "Syscalls to ignore in table checks"); * 0x0010 - detail - check_harder * 0x0020 - detail - check_harder/zapped * 0x0040 - automatically ignore setgroups and afs_syscall - * 0x0080 - detail - check_table_readable */ static int probe_debug = 0x41; #ifdef module_param @@ -300,10 +298,6 @@ typedef struct { int debug_ignore_NR[4]; /* syscalls to ignore for debugging */ } probectl; -#if defined(AFS_I386_LINUX26_ENV) || defined(AFS_AMD64_LINUX26_ENV) -static int check_access(unsigned long, int); -static int check_table_readable(probectl *, PROBETYPE *); -#endif /********** Probing Configuration: sys_call_table **********/ @@ -946,11 +940,6 @@ static int check_table(probectl *P, PROBETYPE *ptr) PROBETYPE *x; int i, j; -#if defined(AFS_I386_LINUX26_ENV) || defined(AFS_AMD64_LINUX26_ENV) - i = check_table_readable(P, ptr); - if (i >= 0) return i; -#endif - for (x = ptr, i = 0; i < _SS(NR_syscalls); i++, x++) { #ifdef OSI_PROBE_DEBUG if (probe_debug & 0x0040) { @@ -1073,11 +1062,6 @@ static int check_harder(probectl *P, PROBETYPE *p) unsigned long ip1; int i, s; -#if defined(AFS_I386_LINUX26_ENV) || defined(AFS_AMD64_LINUX26_ENV) - i = check_table_readable(P, p); - if (i >= 0) return 0; -#endif - /* Check zapped syscalls */ for (i = 1; i < P->n_zapped_syscalls; i++) { if (p[_SS(P->zapped_syscalls[i])] != p[_SS(P->zapped_syscalls[0])]) { @@ -1365,7 +1349,7 @@ static void *do_find_syscall_table(probectl *P, char **method) } #if defined(AFS_I386_LINUX26_ENV) || defined(AFS_AMD64_LINUX26_ENV) -static int check_access(unsigned long address, int mode) +static int check_writable(unsigned long address) { pgd_t *pgd = pgd_offset_k(address); #ifdef PUD_SIZE @@ -1390,34 +1374,10 @@ static int check_access(unsigned long address, int mode) pte = (pte_t *)pmd; else pte = pte_offset_kernel(pmd, address); - if (pte_none(*pte) || !pte_present(*pte)) - return 0; - if (mode && !pte_write(*pte)) + if (pte_none(*pte) || !pte_present(*pte) || !pte_write(*pte)) return 0; return 1; } - -static int check_table_readable(probectl *P, PROBETYPE *ptr) -{ - PROBETYPE *next_page; - int i = 0, delta; - - while (i < _SS(NR_syscalls)) { - next_page = (PROBETYPE *)PAGE_ALIGN((unsigned long)(ptr+1)); - delta = next_page - ptr; - if (!check_access((unsigned long)ptr, 0)) { -#ifdef OSI_PROBE_DEBUG - if (probe_debug & 0x0080) - printk("<7>osi_probe: %s 0x%016lx not readable; delta=0x%lx\n", - P->symbol, (unsigned long)ptr, delta); -#endif - return delta - 1; - } - ptr += delta; - i += delta; - } - return -1; -} #endif void *osi_find_syscall_table(int which) @@ -1445,7 +1405,7 @@ void *osi_find_syscall_table(int which) } printk("Found %s at 0x%lx (%s)\n", P->desc, (unsigned long)answer, method); #if defined(AFS_I386_LINUX26_ENV) || defined(AFS_AMD64_LINUX26_ENV) - if (!check_access((unsigned long)answer, 1)) { + if (!check_writable((unsigned long)answer)) { printk("Address 0x%lx is not writable.\n", (unsigned long)answer); printk("System call hooks will not be installed; proceeding anyway\n"); return 0; diff --git a/src/afs/LINUX/osi_sleep.c b/src/afs/LINUX/osi_sleep.c index 5a862f7fd..de782acd4 100644 --- a/src/afs/LINUX/osi_sleep.c +++ b/src/afs/LINUX/osi_sleep.c @@ -205,11 +205,7 @@ afs_osi_SleepSig(void *event) #if defined(STRUCT_TASK_STRUCT_HAS_TODO) !current->todo #else -#if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO) test_ti_thread_flag(current->thread_info, TIF_FREEZE) -#else - test_ti_thread_flag(task_thread_info(current), TIF_FREEZE) -#endif #endif #endif ) @@ -244,20 +240,19 @@ void afs_osi_Sleep(void *event) { sigset_t saved_set; - unsigned long f; - SIG_LOCK(current,f); + SIG_LOCK(current); saved_set = current->blocked; sigfillset(¤t->blocked); RECALC_SIGPENDING(current); - SIG_UNLOCK(current,f); + SIG_UNLOCK(current); afs_osi_SleepSig(event); - SIG_LOCK(current,f); + SIG_LOCK(current); current->blocked = saved_set; RECALC_SIGPENDING(current); - SIG_UNLOCK(current,f); + SIG_UNLOCK(current); } /* osi_TimedSleep @@ -308,11 +303,7 @@ osi_TimedSleep(char *event, afs_int32 ams, int aintok) #if defined(STRUCT_TASK_STRUCT_HAS_TODO) !current->todo #else -#if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO) test_ti_thread_flag(current->thread_info, TIF_FREEZE) -#else - test_ti_thread_flag(task_thread_info(current), TIF_FREEZE) -#endif #endif #endif ) diff --git a/src/afs/LINUX/osi_sysctl.c b/src/afs/LINUX/osi_sysctl.c index 56c0bcb8c..580a10e0b 100644 --- a/src/afs/LINUX/osi_sysctl.c +++ b/src/afs/LINUX/osi_sysctl.c @@ -1,7 +1,7 @@ /* * osi_sysctl.c: Linux sysctl interface to OpenAFS * - * $Id: osi_sysctl.c,v 1.7.2.5 2007/06/12 18:28:49 shadow Exp $ + * $Id: osi_sysctl.c,v 1.7.2.4 2007/02/22 21:49:01 shadow Exp $ * * Written Jan 30, 2002 by Kris Van Hees (Sine Nomine Associates) */ @@ -27,64 +27,35 @@ extern afs_int32 hm_retry_int; static struct ctl_table_header *afs_sysctl = NULL; static ctl_table afs_sysctl_table[] = { - { - .ctl_name = 1, - .procname = "hm_retry_RO", - .data = &hm_retry_RO, - .maxlen = sizeof(afs_int32), - .mode = 0644, - .proc_handler = &proc_dointvec - }, - { - .ctl_name = 2, - .procname = "hm_retry_RW", - .data = &hm_retry_RW, - .maxlen = sizeof(afs_int32), - .mode = 0644, - .proc_handler = &proc_dointvec - }, - { - .ctl_name = 3, - .procname = "hm_retry_int", - .data = &hm_retry_int, - .maxlen = sizeof(afs_int32), - .mode = 0644, - .proc_handler = &proc_dointvec - }, - { - .ctl_name = 4, - .procname = "GCPAGs", - .data = &afs_gcpags, - .maxlen = sizeof(afs_int32), - .mode = 0644, - .proc_handler = &proc_dointvec - }, - { - .ctl_name = 5, - .procname = "rx_deadtime", - .data = &afs_rx_deadtime, - .maxlen = sizeof(afs_int32), - .mode = 0644, - .proc_handler = &proc_dointvec - }, - { - .ctl_name = 6, - .procname = "bkVolPref", - .data = &afs_bkvolpref, - .maxlen = sizeof(afs_int32), - .mode = 0644, - .proc_handler = &proc_dointvec - }, + {1, "hm_retry_RO", + &hm_retry_RO, sizeof(afs_int32), 0644, NULL, + &proc_dointvec} + , + {2, "hm_retry_RW", + &hm_retry_RW, sizeof(afs_int32), 0644, NULL, + &proc_dointvec} + , + {3, "hm_retry_int", + &hm_retry_int, sizeof(afs_int32), 0644, NULL, + &proc_dointvec} + , + {4, "GCPAGs", + &afs_gcpags, sizeof(afs_int32), 0644, NULL, + &proc_dointvec} + , + {5, "rx_deadtime", + &afs_rx_deadtime, sizeof(afs_int32), 0644, NULL, + &proc_dointvec} + , + {6, "bkVolPref", + &afs_bkvolpref, sizeof(afs_int32), 0644, NULL, + &proc_dointvec} + , {0} }; static ctl_table fs_sysctl_table[] = { - { - .ctl_name = 1, - .procname = "afs", - .mode = 0555, - .child = afs_sysctl_table - }, + {1, "afs", NULL, 0, 0555, afs_sysctl_table}, {0} }; diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 1e01cd7a3..b9ad8d2f6 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -292,10 +292,8 @@ init_once(void * foo, kmem_cache_t * cachep, unsigned long flags) { struct vcache *vcp = (struct vcache *) foo; -#if defined(SLAB_CTOR_VERIFY) if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == SLAB_CTOR_CONSTRUCTOR) -#endif inode_init_once(AFSTOV(vcp)); } diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 108e63db5..7c761b617 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -473,11 +473,11 @@ afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp) #ifdef AFS_LINUX24_ENV if ((code == 0 || flp->fl_type == F_UNLCK) && (cmd == F_SETLK || cmd == F_SETLKW)) { -#ifdef POSIX_LOCK_FILE_WAIT_ARG - code = posix_lock_file(fp, flp, 0); -#else +#ifdef AFS_LINUX26_ENV flp->fl_flags &=~ FL_SLEEP; code = posix_lock_file(fp, flp); +#else + code = posix_lock_file(fp, flp, 0); #endif if (code && flp->fl_type != F_UNLCK) { struct AFS_FLOCK flock2; diff --git a/src/afs/Makefile.in b/src/afs/Makefile.in index 2f15bdae2..c03c8b90c 100644 --- a/src/afs/Makefile.in +++ b/src/afs/Makefile.in @@ -13,7 +13,7 @@ include @TOP_OBJDIR@/src/config/Makefile.config all: depinstall depinstall: ${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 afszcm.cat AFS_component_version_number.c ${TOP_INCDIR}/afs/unified_afs.h + ${TOP_INCDIR}/afs/exporter.h ${TOP_INCDIR}/afs/nfsclient.h afszcm.cat AFS_component_version_number.c ${TOP_INCDIR}/afs/unified_afs.h ${TOP_INCDIR}/afs/sysctl.h case ${SYS_NAME} in \ pmax_ul43 | pmax_ul43a) \ ${INSTALL} longc_procs.h ${TOP_INCDIR}/afs ;; \ @@ -43,7 +43,7 @@ afszcm.cat: afs_trace.msf gencat afszcm.cat afs_trace.msf ;; \ esac -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/unified_afs.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/unified_afs.h ${DESTDIR}${includedir}/afs/sysctl.h case ${SYS_NAME} in \ pmax_ul43 | pmax_ul43a) \ ${INSTALL} longc_procs.h ${DESTDIR}${includedir}/afs ;; \ @@ -131,7 +131,7 @@ ${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}/include/afs/unified_afs.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/unified_afs.h ${DEST}/include/afs/sysctl.h case ${SYS_NAME} in \ pmax_ul43 | pmax_ul43a) \ ${INSTALL} longc_procs.h ${DEST}/include/afs ;; \ diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index 5522e1696..f2fd25547 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -858,8 +858,6 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6) #if (!defined(AFS_NONFSTRANS)) || defined(AFS_AIX_IAUTH_ENV) afs_nfsclient_init(); #endif - if (afs_cb_interface.numberOfInterfaces < 1) - afs_uuid_create(&afs_cb_interface.uuid); printf("found %d non-empty cache files (%d%%).\n", afs_stats_cmperf.cacheFilesReused, (100 * afs_stats_cmperf.cacheFilesReused) / diff --git a/src/aklog/Makefile.in b/src/aklog/Makefile.in index 516076464..b50cf4d8a 100644 --- a/src/aklog/Makefile.in +++ b/src/aklog/Makefile.in @@ -16,7 +16,7 @@ AFSLIBS = ${TOP_LIBDIR}/libprot.a ${TOP_LIBDIR}/libubik.a \ SRCS= aklog.c aklog_main.c krb_util.c linked_list.c OBJS= aklog.o aklog_main.o krb_util.o linked_list.o -all: aklog asetkey ka-forwarder +all: aklog asetkey aklog: ${OBJS} ${AFSLIBS} ${CC} -o $@ ${CFLAGS} ${OBJS} ${AKLIBS} ${AFSLIBS} ${XLIBS} @@ -24,16 +24,11 @@ aklog: ${OBJS} ${AFSLIBS} asetkey: asetkey.o ${AFSLIBS} ${CC} -o $@ ${CFLAGS} asetkey.o ${AKLIBS} ${AFSLIBS} ${XLIBS} -ka-forwarder: ka-forwarder.o - ${CC} -o $@ ${CFLAGS} ka-forwarder.o ${LIBS} ${XLIBS} - # # Installation targets # install: \ - ${DESTDIR}${bindir}/aklog \ - ${DESTDIR}${afssrvbindir}/asetkey \ - ${DESTDIR}${afssrvbindir}/ka-forwarder + ${DESTDIR}${bindir}/aklog ${DESTDIR}${afssrvbindir}/asetkey ${DESTDIR}${bindir}/aklog: aklog ${INSTALL} $? $@ @@ -41,13 +36,8 @@ ${DESTDIR}${bindir}/aklog: aklog ${DESTDIR}${afssrvbindir}/asetkey: asetkey ${INSTALL} $? $@ -${DESTDIR}${afssrvbindir}/ka-forwarder: ka-forwarder - ${INSTALL} $? $@ - dest: \ - ${DEST}/bin/aklog \ - ${DEST}/root.server/usr/afs/bin/asetkey \ - ${DEST}/root.server/usr/afs/bin/ka-forwarder + ${DEST}/bin/aklog ${DEST}/root.server/usr/afs/bin/asetkey ${DEST}/bin/aklog: aklog ${INSTALL} $? $@ @@ -55,14 +45,11 @@ ${DEST}/bin/aklog: aklog ${DEST}/root.server/usr/afs/bin/asetkey: asetkey ${INSTALL} $? $@ -${DEST}/root.server/usr/afs/bin/ka-forwarder: ka-forwarder - ${INSTALL} $? $@ - # # Misc. targets # clean: - $(RM) -f *.o ${OBJS} aklog asetkey ka-forwarder + $(RM) -f *.o ${OBJS} aklog asetkey include ../config/Makefile.version diff --git a/src/aklog/ka-forwarder.c b/src/aklog/ka-forwarder.c deleted file mode 100644 index f8732d3d0..000000000 --- a/src/aklog/ka-forwarder.c +++ /dev/null @@ -1,282 +0,0 @@ -/* - * COPYRIGHT NOTICE - * Copyright (c) 1994 Carnegie Mellon University - * All Rights Reserved. - * - * See for use and distribution information. - */ - -/* - * HISTORY - * $Log: ka-forwarder.c,v $ - * Revision 1.1 1997/06/03 18:23:54 kenh - * . - * - * Revision 1.4 1996/08/09 01:00:21 jhutz - * When initializing the array of fakeka servers, remember to set - * the address family of each server; otherwise SunOS complains. - * [1996/08/09 00:58:46 jhutz] - * - * Revision 1.3 1996/08/09 00:17:19 jhutz - * Merged in changes from Chuck Silvers: - * - Support for more than one fakeka server - * - Support for specifying ports for each fakeka server separately from the - * others, and from the port we listen on. - * - * Plus a minor bug fix to Chuck's code. - * Basically, this version is designed to provide both reliability and - * load-balancing cheaply. Basically, we forward packets to all of the - * fakeka servers in round-robin fashion. So, if a client is losing on - * one server, its retry should go to a different one, if more than one - * is specified. - * [1996/08/03 02:13:36 jhutz] - * - * Revision 1.2 1995/02/23 18:26:36 chs - * Created. - * [1995/02/23 18:26:03 chs] - * - * $EndLog$ - */ - -/* - * This program is intended to run on afs DB servers. - * Its function is to forward KA requests to a fakeka server - * running on an MIT kerberos server. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if HAVE_GETOPT_H -#include -#else -int getopt (int, char * const *, const char *); -int optind, opterr; -char *optarg; -#endif - -#define BUFFER_SIZE 2048 - - -char *prog; - -int num_servers, cur_server; -struct sockaddr_in *servers; - - -void -perrorexit(str) -char *str; -{ - perror(str); - exit(1); -} - - -void -setup_servers(argc, argv) -int argc; -char **argv; -{ - int i; - u_int fwdaddr; - u_short fwdport; - - num_servers = argc; - - servers = malloc(sizeof(*servers) * num_servers); - if (servers == NULL) - perrorexit("malloc failed"); - - for (i = 0; i < num_servers; i++) { - char *host, *port; - - fwdport = htons(7004); - - host = argv[i]; - port = strchr(host, '/'); - if (port != NULL) { - *port++ = 0; - - if (isdigit(port[0])) { - fwdport = htons(atoi(port)); - } - else { - struct servent *srv = getservbyname(port, "udp"); - if (!srv) { - fprintf(stderr, "%s: unknown service %s\n", prog, port); - exit(1); - } - fwdport = srv->s_port; - } - } - - if (isdigit(host[0])) { - fwdaddr = inet_addr(host); - } - else { - struct hostent *h = gethostbyname(host); - if (!h) { - fprintf(stderr, "%s: unknown host %s\n", prog, host); - exit(1); - } - bcopy(h->h_addr, &fwdaddr, 4); - } - - servers[i].sin_family = AF_INET; - servers[i].sin_addr.s_addr = fwdaddr; - servers[i].sin_port = fwdport; - } -} - - -int -setup_socket(port) -u_short port; -{ - int s, rv; - struct sockaddr_in sin; - - s = socket(AF_INET, SOCK_DGRAM, 0); - if (s < 0) - perrorexit("Couldn't create socket"); - - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = 0; - sin.sin_port = htons(port); - - rv = bind(s, (struct sockaddr *)&sin, sizeof(sin)); - if (rv < 0) - perrorexit("Couldn't bind socket"); - - return s; -} - - -int -packet_is_reply(from) -struct sockaddr_in *from; -{ - int i; - - for (i = 0; i < num_servers; i++) { - struct sockaddr_in *sin = &servers[i]; - - if (from->sin_addr.s_addr == sin->sin_addr.s_addr && - from->sin_port == sin->sin_port) - { - return 1; - } - } - - return 0; -} - - -int -main(argc, argv) -int argc; -char **argv; -{ - int c, s, rv; - u_short port; - - if (argc < 2) { - fprintf(stderr, - "usage: %s [-p port] [/port] [host/port ...]\n", - argv[0]); - exit(1); - } - - prog = argv[0]; - port = 7004; - - while ((c = getopt(argc, argv, "p:")) != -1) { - switch (c) { - case 'p': - port = atoi(optarg); - break; - default: - fprintf(stderr, "%s: invalid option '%c'\n", prog, c); - exit(1); - } - } - - /* - * hmm, different implementations of getopt seem to do different things - * when there aren't any options. linux sets optind = 1, which I would - * call correct, but sunos sets optind = 0. try to do the right thing. - */ - if (optind == 0) - optind = 1; - - setup_servers(argc - optind, argv + optind); - s = setup_socket(port); - - openlog("ka-forwarder", LOG_PID, LOG_DAEMON); - - for (;;) { - char buf[BUFFER_SIZE], *bufp, *sendptr; - struct sockaddr_in from, reply, *to; - int fromlen, sendlen; - - bufp = buf + 8; - fromlen = sizeof(from); - - rv = recvfrom(s, bufp, sizeof(buf) - 8, - 0, (struct sockaddr *)&from, &fromlen); - if (rv < 0) { - syslog(LOG_ERR, "recvfrom: %m"); - sleep(1); - continue; - } - - if (packet_is_reply(&from)) { - /* this is a reply, forward back to user */ - - to = &reply; - reply.sin_family = AF_INET; - bcopy(bufp, &reply.sin_addr.s_addr, 4); - bcopy(bufp + 4, &reply.sin_port, 2); - sendptr = bufp + 8; - sendlen = rv - 8; - } - else { - /* this is a request, forward to server */ - - cur_server = (cur_server + 1) % num_servers; - to = &servers[cur_server]; - - bcopy(&from.sin_addr.s_addr, bufp - 8, 4); - bcopy(&from.sin_port, bufp - 4, 2); - - sendptr = bufp - 8; - sendlen = rv + 8; - } - - { - char a1[16], a2[16]; - strcpy(a1, inet_ntoa(from.sin_addr)); - strcpy(a2, inet_ntoa(to->sin_addr)); - - syslog(LOG_INFO, "forwarding %d bytes from %s/%d to %s/%d\n", - sendlen, a1, htons(from.sin_port), a2, htons(to->sin_port)); - } - - rv = sendto(s, sendptr, sendlen, - 0, (struct sockaddr *)to, sizeof(*to)); - if (rv < 0) { - syslog(LOG_ERR, "sendto: %m"); - } - } -} diff --git a/src/bozo/bosoprocs.c b/src/bozo/bosoprocs.c index 794830188..ce506a70d 100644 --- a/src/bozo/bosoprocs.c +++ b/src/bozo/bosoprocs.c @@ -1324,12 +1324,12 @@ SBOZO_EnumerateInstance(acall, anum, ainstance) struct bozo_bosEntryStats bozo_bosEntryStats[] = { {NULL, 1, 1, 0755, 02}, /* AFSDIR_SERVER_AFS_DIRPATH */ - {NULL, 1, 1, 0700, 02}, /* AFSDIR_SERVER_ETC_DIRPATH */ + {NULL, 1, 1, 0755, 02}, /* AFSDIR_SERVER_ETC_DIRPATH */ {NULL, 1, 1, 0755, 02}, /* AFSDIR_SERVER_BIN_DIRPATH */ {NULL, 1, 1, 0755, 02}, /* AFSDIR_SERVER_LOGS_DIRPATH */ {NULL, 1, 0, 0700, 07}, /* AFSDIR_SERVER_BACKUP_DIRPATH */ {NULL, 1, 1, 0700, 07}, /* AFSDIR_SERVER_DB_DIRPATH */ - {NULL, 1, 1, 0700, 02}, /* AFSDIR_SERVER_LOCAL_DIRPATH */ + {NULL, 1, 1, 0700, 07}, /* AFSDIR_SERVER_LOCAL_DIRPATH */ {NULL, 0, 1, 0600, 07}, /* AFSDIR_SERVER_KEY_FILEPATH */ {NULL, 0, 1, 0600, 03} }; /* AFSDIR_SERVER_ULIST_FILEPATH */ diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index cc6908c84..653464fb6 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -444,18 +444,6 @@ printk("%d\n", _tsk.exit_state);], AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_exit_state)]) -AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_THREAD_INFO], [ - AC_MSG_CHECKING([for thread_info in struct task_struct]) - AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_thread_info], [ - AC_TRY_KBUILD( -[#include ], -[struct task_struct _tsk; -printk("%d\n", _tsk.thread_info);], - ac_cv_linux_sched_struct_task_struct_has_thread_info=yes, - ac_cv_linux_sched_struct_task_struct_has_thread_info=no)]) - AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_thread_info)]) - - AC_DEFUN([LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE], [ AC_MSG_CHECKING([for alloc_inode in struct super_operations]) AC_CACHE_VAL([ac_cv_linux_fs_struct_super_has_alloc_inode], [ @@ -468,17 +456,6 @@ printk("%p\n", _super.alloc_inode);], AC_MSG_RESULT($ac_cv_linux_fs_struct_super_has_alloc_inode)]) -AC_DEFUN([LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG], [ - AC_MSG_CHECKING([for 3rd argument in posix_lock_file found in new kernels]) - AC_CACHE_VAL([ac_cv_linux_kernel_posix_lock_file_wait_arg], [ - AC_TRY_KBUILD( -[#include ], -[posix_lock_file(0,0,0);], - ac_cv_linux_kernel_posix_lock_file_wait_arg=yes, - ac_cv_linux_kernel_posix_lock_file_wait_arg=no)]) - AC_MSG_RESULT($ac_cv_linux_kernel_posix_lock_file_wait_arg)]) - - AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [ AC_MSG_CHECKING([for 5th argument in sock_create found in some SELinux kernels]) AC_CACHE_VAL([ac_cv_linux_kernel_sock_create_v], [ diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 index 0fcd3eb02..29567b25b 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -4,8 +4,9 @@ AC_DEFUN([OPENAFS_OSCONF], [ dnl defaults, override in case below as needed XCFLAGS='${DBG} ${OPTMZ}' SHLIB_SUFFIX="so" -CCOBJ=$CC -MT_CC=$CC +CC="cc" +CCOBJ="cc" +MT_CC="cc" XLIBS="${LIB_AFSDB}" dnl debugging and optimization flag defaults @@ -243,7 +244,6 @@ case $AFS_SYSNAME in MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' MT_LIBS="-lpthread" PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" - SHLIB_CFLAGS="-fPIC" SHLIB_LDFLAGS="-shared -Xlinker -x" TXLIBS="-lncurses" XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE -G0" @@ -271,7 +271,6 @@ case $AFS_SYSNAME in MT_LIBS="-lpthread" PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" SHLIB_LDFLAGS="-shared -Xlinker -x" - SHLIB_CFLAGS="-fPIC" TXLIBS="/usr/lib64/libncurses.so" XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" SHLIB_LINKER="${MT_CC} -shared" @@ -292,14 +291,14 @@ case $AFS_SYSNAME in ;; i386_umlinux22) - CCOBJ="${CC} -pipe" - MT_CC="${CC} -pipe" + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" KERN_OPTMZ=-O2 LEX="flex -l" MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' MT_LIBS="-lpthread" PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" - SHLIB_CFLAGS="-fPIC" SHLIB_LDFLAGS="-shared -Xlinker -x" TXLIBS="-lncurses" XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" @@ -308,8 +307,9 @@ case $AFS_SYSNAME in ;; i386_linux*) - CCOBJ="${CC} -pipe" - MT_CC="${CC} -pipe" + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" KERN_OPTMZ=-O2 LEX="flex -l" MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' @@ -320,7 +320,6 @@ case $AFS_SYSNAME in LWP_OPTMZ=-O2 OPTMZ=-O2 PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" - SHLIB_CFLAGS="-fPIC" SHLIB_LDFLAGS="-shared -Xlinker -x" TXLIBS="-lncurses" XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" @@ -328,8 +327,9 @@ case $AFS_SYSNAME in ;; i386_umlinux24) - CCOBJ="${CC} -pipe" - MT_CC="${CC} -pipe" + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" KERN_OPTMZ=-O2 LEX="flex -l" MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' @@ -340,7 +340,6 @@ case $AFS_SYSNAME in LWP_OPTMZ=-O2 OPTMZ=-O2 PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" - SHLIB_CFLAGS="-fPIC" SHLIB_LDFLAGS="-shared -Xlinker -x" TXLIBS="-lncurses" XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" @@ -348,8 +347,9 @@ case $AFS_SYSNAME in ;; i386_umlinux26) - CCOBJ="${CC} -pipe" - MT_CC="${CC} -pipe" + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" KERN_OPTMZ=-O2 LEX="flex -l" MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' @@ -360,7 +360,6 @@ case $AFS_SYSNAME in LWP_OPTMZ=-O2 OPTMZ=-O2 PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" - SHLIB_CFLAGS="-fPIC" SHLIB_LDFLAGS="-shared -Xlinker -x" TXLIBS="-lncurses" XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" @@ -386,7 +385,6 @@ case $AFS_SYSNAME in MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' MT_LIBS="-lpthread" PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" - SHLIB_CFLAGS="-fPIC" SHLIB_LDFLAGS="-shared -Xlinker -x" TXLIBS="-lncurses" XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" @@ -557,7 +555,8 @@ case $AFS_SYSNAME in ;; s390_linux22) - CCOBJ="$CC" + CC="gcc" + CCOBJ="gcc" LD="ld" KERN_OPTMZ=-O2 LEX="flex -l" @@ -565,7 +564,6 @@ case $AFS_SYSNAME in MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' MT_LIBS="-lpthread" PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" - SHLIB_CFLAGS="-fPIC" SHLIB_LDFLAGS="-shared -Xlinker -x" TXLIBS="-lncurses" XCFLAGS="-O -g -D_LARGEFILE64_SOURCE" @@ -574,7 +572,8 @@ case $AFS_SYSNAME in ;; s390_linux24|s390_linux26) - CCOBJ="$CC" + CC="gcc" + CCOBJ="gcc" LD="ld" KERN_OPTMZ=-O2 LEX="flex -l" @@ -582,7 +581,6 @@ case $AFS_SYSNAME in MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' MT_LIBS="-lpthread" PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" - SHLIB_CFLAGS="-fPIC" SHLIB_LDFLAGS="-shared -Xlinker -x" TXLIBS="-lncurses" XCFLAGS="-O -g -D_LARGEFILE64_SOURCE" @@ -591,7 +589,8 @@ case $AFS_SYSNAME in ;; s390x_linux24|s390x_linux26) - CCOBJ="$CC" + CC="gcc" + CCOBJ="gcc -fPIC" LD="ld" KERN_OPTMZ=-O2 LEX="flex -l" @@ -599,7 +598,6 @@ case $AFS_SYSNAME in MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' MT_LIBS="-lpthread" PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" - SHLIB_CFLAGS="-fPIC" SHLIB_LDFLAGS="-shared -Xlinker -x -Xlinker -Bsymbolic" TXLIBS="-lncurses" XCFLAGS="-O -g -D_LARGEFILE64_SOURCE -D__s390x__" @@ -669,13 +667,12 @@ case $AFS_SYSNAME in SHLIB_LINKER="${CC} -shared" ;; - sparc*_linux*) + sparc64_linux*) KERN_OPTMZ=-O2 LEX="flex -l" MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' MT_LIBS="-lpthread" PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" - SHLIB_CFLAGS="-fPIC" SHLIB_LDFLAGS="-shared -Xlinker -x" TXLIBS="-lncurses" XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" @@ -685,6 +682,19 @@ case $AFS_SYSNAME in SHLIB_LINKER="${MT_CC} -shared" ;; + sparc_linux22) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + sun4_413) CCXPG2="/usr/xpg2bin/cc" CC="gcc" diff --git a/src/config/linux-version b/src/config/linux-version index ebc8437a6..caa7b253d 100644 --- a/src/config/linux-version +++ b/src/config/linux-version @@ -38,7 +38,7 @@ found_one="false" CAN_BUILD="" for VERS in $LINUX_VERS ; do - dir=$LINUX_SRCDIR + dir=$LINUX_SRCDIR$VERS if [ ! -d $dir ] ; then dir=$LINUX_SRCDIR if [ ! -d $dir ] ; then @@ -47,7 +47,7 @@ for VERS in $LINUX_VERS ; do continue fi fi - header=$LINUX_SRCDIR/include/linux/version.h + header=$LINUX_SRCDIR$VERS/include/linux/version.h if [ ! -f $header ] ; then header=$LINUX_SRCDIR/include/linux/version.h if [ ! -f $header ] ; then diff --git a/src/config/param.alpha_linux_26.h b/src/config/param.alpha_linux_26.h index 2ec3ba147..1d44da6d7 100644 --- a/src/config/param.alpha_linux_26.h +++ b/src/config/param.alpha_linux_26.h @@ -81,11 +81,6 @@ #define SYS_NAME_ID SYS_NAME_ID_alpha_linux_26 -#ifdef __GLIBC__ -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -#define USE_UCONTEXT -#endif -#endif #endif /* AFS_PARAM_H */ #else /* !defined(UKERNEL) */ diff --git a/src/config/param.ia64_linux24.h b/src/config/param.ia64_linux24.h index 47c369800..e5f9a49bb 100644 --- a/src/config/param.ia64_linux24.h +++ b/src/config/param.ia64_linux24.h @@ -87,7 +87,6 @@ #endif #endif /* KERNEL */ -#define USE_UCONTEXT /* should be in afsconfig.h */ #endif /* _PARAM_IA64_LINUX20_H_ */ @@ -158,7 +157,6 @@ #define CMSERVERPREF #endif -#define USE_UCONTEXT /* should be in afsconfig.h */ #endif /* AFS_PARAM_H */ diff --git a/src/config/param.ia64_linux26.h b/src/config/param.ia64_linux26.h index d534f06c3..5f28d47a3 100644 --- a/src/config/param.ia64_linux26.h +++ b/src/config/param.ia64_linux26.h @@ -96,7 +96,6 @@ #endif #endif /* KERNEL */ -#define USE_UCONTEXT /* should be in afsconfig.h */ #endif /* _PARAM_IA64_LINUX20_H_ */ @@ -168,7 +167,6 @@ #define CMSERVERPREF #endif -#define USE_UCONTEXT /* should be in afsconfig.h */ #endif /* AFS_PARAM_H */ diff --git a/src/config/param.parisc_linux24.h b/src/config/param.parisc_linux24.h index e70234abb..ad7506f5e 100644 --- a/src/config/param.parisc_linux24.h +++ b/src/config/param.parisc_linux24.h @@ -70,11 +70,6 @@ #endif #endif /* KERNEL */ -#ifdef __GLIBC__ -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -#define USE_UCONTEXT -#endif -#endif #endif /* AFS_PARAM_H */ #else /* !defined(UKERNEL) */ diff --git a/src/config/param.ppc64_linux26.h b/src/config/param.ppc64_linux26.h index 11f7557bd..730caf37c 100644 --- a/src/config/param.ppc64_linux26.h +++ b/src/config/param.ppc64_linux26.h @@ -76,11 +76,6 @@ #endif #endif /* KERNEL */ -#ifdef __GLIBC__ -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -#define USE_UCONTEXT -#endif -#endif #endif /* _PARAM_PPC64_LINUX20_H_ */ #else /* !defined(UKERNEL) */ diff --git a/src/config/param.ppc_linux26.h b/src/config/param.ppc_linux26.h index d9dd4d8f9..37abeacb9 100644 --- a/src/config/param.ppc_linux26.h +++ b/src/config/param.ppc_linux26.h @@ -74,11 +74,6 @@ #endif #endif /* KERNEL */ -#ifdef __GLIBC__ -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -#define USE_UCONTEXT -#endif -#endif #endif /* AFS_PARAM_H */ #else /* !defined(UKERNEL) */ diff --git a/src/config/param.s390_linux26.h b/src/config/param.s390_linux26.h index cf3ebf7e1..a941c28c3 100644 --- a/src/config/param.s390_linux26.h +++ b/src/config/param.s390_linux26.h @@ -86,11 +86,6 @@ #endif #endif /* KERNEL */ -#ifdef __GLIBC__ -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -#define USE_UCONTEXT -#endif -#endif #endif /* AFS_PARAM_H */ #else /* !defined(UKERNEL) */ diff --git a/src/config/param.s390x_linux26.h b/src/config/param.s390x_linux26.h index bb3bc8515..5ad1806f4 100644 --- a/src/config/param.s390x_linux26.h +++ b/src/config/param.s390x_linux26.h @@ -89,11 +89,6 @@ #endif #endif /* KERNEL */ -#ifdef __GLIBC__ -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -#define USE_UCONTEXT -#endif -#endif #endif /* AFS_PARAM_H */ #else /* !defined(UKERNEL) */ diff --git a/src/config/param.sparc64_linux26.h b/src/config/param.sparc64_linux26.h index 30550e2cf..68bd28a24 100644 --- a/src/config/param.sparc64_linux26.h +++ b/src/config/param.sparc64_linux26.h @@ -95,11 +95,6 @@ #endif #endif -#ifdef __GLIBC__ -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -#define USE_UCONTEXT -#endif -#endif #endif /* _PARAM_SPARC64_LINUX26_H_ */ #else /* !defined(UKERNEL) */ diff --git a/src/config/param.sparc_linux24.h b/src/config/param.sparc_linux24.h index 7373559e2..3082a524e 100644 --- a/src/config/param.sparc_linux24.h +++ b/src/config/param.sparc_linux24.h @@ -98,11 +98,6 @@ #endif #endif -#ifdef __GLIBC__ -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -#define USE_UCONTEXT -#endif -#endif #endif /* AFS_PARAM_H */ #else /* !defined(UKERNEL) */ diff --git a/src/des/des.h b/src/des/des.h index 91c8ba534..e75e90af1 100644 --- a/src/des/des.h +++ b/src/des/des.h @@ -20,10 +20,7 @@ typedef unsigned char des_cblock[8]; /* crypto-block size */ /* Key schedule */ typedef struct des_ks_struct { - union { - afs_uint32 i[2]; - des_cblock _; - } _; + des_cblock _; } des_key_schedule[16]; #define DES_KEY_SZ (sizeof(des_cblock)) diff --git a/src/des/pcbc_encrypt.c b/src/des/pcbc_encrypt.c index 6270cd160..cb28d1fd0 100644 --- a/src/des/pcbc_encrypt.c +++ b/src/des/pcbc_encrypt.c @@ -24,9 +24,9 @@ #ifndef KERNEL #include #endif +#include #include #include -#include #include "des_prototypes.h" RCSID diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in index cb9505e5f..6b7895d6f 100644 --- a/src/libafs/MakefileProto.LINUX.in +++ b/src/libafs/MakefileProto.LINUX.in @@ -222,8 +222,8 @@ linux_destdirs_libafs.bm: dest_libafs.bm # Below this line are targets when in the COMMON directory: # For Linux there is no kernel NFS server. -LIBAFS = openafs.${LINUX_MODULE_EXT} -LIBAFS_MP = openafs.${LINUX_MODULE_EXT} +LIBAFS = libafs-${CLIENT}.${LINUX_MODULE_EXT} +LIBAFS_MP = libafs-${CLIENT}.mp.${LINUX_MODULE_EXT} LIBAFS_EP = libafs-${CLIENT}.ep.${LINUX_MODULE_EXT} LIBAFS_BM = libafs-${CLIENT}.bm.${LINUX_MODULE_EXT} @@ -232,8 +232,10 @@ INST_LIBAFS_MP = ${DESTDIR}${afskerneldir}/${LIBAFS_MP} INST_LIBAFS_EP = ${DESTDIR}${afskerneldir}/${LIBAFS_EP} INST_LIBAFS_BM = ${DESTDIR}${afskerneldir}/${LIBAFS_BM} -DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/openafs.o -DEST_LIBAFS_MP = ${DEST}/root.client/usr/vice/etc/modload/openafs.mp.o +DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS} +DEST_LIBAFS_MP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_MP} +DEST_LIBAFS_EP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_EP} +DEST_LIBAFS_BM = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_BM} libafs: $(LIBAFS) @@ -249,11 +251,11 @@ libafs.bm: $(LIBAFS_BM) echo BM Build Complete -${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: openafs.ko - cp openafs.ko $@ +${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: libafs.ko + cp libafs.ko $@ .FORCE: -openafs.ko: .FORCE +libafs.ko: .FORCE env EXTRA_CFLAGS="${EXTRA_CFLAGS}" @TOP_SRCDIR@/libafs/make_kbuild_makefile.pl ${KDIR} $@ @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common env EXTRA_CFLAGS="${EXTRA_CFLAGS}" $(MAKE) -C ${LINUX_KERNEL_PATH} M=@TOP_OBJDIR@/src/libafs/${KDIR} modules diff --git a/src/libafs/make_kbuild_makefile.pl b/src/libafs/make_kbuild_makefile.pl index dd10db1e3..ce046e172 100755 --- a/src/libafs/make_kbuild_makefile.pl +++ b/src/libafs/make_kbuild_makefile.pl @@ -79,7 +79,7 @@ if (! -d $KDIR) { foreach (@objects) { die "No source known for $_\n" unless exists $deps{$_}; if($deps{$_} =~ /\.s$/) { - ($src = $_) =~ s/\.o$/.S/; + ($src = $_) =~ s/\.o$/.s/; } else { ($src = $_) =~ s/\.o$/.c/; } diff --git a/src/lwp/process.c b/src/lwp/process.c index 2cafd9a58..6a195d477 100644 --- a/src/lwp/process.c +++ b/src/lwp/process.c @@ -92,9 +92,7 @@ returnto(savearea) #elif defined(AFS_HPUX_ENV) || defined(AFS_PARISC_LINUX24_ENV) #define LWP_SP 1 #elif defined(AFS_LINUX20_ENV) -#if defined(AFS_PARISC_LINUX24_ENV ) -#define LWP_SP 1 -#elif defined(AFS_PPC_LINUX20_ENV)|| defined(AFS_PPC64_LINUX20_ENV) +#if defined(AFS_PPC_LINUX20_ENV) || defined(AFS_PPC64_LINUX20_ENV) #define LWP_SP 0 #elif defined(AFS_I386_LINUX20_ENV) #define LWP_SP 4 diff --git a/src/pam/Makefile.in b/src/pam/Makefile.in index c198ab013..4d5b0fd0a 100644 --- a/src/pam/Makefile.in +++ b/src/pam/Makefile.in @@ -25,17 +25,7 @@ LDFLAGS = ${SHLIB_LDFLAGS} afs_pam_msg.o afs_message.o AFS_component_version_number.o OBJS = $(SHOBJS) test_pam.o INCLUDES=-I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} -CFLAGS = ${DEBUG} ${INCLUDES} ${PAM_CFLAGS} ${MT_CFLAGS} - -# For Debian, we link directly with the object files that would have gone -# into the libafsrpc and libafsauthent shared libraries. The shared libraries -# themselves cannot be used because the interface isn't stable and they have -# no SONAME, but this is the easiest way of getting PIC objects built with the -# pthread API. -SHLIB_OBJS := `ls ../shlibafsauthent/*.o | grep -v version_num` \ - `ls ../shlibafsrpc/*.o | grep -v version_num` -KRB_SHLIB_OBJS := `ls ../shlibafsauthent/*.o | egrep -v 'version_num|ktc.o'` \ - `ls ../shlibafsrpc/*.o | grep -v version_num` +CFLAGS = ${DEBUG} ${INCLUDES} ${PAM_CFLAGS} all: test_pam ${TOP_LIBDIR}/pam_afs.so.1 ${TOP_LIBDIR}/pam_afs.krb.so.1 @@ -57,9 +47,6 @@ afs_util.o: afs_util.c afs_pam_msg.h afs_message.h afs_util.h afs_util_krb.o: afs_util.c afs_pam_msg.h afs_message.h afs_util.h ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/afs_util.c -o afs_util_krb.o -ktc.o: ${srcdir}/../auth/ktc.c - ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/../auth/ktc.c - pam_afs.so.1: $(SHOBJS) afs_setcred.o afs_auth.o afs_util.o set -x; \ case "$(SYS_NAME)" in \ @@ -72,9 +59,8 @@ pam_afs.so.1: $(SHOBJS) afs_setcred.o afs_auth.o afs_util.o afs_setcred.o afs_auth.o afs_util.o \ $(SHOBJS) $(LIBS) ;; \ *linux*) \ - $(CC) $(LDFLAGS) $(PAM_CFLAGS) -o $@ afs_setcred.o \ - afs_auth.o afs_util.o $(SHOBJS) $(SHLIB_OBJS) \ - $(MT_LIBS) -lpam -lresolv;;\ + $(CC) $(LDFLAGS) -o $@ afs_setcred.o \ + afs_auth.o afs_util.o $(SHOBJS) $(LIBS) ;;\ *fbsd*| *nbsd*) \ $(CC) $(LDFLAGS) -o $@ afs_setcred.o \ afs_auth.o afs_util.o $(SHOBJS) $(LIBS) ;;\ @@ -82,7 +68,7 @@ pam_afs.so.1: $(SHOBJS) afs_setcred.o afs_auth.o afs_util.o echo No link line for system $(SYS_NAME). ;; \ esac -pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o ktc.o +pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o set -x; \ case "$(SYS_NAME)" in \ hp_ux* | ia64_hpux*) \ @@ -95,8 +81,7 @@ pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o ktc. $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \ *linux*) \ $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o \ - afs_auth_krb.o afs_util_krb.o ktc.o $(SHOBJS) \ - $(KRB_SHLIB_OBJS) $(MT_LIBS) -lpam -lresolv;;\ + afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(KLIBS) ;;\ *fbsd*| *nbsd*) \ $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o \ afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(KLIBS) ;;\ diff --git a/src/ptserver/pt_util.c b/src/ptserver/pt_util.c index 159d8bfbe..3b8ddf9cd 100644 --- a/src/ptserver/pt_util.c +++ b/src/ptserver/pt_util.c @@ -136,7 +136,7 @@ CommandProc(register struct cmd_syndesc *a_as) struct prentry uentry, gentry; struct ubik_hdr *uh; char *dfile = 0; - char *pfile = "/var/lib/openafs/db/prdb.DB0"; + char *pfile = "/usr/afs/db/prdb.DB0"; struct cmd_parmdesc *tparm; tparm = a_as->parms; diff --git a/src/rx/LINUX/rx_kmutex.c b/src/rx/LINUX/rx_kmutex.c index 1732f9089..a7a317321 100644 --- a/src/rx/LINUX/rx_kmutex.c +++ b/src/rx/LINUX/rx_kmutex.c @@ -104,12 +104,11 @@ afs_cv_wait(afs_kcondvar_t * cv, afs_kmutex_t * l, int sigok) MUTEX_EXIT(l); if (!sigok) { - unsigned long f; - SIG_LOCK(current,f); + SIG_LOCK(current); saved_set = current->blocked; sigfillset(¤t->blocked); RECALC_SIGPENDING(current); - SIG_UNLOCK(current,f); + SIG_UNLOCK(current); } while(seq == cv->seq) { @@ -123,11 +122,7 @@ afs_cv_wait(afs_kcondvar_t * cv, afs_kmutex_t * l, int sigok) #if defined(STRUCT_TASK_STRUCT_HAS_TODO) !current->todo #else -#if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO) test_ti_thread_flag(current->thread_info, TIF_FREEZE) -#else - test_ti_thread_flag(task_thread_info(current), TIF_FREEZE) -#endif #endif #endif ) @@ -145,11 +140,10 @@ afs_cv_wait(afs_kcondvar_t * cv, afs_kmutex_t * l, int sigok) set_current_state(TASK_RUNNING); if (!sigok) { - unsigned long f; - SIG_LOCK(current, f); + SIG_LOCK(current); current->blocked = saved_set; RECALC_SIGPENDING(current); - SIG_UNLOCK(current, f); + SIG_UNLOCK(current); } if (isAFSGlocked) diff --git a/src/rx/LINUX/rx_knet.c b/src/rx/LINUX/rx_knet.c index 967159edb..8fbb280e3 100644 --- a/src/rx/LINUX/rx_knet.c +++ b/src/rx/LINUX/rx_knet.c @@ -173,11 +173,7 @@ osi_NetReceive(osi_socket so, struct sockaddr_in *from, struct iovec *iov, #if defined(STRUCT_TASK_STRUCT_HAS_TODO) !current->todo #else -#if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO) test_ti_thread_flag(current->thread_info, TIF_FREEZE) -#else - test_ti_thread_flag(task_thread_info(current), TIF_FREEZE) -#endif #endif #endif ) diff --git a/src/rx/SUNOS/rx_knet.c b/src/rx/SUNOS/rx_knet.c index 89b35272a..a55f44dba 100644 --- a/src/rx/SUNOS/rx_knet.c +++ b/src/rx/SUNOS/rx_knet.c @@ -1 +1 @@ -#error kernel code not supported on SunOS 4 +#error kernel code not supported on SunOS 4 diff --git a/src/tviced/Makefile.in b/src/tviced/Makefile.in index b0bbf3a33..f7c234f5f 100644 --- a/src/tviced/Makefile.in +++ b/src/tviced/Makefile.in @@ -38,7 +38,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 \ + fstab.o FSINTOBJS= afsaux.o afscbint.cs.o afsint.ss.o afsint.xdr.o diff --git a/src/util/Makefile.in b/src/util/Makefile.in index 03a28f029..7b8c36e3e 100644 --- a/src/util/Makefile.in +++ b/src/util/Makefile.in @@ -12,7 +12,7 @@ HELPER_SPLINT=@HELPER_SPLINT@ objects = assert.o base64.o casestrcpy.o ktime.o volparse.o hostparse.o \ hputil.o kreltime.o isathing.o get_krbrlm.o uuid.o serverLog.o \ - dirpath.o fileutil.o netutils.o flipbase64.o \ + dirpath.o fileutil.o netutils.o flipbase64.o fstab.o \ afs_atomlist.o afs_lhash.o snprintf.o strlcat.o strlcpy.o \ daemon.o rxkstats.o ${REGEX_OBJ} @@ -392,4 +392,4 @@ check-splint: assert.c base64.c casestrcpy.c ktime.c volparse.c hostparse.c \ hputil.c kreltime.c isathing.c get_krbrlm.c uuid.c serverLog.c \ dirpath.c fileutil.c netutils.c flipbase64.c \ - afs_atomlist.c afs_lhash.c snprintf.c + afs_atomlist.c afs_lhash.c snprintf.c fstab.c diff --git a/src/venus/fstrace.c b/src/venus/fstrace.c index bd35b4633..abdb7f337 100644 --- a/src/venus/fstrace.c +++ b/src/venus/fstrace.c @@ -1471,7 +1471,7 @@ catgets1(nl_catd catd, int setno, int msgno, char *def) */ #ifndef RPC_NLS_FORMAT -#define RPC_NLS_FORMAT "/usr/share/openafs/%s.cat" +#define RPC_NLS_FORMAT "%s.cat" #endif dce1_error_inq_text(status_to_convert, error_text, status) @@ -1488,8 +1488,7 @@ dce1_error_inq_text(status_to_convert, error_text, status) char component_name[4]; char *facility_name; char filename_prefix[7]; - /* strlen("/usr/share/openafs/") + 6 + strlen(".cat") + 1 */ - char nls_filename[19 + 6 + 4 + 1]; + char nls_filename[11]; char alt_filename[80]; char *message; #if defined(AFS_64BITPOINTER_ENV) diff --git a/src/viced/host.c b/src/viced/host.c index 65f16db17..99d10431c 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -74,7 +74,6 @@ extern struct afsconf_dir *confDir; /* config dir object */ extern int lwps; /* the max number of server threads */ extern afsUUID FS_HostUUID; -afsUUID nulluuid; int CEs = 0; /* active clients */ int CEBlocks = 0; /* number of blocks of CEs */ struct client *CEFree = 0; /* first free client */ @@ -1330,8 +1329,7 @@ h_GetHost_r(struct rx_connection *tcon) rx_PutConnection(cb_conn); cb_conn=NULL; H_LOCK; - if ((code == RXGEN_OPCODE) || - (afs_uuid_equal(&interf.uuid, &nulluuid))) { + if (code == RXGEN_OPCODE) { identP = (struct Identity *)malloc(sizeof(struct Identity)); if (!identP) { ViceLog(0, ("Failed malloc in h_GetHost_r\n")); @@ -1454,8 +1452,7 @@ h_GetHost_r(struct rx_connection *tcon) rx_PutConnection(cb_conn); cb_conn=NULL; H_LOCK; - if ((code == RXGEN_OPCODE) || - afs_uuid_equal(&interf.uuid, &nulluuid)) { + if (code == RXGEN_OPCODE) { if (!identP) identP = (struct Identity *)malloc(sizeof(struct Identity)); @@ -1665,7 +1662,6 @@ char local_realm[AFS_REALM_SZ] = ""; void h_InitHostPackage() { - memset(&nulluuid, 0, sizeof(afsUUID)); afsconf_GetLocalCell(confDir, localcellname, PR_MAXNAMELEN); if (!local_realm[0]) { if (afs_krb_get_lrealm(local_realm, 0) != 0 /*KSUCCESS*/) {