# 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} ;; \
*) \
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} ;; \
*) \
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
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
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
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 (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
+++ /dev/null
-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.
--- /dev/null
+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 <linux/version.h>
++#include <linux/sched.h>
+ #ifdef CONFIG_H_EXISTS
+ #include <linux/config.h>
+ #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;
-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[] = {
--- /dev/null
+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"
--- /dev/null
+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 <stdio.h>
+ #endif
+-#include <des.h>
+ #include <afsconfig.h>
+ #include <afs/param.h>
++#include <des.h>
+ #include "des_prototypes.h"
+
+ RCSID
--- /dev/null
+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
--- /dev/null
+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)
+++ /dev/null
-=== 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) */
+++ /dev/null
-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
--- /dev/null
+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 <cmu_copyright.h> 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 <sys/types.h>
++#include <sys/socket.h>
++#include <sys/ioctl.h>
++#include <netinet/in.h>
++#include <arpa/inet.h>
++#include <stdio.h>
++#include <netdb.h>
++#include <ctype.h>
++#include <stdlib.h>
++#include <string.h>
++#include <syslog.h>
++#include <unistd.h>
++
++#if HAVE_GETOPT_H
++#include <getopt.h>
++#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] <host>[/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
++<div class="synopsis">
++
++B<ka-forwarder> S<<< [B<-p> <I<port>>] >>> <I<server>>[/<I<port>>] [...]
++
++=for html
++</div>
++
++=head1 DESCRIPTION
++
++B<ka-forwarder> listens for requests for an AFS Authentication Server and
++forwards them to a remove B<fakeka> server. B<fakeka> is a server that
++answers AFS Authentication Server protocol requests using a regular
++Kerberos KDC and is provided with some Kerberos 5 implementations.
++B<fakeka> 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<ka-forwarder> on the AFS
++database servers and point it to B<fakeka> running on the Kerberos KDCs.
++
++B<ka-forwarder> 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<ka-forwarder> will send queries to each server in turn in a
++round-robin fashion.
++
++=head1 CAUTIONS
++
++Due to the way that B<ka-forwarder> distinguishes from client requests and
++server responses, any messages from one of the servers to which
++B<ka-forwarder> is forwarding will be considered a reply rather than a
++command and will not be forwarded. This means that the servers running
++B<fakeka> will not be able to use native AFS authentication requests and
++rely on B<ka-forwarder> to send the requests to the right server.
++
++B<ka-forwarder> does not background itself. It should either be run in
++the background via the shell, or run via the Basic OverSeer Server (see
++L<bosserver(8)>).
++
++=head1 OPTIONS
++
++=over 4
++
++=item B<-p> <I<port>>
++
++By default, B<ka-forwarder> 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<fakeka> 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<ka-forwarder> 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<bosserver(8)>,
++fakeka(8),
++L<kaserver(8)>
++
++=head1 COPYRIGHT
++
++Copyright 2006 Russ Allbery <rra@stanford.edu>
++
++This documentation is covered by the IBM Public License Version 1.0. This
++man page was written by Russ Allbery for OpenAFS.
--- /dev/null
+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/;
+ }
--- /dev/null
+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 <linux/sched.h>],
++[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 <linux/fs.h>],
++[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
+ )
--- /dev/null
+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}
+ };
+
-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.
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}
libafs: $(LIBAFS)
-@@ -245,11 +243,11 @@
+@@ -251,11 +249,11 @@
echo BM Build Complete
<linux26 linux_26 umlinux26>
--- /dev/null
+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) /
--- /dev/null
+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*/) {
+++ /dev/null
-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"
- ;;
--- /dev/null
+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 =
+++ /dev/null
-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} ;; \
- *) \
--- /dev/null
+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) ;;\
-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
#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)
}
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;
}
/* 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);
}
while(seq == cv->seq) {
-@@ -140,10 +141,11 @@
+@@ -144,10 +145,11 @@
set_current_state(TASK_RUNNING);
if (!sigok) {
--- /dev/null
+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;
--- /dev/null
+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
--- /dev/null
+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) */
+++ /dev/null
-=head1 NAME
-
-ka-forwarder - Forward AFS Authentication Server requests to another server
-
-=head1 SYNOPSIS
-
-=for html
-<div class="synopsis">
-
-B<ka-forwarder> S<<< [B<-p> <I<port>>] >>> <I<server>>[/<I<port>>] [...]
-
-=for html
-</div>
-
-=head1 DESCRIPTION
-
-B<ka-forwarder> listens for requests for an AFS Authentication Server and
-forwards them to a remove B<fakeka> server. B<fakeka> is a server that
-answers AFS Authentication Server protocol requests using a regular
-Kerberos KDC and is provided with some Kerberos 5 implementations.
-B<fakeka> 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<ka-forwarder> on the AFS
-database servers and point it to B<fakeka> running on the Kerberos KDCs.
-
-B<ka-forwarder> 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<ka-forwarder> will send queries to each server in turn in a
-round-robin fashion.
-
-=head1 CAUTIONS
-
-Due to the way that B<ka-forwarder> distinguishes from client requests and
-server responses, any messages from one of the servers to which
-B<ka-forwarder> is forwarding will be considered a reply rather than a
-command and will not be forwarded. This means that the servers running
-B<fakeka> will not be able to use native AFS authentication requests and
-rely on B<ka-forwarder> to send the requests to the right server.
-
-B<ka-forwarder> does not background itself. It should either be run in
-the background via the shell, or run via the Basic OverSeer Server (see
-L<bosserver(8)>).
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-p> <I<port>>
-
-By default, B<ka-forwarder> 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<fakeka> 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<ka-forwarder> 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<bosserver(8)>,
-fakeka(8),
-L<kaserver(8)>
-
-=head1 COPYRIGHT
-
-Copyright 2006 Russ Allbery <rra@stanford.edu>
-
-This documentation is covered by the IBM Public License Version 1.0. This
-man page was written by Russ Allbery for OpenAFS.
struct key *old;
char desc[20];
unsigned long not_in_quota;
- unsigned long f;
int code = -EINVAL;
if (!__key_type_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);
{
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 =
#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)
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
#include "afsincludes.h"
#endif
#include <linux/version.h>
-#include <linux/sched.h>
#ifdef CONFIG_H_EXISTS
#include <linux/config.h>
#endif
* 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
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 **********/
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) {
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])]) {
}
#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
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)
}
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;
#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
)
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
#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
)
/*
* 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)
*/
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}
};
{
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));
}
#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;
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 ;; \
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 ;; \
${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 ;; \
#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) /
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}
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} $? $@
${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} $? $@
${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
+++ /dev/null
-/*
- * COPYRIGHT NOTICE
- * Copyright (c) 1994 Carnegie Mellon University
- * All Rights Reserved.
- *
- * See <cmu_copyright.h> 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 <sys/types.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <stdio.h>
-#include <netdb.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
-#include <unistd.h>
-
-#if HAVE_GETOPT_H
-#include <getopt.h>
-#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] <host>[/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");
- }
- }
-}
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 */
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 <linux/sched.h>],
-[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], [
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 <linux/fs.h>],
-[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], [
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
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"
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"
;;
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"
;;
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}'
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"
;;
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}'
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"
;;
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}'
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"
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"
;;
s390_linux22)
- CCOBJ="$CC"
+ CC="gcc"
+ CCOBJ="gcc"
LD="ld"
KERN_OPTMZ=-O2
LEX="flex -l"
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"
;;
s390_linux24|s390_linux26)
- CCOBJ="$CC"
+ CC="gcc"
+ CCOBJ="gcc"
LD="ld"
KERN_OPTMZ=-O2
LEX="flex -l"
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"
;;
s390x_linux24|s390x_linux26)
- CCOBJ="$CC"
+ CC="gcc"
+ CCOBJ="gcc -fPIC"
LD="ld"
KERN_OPTMZ=-O2
LEX="flex -l"
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__"
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"
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"
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
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
#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) */
#endif
#endif /* KERNEL */
-#define USE_UCONTEXT /* should be in afsconfig.h */
#endif /* _PARAM_IA64_LINUX20_H_ */
#define CMSERVERPREF
#endif
-#define USE_UCONTEXT /* should be in afsconfig.h */
#endif /* AFS_PARAM_H */
#endif
#endif /* KERNEL */
-#define USE_UCONTEXT /* should be in afsconfig.h */
#endif /* _PARAM_IA64_LINUX20_H_ */
#define CMSERVERPREF
#endif
-#define USE_UCONTEXT /* should be in afsconfig.h */
#endif /* AFS_PARAM_H */
#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) */
#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) */
#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) */
#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) */
#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) */
#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) */
#endif
#endif
-#ifdef __GLIBC__
-#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3)
-#define USE_UCONTEXT
-#endif
-#endif
#endif /* AFS_PARAM_H */
#else /* !defined(UKERNEL) */
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))
#ifndef KERNEL
#include <stdio.h>
#endif
+#include <des.h>
#include <afsconfig.h>
#include <afs/param.h>
-#include <des.h>
#include "des_prototypes.h"
RCSID
# 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}
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)
echo BM Build Complete
<linux26 linux_26 umlinux26>
-${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
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/;
}
#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
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
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 \
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) ;;\
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*) \
$(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) ;;\
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;
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) {
#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
)
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)
#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
)
-#error kernel code not supported on SunOS 4
+#error kernel code not supported on SunOS 4
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
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}
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
*/
#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)
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)
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 */
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"));
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));
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*/) {