]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Import upstream 1.4.7pre3 release. upstream/1.4.7.pre3.dfsg1
authorRuss Allbery <rra@debian.org>
Fri, 11 Apr 2008 03:46:08 +0000 (03:46 +0000)
committerRuss Allbery <rra@debian.org>
Fri, 11 Apr 2008 03:46:08 +0000 (03:46 +0000)
38 files changed:
acinclude.m4
configure
configure-libafs
configure-libafs.in
configure.in
doc/man-pages/README
doc/man-pages/man1/vos_shadow.1 [new file with mode: 0644]
doc/man-pages/pod1/vos_shadow.pod [new file with mode: 0644]
src/afs/DARWIN/osi_misc.c
src/afs/LINUX/osi_file.c
src/afs/LINUX/osi_probe.c
src/afs/LINUX/osi_vnodeops.c
src/afs/afs_pioctl.c
src/aklog/aklog.c
src/aklog/aklog.h
src/aklog/aklog_main.c
src/aklog/asetkey.c
src/aklog/klog.c
src/aklog/krb_util.c
src/aklog/linked_list.c
src/aklog/linked_list.h
src/aklog/skipwrap.c
src/aklog/skipwrap.h [new file with mode: 0644]
src/cf/linux-test4.m4
src/config/afsconfig.h.in
src/config/param.i386_nbsd30.h
src/config/param.i386_nbsd40.h [new file with mode: 0644]
src/packaging/RedHat/openafs.spec.in
src/ptserver/pt_util.c
src/tests/Makefile.in
src/tests/OpenAFS/Auth.pm
src/tests/OpenAFS/OS.pm
src/tests/OpenAFS/config.pm
src/tests/afs-newcell.pl
src/tests/afs-rmcell.pl
src/tests/run-tests.in
src/vlserver/vlserver.c
src/vol/fssync.c

index aed68b06667beefb78dbcdbb8ffacef7fb893d04..b50b4b1f370bdb98bad7c218975f0f621e99176b 100644 (file)
@@ -672,6 +672,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_SYSCTL_TABLE_CHECKING
                 LINUX_HAVE_IGET
                 LINUX_FS_STRUCT_NAMEIDATA_HAS_PATH
+                LINUX_EXPORTS_INIT_MM
                  LINUX_EXPORTS_SYS_CHDIR
                  LINUX_EXPORTS_SYS_CLOSE
                  LINUX_EXPORTS_SYS_OPEN
@@ -684,7 +685,6 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                     ac_cv_linux_exports_ia32_sys_call_table=yes
                   fi
                  else
-                   LINUX_EXPORTS_INIT_MM
                    LINUX_EXPORTS_KALLSYMS_ADDRESS
                    LINUX_EXPORTS_KALLSYMS_SYMBOL
                    LINUX_EXPORTS_SYS_CALL_TABLE
@@ -884,7 +884,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                  AC_DEFINE(INIT_WORK_HAS_DATA, 1, [define if INIT_WORK takes a data (3rd) argument])
                 fi
                 if test "x$ac_cv_linux_fs_struct_fop_has_flock" = "xyes" ; then
-                 echo flock support is currently disabled in OpenAFS 1.4 for Linux
+                 AC_DEFINE(STRUCT_FILE_OPERATIONS_HAS_FLOCK, 1, [define if your struct file_operations has flock])
                 fi
                 if test "x$ac_cv_linux_fs_struct_fop_has_sendfile" = "xyes" ; then
                  AC_DEFINE(STRUCT_FILE_OPERATIONS_HAS_SENDFILE, 1, [define if your struct file_operations has sendfile])
@@ -904,6 +904,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 if test "x$ac_cv_linux_struct_nameidata_has_path" = "xyes" ; then
                  AC_DEFINE(STRUCT_NAMEIDATA_HAS_PATH, 1, [define if your struct nameidata has path])
                 fi
+                if test "x$ac_cv_linux_exports_init_mm" = "xyes" ; then
+                 AC_DEFINE(EXPORTED_INIT_MM, 1, [define if your kernel exports init_mm])
+                fi
                 if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
                  AC_DEFINE(EXPORTED_TASKLIST_LOCK, 1, [define if tasklist_lock exported])
                 fi
index 9c3a64688dbd7f75d1c817507f804306ef8b4f3d..247dcaf7486101c9eadc5815788ec30771e83644 100644 (file)
--- a/configure
+++ b/configure
@@ -657,6 +657,7 @@ AMTAR
 am__tar
 am__untar
 MACOS_VERSION
+LINUX_VERSION
 CC
 CFLAGS
 LDFLAGS
@@ -720,7 +721,6 @@ LIB_AFSDB
 LINUX_KERNEL_PATH
 BSD_KERNEL_PATH
 BSD_KERNEL_BUILD
-LINUX_VERSION
 MKAFS_OSTYPE
 TOP_OBJDIR
 TOP_SRCDIR
@@ -2174,7 +2174,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=openafs
- VERSION=1.4.7pre1
+ VERSION=1.4.7pre3
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2322,7 +2322,9 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 
 ac_config_headers="$ac_config_headers src/config/afsconfig.h"
 
-MACOS_VERSION=1.4.7fc1
+MACOS_VERSION=1.4.7fc3
+LINUX_VERSION=0.pre3
+
 
 
 
@@ -15426,9 +15428,9 @@ fi
   { echo "$as_me:$LINENO: result: $ac_cv_linux_struct_nameidata_has_path" >&5
 echo "${ECHO_T}$ac_cv_linux_struct_nameidata_has_path" >&6; }
 
-  { echo "$as_me:$LINENO: checking for exported sys_chdir" >&5
-echo $ECHO_N "checking for exported sys_chdir... $ECHO_C" >&6; }
-  if test "${ac_cv_linux_exports_sys_chdir+set}" = set; then
+  { echo "$as_me:$LINENO: checking for exported init_mm" >&5
+echo $ECHO_N "checking for exported init_mm... $ECHO_C" >&6; }
+  if test "${ac_cv_linux_exports_init_mm+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -15451,11 +15453,11 @@ _ACEOF
     cat >>conftest.dir/conftest.c <<\_ACEOF &&
 /* end confdefs.h */
 #include <linux/module.h>
-extern asmlinkage long sys_chdir(void) __attribute__((weak));
+extern struct mm_struct init_mm;
 
 void conftest(void)
 {
-void *address = &sys_chdir;
+void *address = &init_mm;
 printk("%p\n", address);
 }
 
@@ -15464,14 +15466,14 @@ _ACEOF
     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 &&
     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 2>conftest.err &&
     ! grep -i "^WARNING: .* undefined!$" conftest.err >/dev/null 2>&1
-    then ac_cv_linux_exports_sys_chdir=yes
+    then ac_cv_linux_exports_init_mm=yes
     else
       sed '/^ *+/d' conftest.err >&5
       echo "$as_me: failed using Makefile:" >&5
       sed 's/^/| /' conftest.dir/Makefile >&5
       echo "$as_me: and program was:" >&5
       sed 's/^/| /' conftest.dir/conftest.c >&5
-      ac_cv_linux_exports_sys_chdir=no
+      ac_cv_linux_exports_init_mm=no
   fi; rm -fr conftest.err conftest.dir
   else
 
@@ -15485,11 +15487,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <linux/kernel.h>
-extern asmlinkage long sys_chdir(void) __attribute__((weak));
+extern struct mm_struct init_mm;
 int
 main ()
 {
-void *address = &sys_chdir;
+void *address = &init_mm;
 printk("%p\n", address);
   ;
   return 0;
@@ -15529,12 +15531,12 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_chdir=yes
+  ac_cv_linux_exports_init_mm=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_linux_exports_sys_chdir=no
+       ac_cv_linux_exports_init_mm=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -15542,12 +15544,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   fi
 fi
 
-  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_chdir" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_chdir" >&6; }
+  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_init_mm" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_init_mm" >&6; }
 
-  { echo "$as_me:$LINENO: checking for exported sys_close" >&5
-echo $ECHO_N "checking for exported sys_close... $ECHO_C" >&6; }
-  if test "${ac_cv_linux_exports_sys_close+set}" = set; then
+  { echo "$as_me:$LINENO: checking for exported sys_chdir" >&5
+echo $ECHO_N "checking for exported sys_chdir... $ECHO_C" >&6; }
+  if test "${ac_cv_linux_exports_sys_chdir+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -15570,11 +15572,11 @@ _ACEOF
     cat >>conftest.dir/conftest.c <<\_ACEOF &&
 /* end confdefs.h */
 #include <linux/module.h>
-extern asmlinkage long sys_close(void) __attribute__((weak));
+extern asmlinkage long sys_chdir(void) __attribute__((weak));
 
 void conftest(void)
 {
-void *address = &sys_close;
+void *address = &sys_chdir;
 printk("%p\n", address);
 }
 
@@ -15583,14 +15585,14 @@ _ACEOF
     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 &&
     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 2>conftest.err &&
     ! grep -i "^WARNING: .* undefined!$" conftest.err >/dev/null 2>&1
-    then ac_cv_linux_exports_sys_close=yes
+    then ac_cv_linux_exports_sys_chdir=yes
     else
       sed '/^ *+/d' conftest.err >&5
       echo "$as_me: failed using Makefile:" >&5
       sed 's/^/| /' conftest.dir/Makefile >&5
       echo "$as_me: and program was:" >&5
       sed 's/^/| /' conftest.dir/conftest.c >&5
-      ac_cv_linux_exports_sys_close=no
+      ac_cv_linux_exports_sys_chdir=no
   fi; rm -fr conftest.err conftest.dir
   else
 
@@ -15604,11 +15606,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <linux/kernel.h>
-extern asmlinkage long sys_close(void) __attribute__((weak));
+extern asmlinkage long sys_chdir(void) __attribute__((weak));
 int
 main ()
 {
-void *address = &sys_close;
+void *address = &sys_chdir;
 printk("%p\n", address);
   ;
   return 0;
@@ -15648,12 +15650,12 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_close=yes
+  ac_cv_linux_exports_sys_chdir=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_linux_exports_sys_close=no
+       ac_cv_linux_exports_sys_chdir=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -15661,12 +15663,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   fi
 fi
 
-  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_close" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_close" >&6; }
+  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_chdir" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_chdir" >&6; }
 
-  { echo "$as_me:$LINENO: checking for exported sys_open" >&5
-echo $ECHO_N "checking for exported sys_open... $ECHO_C" >&6; }
-  if test "${ac_cv_linux_exports_sys_open+set}" = set; then
+  { echo "$as_me:$LINENO: checking for exported sys_close" >&5
+echo $ECHO_N "checking for exported sys_close... $ECHO_C" >&6; }
+  if test "${ac_cv_linux_exports_sys_close+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -15689,11 +15691,11 @@ _ACEOF
     cat >>conftest.dir/conftest.c <<\_ACEOF &&
 /* end confdefs.h */
 #include <linux/module.h>
-extern asmlinkage long sys_open(void) __attribute__((weak));
+extern asmlinkage long sys_close(void) __attribute__((weak));
 
 void conftest(void)
 {
-void *address = &sys_open;
+void *address = &sys_close;
 printk("%p\n", address);
 }
 
@@ -15702,14 +15704,14 @@ _ACEOF
     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 &&
     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 2>conftest.err &&
     ! grep -i "^WARNING: .* undefined!$" conftest.err >/dev/null 2>&1
-    then ac_cv_linux_exports_sys_open=yes
+    then ac_cv_linux_exports_sys_close=yes
     else
       sed '/^ *+/d' conftest.err >&5
       echo "$as_me: failed using Makefile:" >&5
       sed 's/^/| /' conftest.dir/Makefile >&5
       echo "$as_me: and program was:" >&5
       sed 's/^/| /' conftest.dir/conftest.c >&5
-      ac_cv_linux_exports_sys_open=no
+      ac_cv_linux_exports_sys_close=no
   fi; rm -fr conftest.err conftest.dir
   else
 
@@ -15723,11 +15725,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <linux/kernel.h>
-extern asmlinkage long sys_open(void) __attribute__((weak));
+extern asmlinkage long sys_close(void) __attribute__((weak));
 int
 main ()
 {
-void *address = &sys_open;
+void *address = &sys_close;
 printk("%p\n", address);
   ;
   return 0;
@@ -15767,12 +15769,12 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_open=yes
+  ac_cv_linux_exports_sys_close=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_linux_exports_sys_open=no
+       ac_cv_linux_exports_sys_close=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -15780,12 +15782,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   fi
 fi
 
-  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_open" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_open" >&6; }
+  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_close" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_close" >&6; }
 
-  { echo "$as_me:$LINENO: checking for exported sys_wait4" >&5
-echo $ECHO_N "checking for exported sys_wait4... $ECHO_C" >&6; }
-  if test "${ac_cv_linux_exports_sys_wait4+set}" = set; then
+  { echo "$as_me:$LINENO: checking for exported sys_open" >&5
+echo $ECHO_N "checking for exported sys_open... $ECHO_C" >&6; }
+  if test "${ac_cv_linux_exports_sys_open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -15808,11 +15810,11 @@ _ACEOF
     cat >>conftest.dir/conftest.c <<\_ACEOF &&
 /* end confdefs.h */
 #include <linux/module.h>
-extern asmlinkage long sys_wait4(void) __attribute__((weak));
+extern asmlinkage long sys_open(void) __attribute__((weak));
 
 void conftest(void)
 {
-void *address = &sys_wait4;
+void *address = &sys_open;
 printk("%p\n", address);
 }
 
@@ -15821,14 +15823,14 @@ _ACEOF
     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 &&
     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 2>conftest.err &&
     ! grep -i "^WARNING: .* undefined!$" conftest.err >/dev/null 2>&1
-    then ac_cv_linux_exports_sys_wait4=yes
+    then ac_cv_linux_exports_sys_open=yes
     else
       sed '/^ *+/d' conftest.err >&5
       echo "$as_me: failed using Makefile:" >&5
       sed 's/^/| /' conftest.dir/Makefile >&5
       echo "$as_me: and program was:" >&5
       sed 's/^/| /' conftest.dir/conftest.c >&5
-      ac_cv_linux_exports_sys_wait4=no
+      ac_cv_linux_exports_sys_open=no
   fi; rm -fr conftest.err conftest.dir
   else
 
@@ -15842,11 +15844,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <linux/kernel.h>
-extern asmlinkage long sys_wait4(void) __attribute__((weak));
+extern asmlinkage long sys_open(void) __attribute__((weak));
 int
 main ()
 {
-void *address = &sys_wait4;
+void *address = &sys_open;
 printk("%p\n", address);
   ;
   return 0;
@@ -15886,12 +15888,12 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_wait4=yes
+  ac_cv_linux_exports_sys_open=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_linux_exports_sys_wait4=no
+       ac_cv_linux_exports_sys_open=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -15899,23 +15901,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   fi
 fi
 
-  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_wait4" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_wait4" >&6; }
+  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_open" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_open" >&6; }
 
-if test "x$enable_redhat_buildsys" = "xyes"; then
-  MPS=Default
-else
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS"
-  { echo "$as_me:$LINENO: checking which kernel modules to build" >&5
-echo $ECHO_N "checking which kernel modules to build... $ECHO_C" >&6; }
-  if test "x$ac_cv_linux_config_h_exists" = "xyes"; then
-    CPPFLAGS="-DCONFIG_H_EXISTS $CPPFLAGS"
-  fi
-  if test "x$ac_linux_rhconfig" = "xyes"; then
-      MPS="MP SP"
-  else
-  if test "${ac_cv_linux_config_smp+set}" = set; then
+  { echo "$as_me:$LINENO: checking for exported sys_wait4" >&5
+echo $ECHO_N "checking for exported sys_wait4... $ECHO_C" >&6; }
+  if test "${ac_cv_linux_exports_sys_wait4+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -15938,17 +15929,12 @@ _ACEOF
     cat >>conftest.dir/conftest.c <<\_ACEOF &&
 /* end confdefs.h */
 #include <linux/module.h>
-#ifdef CONFIG_H_EXISTS
-#include <linux/config.h>
-#endif
-
+extern asmlinkage long sys_wait4(void) __attribute__((weak));
 
 void conftest(void)
 {
-#ifndef CONFIG_SMP
-lose;
-#endif
-
+void *address = &sys_wait4;
+printk("%p\n", address);
 }
 
 MODULE_LICENSE("http://www.openafs.org/dl/license10.html");
@@ -15956,14 +15942,14 @@ _ACEOF
     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 &&
     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 2>conftest.err &&
     ! grep -i "^WARNING: .* undefined!$" conftest.err >/dev/null 2>&1
-    then ac_cv_linux_config_smp=yes
+    then ac_cv_linux_exports_sys_wait4=yes
     else
       sed '/^ *+/d' conftest.err >&5
       echo "$as_me: failed using Makefile:" >&5
       sed 's/^/| /' conftest.dir/Makefile >&5
       echo "$as_me: and program was:" >&5
       sed 's/^/| /' conftest.dir/conftest.c >&5
-      ac_cv_linux_config_smp=no
+      ac_cv_linux_exports_sys_wait4=no
   fi; rm -fr conftest.err conftest.dir
   else
 
@@ -15977,17 +15963,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <linux/kernel.h>
-#ifdef CONFIG_H_EXISTS
-#include <linux/config.h>
-#endif
-
+extern asmlinkage long sys_wait4(void) __attribute__((weak));
 int
 main ()
 {
-#ifndef CONFIG_SMP
-lose;
-#endif
-
+void *address = &sys_wait4;
+printk("%p\n", address);
   ;
   return 0;
 }
@@ -16026,12 +16007,12 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_linux_config_smp=yes
+  ac_cv_linux_exports_sys_wait4=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_linux_config_smp=no
+       ac_cv_linux_exports_sys_wait4=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -16039,30 +16020,23 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   fi
 fi
 
-        if test "x$ac_cv_linux_config_smp" = "xyes"; then
-          MPS=MP
-      else
-          MPS=SP
-      fi
-  fi
-  CPPFLAGS=$save_CPPFLAGS
-  { echo "$as_me:$LINENO: result: $MPS" >&5
-echo "${ECHO_T}$MPS" >&6; }
-fi
-
-
-                 if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
-                   { echo "$as_me:$LINENO: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&5
-echo "$as_me: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&2;}
-                   ac_cv_linux_exports_sys_call_table=no
-                  if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then
-                    ac_cv_linux_exports_ia32_sys_call_table=yes
-                  fi
-                 else
+  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_wait4" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_wait4" >&6; }
 
-  { echo "$as_me:$LINENO: checking for exported init_mm" >&5
-echo $ECHO_N "checking for exported init_mm... $ECHO_C" >&6; }
-  if test "${ac_cv_linux_exports_init_mm+set}" = set; then
+if test "x$enable_redhat_buildsys" = "xyes"; then
+  MPS=Default
+else
+  save_CPPFLAGS="$CPPFLAGS"
+  CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS"
+  { echo "$as_me:$LINENO: checking which kernel modules to build" >&5
+echo $ECHO_N "checking which kernel modules to build... $ECHO_C" >&6; }
+  if test "x$ac_cv_linux_config_h_exists" = "xyes"; then
+    CPPFLAGS="-DCONFIG_H_EXISTS $CPPFLAGS"
+  fi
+  if test "x$ac_linux_rhconfig" = "xyes"; then
+      MPS="MP SP"
+  else
+  if test "${ac_cv_linux_config_smp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -16085,13 +16059,17 @@ _ACEOF
     cat >>conftest.dir/conftest.c <<\_ACEOF &&
 /* end confdefs.h */
 #include <linux/module.h>
-#include <linux/modversions.h>
+#ifdef CONFIG_H_EXISTS
+#include <linux/config.h>
+#endif
+
 
 void conftest(void)
 {
-#ifndef __ver_init_mm
-#error init_mm not exported
+#ifndef CONFIG_SMP
+lose;
 #endif
+
 }
 
 MODULE_LICENSE("http://www.openafs.org/dl/license10.html");
@@ -16099,14 +16077,14 @@ _ACEOF
     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 &&
     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 2>conftest.err &&
     ! grep -i "^WARNING: .* undefined!$" conftest.err >/dev/null 2>&1
-    then ac_cv_linux_exports_init_mm=yes
+    then ac_cv_linux_config_smp=yes
     else
       sed '/^ *+/d' conftest.err >&5
       echo "$as_me: failed using Makefile:" >&5
       sed 's/^/| /' conftest.dir/Makefile >&5
       echo "$as_me: and program was:" >&5
       sed 's/^/| /' conftest.dir/conftest.c >&5
-      ac_cv_linux_exports_init_mm=no
+      ac_cv_linux_config_smp=no
   fi; rm -fr conftest.err conftest.dir
   else
 
@@ -16120,13 +16098,17 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <linux/kernel.h>
-#include <linux/modversions.h>
+#ifdef CONFIG_H_EXISTS
+#include <linux/config.h>
+#endif
+
 int
 main ()
 {
-#ifndef __ver_init_mm
-#error init_mm not exported
+#ifndef CONFIG_SMP
+lose;
 #endif
+
   ;
   return 0;
 }
@@ -16165,12 +16147,12 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_linux_exports_init_mm=yes
+  ac_cv_linux_config_smp=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_linux_exports_init_mm=no
+       ac_cv_linux_config_smp=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -16178,8 +16160,26 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   fi
 fi
 
-  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_init_mm" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_init_mm" >&6; }
+        if test "x$ac_cv_linux_config_smp" = "xyes"; then
+          MPS=MP
+      else
+          MPS=SP
+      fi
+  fi
+  CPPFLAGS=$save_CPPFLAGS
+  { echo "$as_me:$LINENO: result: $MPS" >&5
+echo "${ECHO_T}$MPS" >&6; }
+fi
+
+
+                 if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
+                   { echo "$as_me:$LINENO: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&5
+echo "$as_me: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&2;}
+                   ac_cv_linux_exports_sys_call_table=no
+                  if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then
+                    ac_cv_linux_exports_ia32_sys_call_table=yes
+                  fi
+                 else
 
   { echo "$as_me:$LINENO: checking for exported kallsyms_address_to_symbol" >&5
 echo $ECHO_N "checking for exported kallsyms_address_to_symbol... $ECHO_C" >&6; }
@@ -17092,7 +17092,11 @@ _ACEOF
 
                 fi
                 if test "x$ac_cv_linux_fs_struct_fop_has_flock" = "xyes" ; then
-                 echo flock support is currently disabled in OpenAFS 1.4 for Linux
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_FILE_OPERATIONS_HAS_FLOCK 1
+_ACEOF
+
                 fi
                 if test "x$ac_cv_linux_fs_struct_fop_has_sendfile" = "xyes" ; then
 
@@ -17133,6 +17137,13 @@ _ACEOF
 
 cat >>confdefs.h <<\_ACEOF
 #define STRUCT_NAMEIDATA_HAS_PATH 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_exports_init_mm" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_INIT_MM 1
 _ACEOF
 
                 fi
@@ -25550,6 +25561,7 @@ AMTAR!$AMTAR$ac_delim
 am__tar!$am__tar$ac_delim
 am__untar!$am__untar$ac_delim
 MACOS_VERSION!$MACOS_VERSION$ac_delim
+LINUX_VERSION!$LINUX_VERSION$ac_delim
 CC!$CC$ac_delim
 CFLAGS!$CFLAGS$ac_delim
 LDFLAGS!$LDFLAGS$ac_delim
@@ -25587,7 +25599,6 @@ LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim
 HEADER_RT!$HEADER_RT$ac_delim
 P5PLUS_KOPTS!$P5PLUS_KOPTS$ac_delim
 LINUX_GCC_KOPTS!$LINUX_GCC_KOPTS$ac_delim
-RHCONFIG_SP!$RHCONFIG_SP$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -25629,6 +25640,7 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+RHCONFIG_SP!$RHCONFIG_SP$ac_delim
 RHCONFIG_MP!$RHCONFIG_MP$ac_delim
 MPS!$MPS$ac_delim
 PTHREAD_LIBS!$PTHREAD_LIBS$ac_delim
@@ -25654,7 +25666,6 @@ LIB_AFSDB!$LIB_AFSDB$ac_delim
 LINUX_KERNEL_PATH!$LINUX_KERNEL_PATH$ac_delim
 BSD_KERNEL_PATH!$BSD_KERNEL_PATH$ac_delim
 BSD_KERNEL_BUILD!$BSD_KERNEL_BUILD$ac_delim
-LINUX_VERSION!$LINUX_VERSION$ac_delim
 MKAFS_OSTYPE!$MKAFS_OSTYPE$ac_delim
 TOP_OBJDIR!$TOP_OBJDIR$ac_delim
 TOP_SRCDIR!$TOP_SRCDIR$ac_delim
index 0575b1c91c4e476aba70e92c31c8402340aebfe0..9142b9cc85872325a15a1c44b0f6fdb274c748a7 100644 (file)
@@ -657,6 +657,7 @@ AMTAR
 am__tar
 am__untar
 MACOS_VERSION
+LINUX_VERSION
 CC
 CFLAGS
 LDFLAGS
@@ -720,7 +721,6 @@ LIB_AFSDB
 LINUX_KERNEL_PATH
 BSD_KERNEL_PATH
 BSD_KERNEL_BUILD
-LINUX_VERSION
 MKAFS_OSTYPE
 TOP_OBJDIR
 TOP_SRCDIR
@@ -2174,7 +2174,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=openafs-libafs
- VERSION=1.4.7pre1
+ VERSION=1.4.7pre3
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2322,7 +2322,9 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 
 ac_config_headers="$ac_config_headers src/config/afsconfig.h"
 
-MACOS_VERSION=1.4.7fc1
+MACOS_VERSION=1.4.7fc3
+LINUX_VERSION=0.pre3
+
 
 
 
@@ -15383,9 +15385,9 @@ fi
   { echo "$as_me:$LINENO: result: $ac_cv_linux_struct_nameidata_has_path" >&5
 echo "${ECHO_T}$ac_cv_linux_struct_nameidata_has_path" >&6; }
 
-  { echo "$as_me:$LINENO: checking for exported sys_chdir" >&5
-echo $ECHO_N "checking for exported sys_chdir... $ECHO_C" >&6; }
-  if test "${ac_cv_linux_exports_sys_chdir+set}" = set; then
+  { echo "$as_me:$LINENO: checking for exported init_mm" >&5
+echo $ECHO_N "checking for exported init_mm... $ECHO_C" >&6; }
+  if test "${ac_cv_linux_exports_init_mm+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -15408,11 +15410,11 @@ _ACEOF
     cat >>conftest.dir/conftest.c <<\_ACEOF &&
 /* end confdefs.h */
 #include <linux/module.h>
-extern asmlinkage long sys_chdir(void) __attribute__((weak));
+extern struct mm_struct init_mm;
 
 void conftest(void)
 {
-void *address = &sys_chdir;
+void *address = &init_mm;
 printk("%p\n", address);
 }
 
@@ -15421,14 +15423,14 @@ _ACEOF
     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 &&
     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 2>conftest.err &&
     ! grep -i "^WARNING: .* undefined!$" conftest.err >/dev/null 2>&1
-    then ac_cv_linux_exports_sys_chdir=yes
+    then ac_cv_linux_exports_init_mm=yes
     else
       sed '/^ *+/d' conftest.err >&5
       echo "$as_me: failed using Makefile:" >&5
       sed 's/^/| /' conftest.dir/Makefile >&5
       echo "$as_me: and program was:" >&5
       sed 's/^/| /' conftest.dir/conftest.c >&5
-      ac_cv_linux_exports_sys_chdir=no
+      ac_cv_linux_exports_init_mm=no
   fi; rm -fr conftest.err conftest.dir
   else
 
@@ -15442,11 +15444,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <linux/kernel.h>
-extern asmlinkage long sys_chdir(void) __attribute__((weak));
+extern struct mm_struct init_mm;
 int
 main ()
 {
-void *address = &sys_chdir;
+void *address = &init_mm;
 printk("%p\n", address);
   ;
   return 0;
@@ -15486,12 +15488,12 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_chdir=yes
+  ac_cv_linux_exports_init_mm=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_linux_exports_sys_chdir=no
+       ac_cv_linux_exports_init_mm=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -15499,12 +15501,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   fi
 fi
 
-  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_chdir" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_chdir" >&6; }
+  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_init_mm" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_init_mm" >&6; }
 
-  { echo "$as_me:$LINENO: checking for exported sys_close" >&5
-echo $ECHO_N "checking for exported sys_close... $ECHO_C" >&6; }
-  if test "${ac_cv_linux_exports_sys_close+set}" = set; then
+  { echo "$as_me:$LINENO: checking for exported sys_chdir" >&5
+echo $ECHO_N "checking for exported sys_chdir... $ECHO_C" >&6; }
+  if test "${ac_cv_linux_exports_sys_chdir+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -15527,11 +15529,11 @@ _ACEOF
     cat >>conftest.dir/conftest.c <<\_ACEOF &&
 /* end confdefs.h */
 #include <linux/module.h>
-extern asmlinkage long sys_close(void) __attribute__((weak));
+extern asmlinkage long sys_chdir(void) __attribute__((weak));
 
 void conftest(void)
 {
-void *address = &sys_close;
+void *address = &sys_chdir;
 printk("%p\n", address);
 }
 
@@ -15540,14 +15542,14 @@ _ACEOF
     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 &&
     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 2>conftest.err &&
     ! grep -i "^WARNING: .* undefined!$" conftest.err >/dev/null 2>&1
-    then ac_cv_linux_exports_sys_close=yes
+    then ac_cv_linux_exports_sys_chdir=yes
     else
       sed '/^ *+/d' conftest.err >&5
       echo "$as_me: failed using Makefile:" >&5
       sed 's/^/| /' conftest.dir/Makefile >&5
       echo "$as_me: and program was:" >&5
       sed 's/^/| /' conftest.dir/conftest.c >&5
-      ac_cv_linux_exports_sys_close=no
+      ac_cv_linux_exports_sys_chdir=no
   fi; rm -fr conftest.err conftest.dir
   else
 
@@ -15561,11 +15563,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <linux/kernel.h>
-extern asmlinkage long sys_close(void) __attribute__((weak));
+extern asmlinkage long sys_chdir(void) __attribute__((weak));
 int
 main ()
 {
-void *address = &sys_close;
+void *address = &sys_chdir;
 printk("%p\n", address);
   ;
   return 0;
@@ -15605,12 +15607,12 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_close=yes
+  ac_cv_linux_exports_sys_chdir=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_linux_exports_sys_close=no
+       ac_cv_linux_exports_sys_chdir=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -15618,12 +15620,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   fi
 fi
 
-  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_close" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_close" >&6; }
+  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_chdir" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_chdir" >&6; }
 
-  { echo "$as_me:$LINENO: checking for exported sys_open" >&5
-echo $ECHO_N "checking for exported sys_open... $ECHO_C" >&6; }
-  if test "${ac_cv_linux_exports_sys_open+set}" = set; then
+  { echo "$as_me:$LINENO: checking for exported sys_close" >&5
+echo $ECHO_N "checking for exported sys_close... $ECHO_C" >&6; }
+  if test "${ac_cv_linux_exports_sys_close+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -15646,11 +15648,11 @@ _ACEOF
     cat >>conftest.dir/conftest.c <<\_ACEOF &&
 /* end confdefs.h */
 #include <linux/module.h>
-extern asmlinkage long sys_open(void) __attribute__((weak));
+extern asmlinkage long sys_close(void) __attribute__((weak));
 
 void conftest(void)
 {
-void *address = &sys_open;
+void *address = &sys_close;
 printk("%p\n", address);
 }
 
@@ -15659,14 +15661,14 @@ _ACEOF
     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 &&
     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 2>conftest.err &&
     ! grep -i "^WARNING: .* undefined!$" conftest.err >/dev/null 2>&1
-    then ac_cv_linux_exports_sys_open=yes
+    then ac_cv_linux_exports_sys_close=yes
     else
       sed '/^ *+/d' conftest.err >&5
       echo "$as_me: failed using Makefile:" >&5
       sed 's/^/| /' conftest.dir/Makefile >&5
       echo "$as_me: and program was:" >&5
       sed 's/^/| /' conftest.dir/conftest.c >&5
-      ac_cv_linux_exports_sys_open=no
+      ac_cv_linux_exports_sys_close=no
   fi; rm -fr conftest.err conftest.dir
   else
 
@@ -15680,11 +15682,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <linux/kernel.h>
-extern asmlinkage long sys_open(void) __attribute__((weak));
+extern asmlinkage long sys_close(void) __attribute__((weak));
 int
 main ()
 {
-void *address = &sys_open;
+void *address = &sys_close;
 printk("%p\n", address);
   ;
   return 0;
@@ -15724,12 +15726,12 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_open=yes
+  ac_cv_linux_exports_sys_close=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_linux_exports_sys_open=no
+       ac_cv_linux_exports_sys_close=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -15737,12 +15739,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   fi
 fi
 
-  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_open" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_open" >&6; }
+  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_close" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_close" >&6; }
 
-  { echo "$as_me:$LINENO: checking for exported sys_wait4" >&5
-echo $ECHO_N "checking for exported sys_wait4... $ECHO_C" >&6; }
-  if test "${ac_cv_linux_exports_sys_wait4+set}" = set; then
+  { echo "$as_me:$LINENO: checking for exported sys_open" >&5
+echo $ECHO_N "checking for exported sys_open... $ECHO_C" >&6; }
+  if test "${ac_cv_linux_exports_sys_open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -15765,11 +15767,11 @@ _ACEOF
     cat >>conftest.dir/conftest.c <<\_ACEOF &&
 /* end confdefs.h */
 #include <linux/module.h>
-extern asmlinkage long sys_wait4(void) __attribute__((weak));
+extern asmlinkage long sys_open(void) __attribute__((weak));
 
 void conftest(void)
 {
-void *address = &sys_wait4;
+void *address = &sys_open;
 printk("%p\n", address);
 }
 
@@ -15778,14 +15780,14 @@ _ACEOF
     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 &&
     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 2>conftest.err &&
     ! grep -i "^WARNING: .* undefined!$" conftest.err >/dev/null 2>&1
-    then ac_cv_linux_exports_sys_wait4=yes
+    then ac_cv_linux_exports_sys_open=yes
     else
       sed '/^ *+/d' conftest.err >&5
       echo "$as_me: failed using Makefile:" >&5
       sed 's/^/| /' conftest.dir/Makefile >&5
       echo "$as_me: and program was:" >&5
       sed 's/^/| /' conftest.dir/conftest.c >&5
-      ac_cv_linux_exports_sys_wait4=no
+      ac_cv_linux_exports_sys_open=no
   fi; rm -fr conftest.err conftest.dir
   else
 
@@ -15799,11 +15801,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <linux/kernel.h>
-extern asmlinkage long sys_wait4(void) __attribute__((weak));
+extern asmlinkage long sys_open(void) __attribute__((weak));
 int
 main ()
 {
-void *address = &sys_wait4;
+void *address = &sys_open;
 printk("%p\n", address);
   ;
   return 0;
@@ -15843,12 +15845,12 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_wait4=yes
+  ac_cv_linux_exports_sys_open=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_linux_exports_sys_wait4=no
+       ac_cv_linux_exports_sys_open=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -15856,23 +15858,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   fi
 fi
 
-  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_wait4" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_wait4" >&6; }
+  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_open" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_open" >&6; }
 
-if test "x$enable_redhat_buildsys" = "xyes"; then
-  MPS=Default
-else
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS"
-  { echo "$as_me:$LINENO: checking which kernel modules to build" >&5
-echo $ECHO_N "checking which kernel modules to build... $ECHO_C" >&6; }
-  if test "x$ac_cv_linux_config_h_exists" = "xyes"; then
-    CPPFLAGS="-DCONFIG_H_EXISTS $CPPFLAGS"
-  fi
-  if test "x$ac_linux_rhconfig" = "xyes"; then
-      MPS="MP SP"
-  else
-  if test "${ac_cv_linux_config_smp+set}" = set; then
+  { echo "$as_me:$LINENO: checking for exported sys_wait4" >&5
+echo $ECHO_N "checking for exported sys_wait4... $ECHO_C" >&6; }
+  if test "${ac_cv_linux_exports_sys_wait4+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -15895,17 +15886,12 @@ _ACEOF
     cat >>conftest.dir/conftest.c <<\_ACEOF &&
 /* end confdefs.h */
 #include <linux/module.h>
-#ifdef CONFIG_H_EXISTS
-#include <linux/config.h>
-#endif
-
+extern asmlinkage long sys_wait4(void) __attribute__((weak));
 
 void conftest(void)
 {
-#ifndef CONFIG_SMP
-lose;
-#endif
-
+void *address = &sys_wait4;
+printk("%p\n", address);
 }
 
 MODULE_LICENSE("http://www.openafs.org/dl/license10.html");
@@ -15913,14 +15899,14 @@ _ACEOF
     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 &&
     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 2>conftest.err &&
     ! grep -i "^WARNING: .* undefined!$" conftest.err >/dev/null 2>&1
-    then ac_cv_linux_config_smp=yes
+    then ac_cv_linux_exports_sys_wait4=yes
     else
       sed '/^ *+/d' conftest.err >&5
       echo "$as_me: failed using Makefile:" >&5
       sed 's/^/| /' conftest.dir/Makefile >&5
       echo "$as_me: and program was:" >&5
       sed 's/^/| /' conftest.dir/conftest.c >&5
-      ac_cv_linux_config_smp=no
+      ac_cv_linux_exports_sys_wait4=no
   fi; rm -fr conftest.err conftest.dir
   else
 
@@ -15934,17 +15920,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <linux/kernel.h>
-#ifdef CONFIG_H_EXISTS
-#include <linux/config.h>
-#endif
-
+extern asmlinkage long sys_wait4(void) __attribute__((weak));
 int
 main ()
 {
-#ifndef CONFIG_SMP
-lose;
-#endif
-
+void *address = &sys_wait4;
+printk("%p\n", address);
   ;
   return 0;
 }
@@ -15983,12 +15964,12 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_linux_config_smp=yes
+  ac_cv_linux_exports_sys_wait4=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_linux_config_smp=no
+       ac_cv_linux_exports_sys_wait4=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -15996,30 +15977,23 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   fi
 fi
 
-        if test "x$ac_cv_linux_config_smp" = "xyes"; then
-          MPS=MP
-      else
-          MPS=SP
-      fi
-  fi
-  CPPFLAGS=$save_CPPFLAGS
-  { echo "$as_me:$LINENO: result: $MPS" >&5
-echo "${ECHO_T}$MPS" >&6; }
-fi
-
-
-                 if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
-                   { echo "$as_me:$LINENO: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&5
-echo "$as_me: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&2;}
-                   ac_cv_linux_exports_sys_call_table=no
-                  if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then
-                    ac_cv_linux_exports_ia32_sys_call_table=yes
-                  fi
-                 else
+  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_wait4" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_wait4" >&6; }
 
-  { echo "$as_me:$LINENO: checking for exported init_mm" >&5
-echo $ECHO_N "checking for exported init_mm... $ECHO_C" >&6; }
-  if test "${ac_cv_linux_exports_init_mm+set}" = set; then
+if test "x$enable_redhat_buildsys" = "xyes"; then
+  MPS=Default
+else
+  save_CPPFLAGS="$CPPFLAGS"
+  CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS"
+  { echo "$as_me:$LINENO: checking which kernel modules to build" >&5
+echo $ECHO_N "checking which kernel modules to build... $ECHO_C" >&6; }
+  if test "x$ac_cv_linux_config_h_exists" = "xyes"; then
+    CPPFLAGS="-DCONFIG_H_EXISTS $CPPFLAGS"
+  fi
+  if test "x$ac_linux_rhconfig" = "xyes"; then
+      MPS="MP SP"
+  else
+  if test "${ac_cv_linux_config_smp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -16042,13 +16016,17 @@ _ACEOF
     cat >>conftest.dir/conftest.c <<\_ACEOF &&
 /* end confdefs.h */
 #include <linux/module.h>
-#include <linux/modversions.h>
+#ifdef CONFIG_H_EXISTS
+#include <linux/config.h>
+#endif
+
 
 void conftest(void)
 {
-#ifndef __ver_init_mm
-#error init_mm not exported
+#ifndef CONFIG_SMP
+lose;
 #endif
+
 }
 
 MODULE_LICENSE("http://www.openafs.org/dl/license10.html");
@@ -16056,14 +16034,14 @@ _ACEOF
     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 &&
     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&5 2>conftest.err &&
     ! grep -i "^WARNING: .* undefined!$" conftest.err >/dev/null 2>&1
-    then ac_cv_linux_exports_init_mm=yes
+    then ac_cv_linux_config_smp=yes
     else
       sed '/^ *+/d' conftest.err >&5
       echo "$as_me: failed using Makefile:" >&5
       sed 's/^/| /' conftest.dir/Makefile >&5
       echo "$as_me: and program was:" >&5
       sed 's/^/| /' conftest.dir/conftest.c >&5
-      ac_cv_linux_exports_init_mm=no
+      ac_cv_linux_config_smp=no
   fi; rm -fr conftest.err conftest.dir
   else
 
@@ -16077,13 +16055,17 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <linux/kernel.h>
-#include <linux/modversions.h>
+#ifdef CONFIG_H_EXISTS
+#include <linux/config.h>
+#endif
+
 int
 main ()
 {
-#ifndef __ver_init_mm
-#error init_mm not exported
+#ifndef CONFIG_SMP
+lose;
 #endif
+
   ;
   return 0;
 }
@@ -16122,12 +16104,12 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_linux_exports_init_mm=yes
+  ac_cv_linux_config_smp=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_linux_exports_init_mm=no
+       ac_cv_linux_config_smp=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -16135,8 +16117,26 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   fi
 fi
 
-  { echo "$as_me:$LINENO: result: $ac_cv_linux_exports_init_mm" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_init_mm" >&6; }
+        if test "x$ac_cv_linux_config_smp" = "xyes"; then
+          MPS=MP
+      else
+          MPS=SP
+      fi
+  fi
+  CPPFLAGS=$save_CPPFLAGS
+  { echo "$as_me:$LINENO: result: $MPS" >&5
+echo "${ECHO_T}$MPS" >&6; }
+fi
+
+
+                 if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
+                   { echo "$as_me:$LINENO: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&5
+echo "$as_me: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&2;}
+                   ac_cv_linux_exports_sys_call_table=no
+                  if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then
+                    ac_cv_linux_exports_ia32_sys_call_table=yes
+                  fi
+                 else
 
   { echo "$as_me:$LINENO: checking for exported kallsyms_address_to_symbol" >&5
 echo $ECHO_N "checking for exported kallsyms_address_to_symbol... $ECHO_C" >&6; }
@@ -17049,7 +17049,11 @@ _ACEOF
 
                 fi
                 if test "x$ac_cv_linux_fs_struct_fop_has_flock" = "xyes" ; then
-                 echo flock support is currently disabled in OpenAFS 1.4 for Linux
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_FILE_OPERATIONS_HAS_FLOCK 1
+_ACEOF
+
                 fi
                 if test "x$ac_cv_linux_fs_struct_fop_has_sendfile" = "xyes" ; then
 
@@ -17090,6 +17094,13 @@ _ACEOF
 
 cat >>confdefs.h <<\_ACEOF
 #define STRUCT_NAMEIDATA_HAS_PATH 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_exports_init_mm" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_INIT_MM 1
 _ACEOF
 
                 fi
@@ -25386,6 +25397,7 @@ AMTAR!$AMTAR$ac_delim
 am__tar!$am__tar$ac_delim
 am__untar!$am__untar$ac_delim
 MACOS_VERSION!$MACOS_VERSION$ac_delim
+LINUX_VERSION!$LINUX_VERSION$ac_delim
 CC!$CC$ac_delim
 CFLAGS!$CFLAGS$ac_delim
 LDFLAGS!$LDFLAGS$ac_delim
@@ -25423,7 +25435,6 @@ LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim
 HEADER_RT!$HEADER_RT$ac_delim
 P5PLUS_KOPTS!$P5PLUS_KOPTS$ac_delim
 LINUX_GCC_KOPTS!$LINUX_GCC_KOPTS$ac_delim
-RHCONFIG_SP!$RHCONFIG_SP$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -25465,6 +25476,7 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+RHCONFIG_SP!$RHCONFIG_SP$ac_delim
 RHCONFIG_MP!$RHCONFIG_MP$ac_delim
 MPS!$MPS$ac_delim
 PTHREAD_LIBS!$PTHREAD_LIBS$ac_delim
@@ -25490,7 +25502,6 @@ LIB_AFSDB!$LIB_AFSDB$ac_delim
 LINUX_KERNEL_PATH!$LINUX_KERNEL_PATH$ac_delim
 BSD_KERNEL_PATH!$BSD_KERNEL_PATH$ac_delim
 BSD_KERNEL_BUILD!$BSD_KERNEL_BUILD$ac_delim
-LINUX_VERSION!$LINUX_VERSION$ac_delim
 MKAFS_OSTYPE!$MKAFS_OSTYPE$ac_delim
 TOP_OBJDIR!$TOP_OBJDIR$ac_delim
 TOP_SRCDIR!$TOP_SRCDIR$ac_delim
index a606297c9ef924e81741165bca86870a25a4a79d..041346c68c37063c13f4fad591e5bbea6dba2035 100644 (file)
@@ -1,9 +1,11 @@
 AC_INIT(src/libafs/Makefile.common.in)
-AM_INIT_AUTOMAKE(openafs-libafs,1.4.7pre1)
+AM_INIT_AUTOMAKE(openafs-libafs,1.4.7pre3)
 AC_CONFIG_HEADER(src/config/afsconfig.h)
-MACOS_VERSION=1.4.7fc1
+MACOS_VERSION=1.4.7fc3
+LINUX_VERSION=0.pre3
 
 AC_SUBST(MACOS_VERSION)
+AC_SUBST(LINUX_VERSION)
 
 define(OPENAFS_CONFIGURE_LIBAFS)
 AC_PROG_CC
index a9e7e35d9b09f5d76a1a869c17a3d6be2c6ce1dc..039c1686fb93101053d7cda042ae9ea8e23c92f3 100644 (file)
@@ -1,9 +1,11 @@
 AC_INIT(src/config/stds.h)
-AM_INIT_AUTOMAKE(openafs,1.4.7pre1)
+AM_INIT_AUTOMAKE(openafs,1.4.7pre3)
 AC_CONFIG_HEADER(src/config/afsconfig.h)
-MACOS_VERSION=1.4.7fc1
+MACOS_VERSION=1.4.7fc3
+LINUX_VERSION=0.pre3
 
 AC_SUBST(MACOS_VERSION)
+AC_SUBST(LINUX_VERSION)
 
 AC_PROG_CC
 AC_CHECK_PROGS(CPP,[/lib/cpp /usr/bin/cpp /usr/ccs/lib/cpp cpp],,[$PATH:/])
index 022cc2fc5e3b8be29246899eaf3c75d445c86d8f..164340f298cfcc25f8af181e92c0ae733501651f 100644 (file)
@@ -213,7 +213,6 @@ Known Problems
        vldb_convert
        vos clone
        vos setfields
-       vos shadow
        vsys
 
    * klog.krb, pagsh.krb, and tokens.krb need to be listed as alternative
diff --git a/doc/man-pages/man1/vos_shadow.1 b/doc/man-pages/man1/vos_shadow.1
new file mode 100644 (file)
index 0000000..ab65efb
--- /dev/null
@@ -0,0 +1,360 @@
+.rn '' }`
+''' $RCSfile$$Revision$$Date$
+'''
+''' $Log$
+'''
+.de Sh
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp
+.if t .sp .5v
+.if n .sp
+..
+.de Ip
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.de Vb
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve
+.ft R
+
+.fi
+..
+'''
+'''
+'''     Set up \*(-- to give an unbreakable dash;
+'''     string Tr holds user defined translation string.
+'''     Bell System Logo is used as a dummy character.
+'''
+.tr \(*W-|\(bv\*(Tr
+.ie n \{\
+.ds -- \(*W-
+.ds PI pi
+.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+.ds L" ""
+.ds R" ""
+'''   \*(M", \*(S", \*(N" and \*(T" are the equivalent of
+'''   \*(L" and \*(R", except that they are used on ".xx" lines,
+'''   such as .IP and .SH, which do another additional levels of
+'''   double-quote interpretation
+.ds M" """
+.ds S" """
+.ds N" """""
+.ds T" """""
+.ds L' '
+.ds R' '
+.ds M' '
+.ds S' '
+.ds N' '
+.ds T' '
+'br\}
+.el\{\
+.ds -- \(em\|
+.tr \*(Tr
+.ds L" ``
+.ds R" ''
+.ds M" ``
+.ds S" ''
+.ds N" ``
+.ds T" ''
+.ds L' `
+.ds R' '
+.ds M' `
+.ds S' '
+.ds N' `
+.ds T' '
+.ds PI \(*p
+'br\}
+.\"    If the F register is turned on, we'll generate
+.\"    index entries out stderr for the following things:
+.\"            TH      Title 
+.\"            SH      Header
+.\"            Sh      Subsection 
+.\"            Ip      Item
+.\"            X<>     Xref  (embedded
+.\"    Of course, you have to process the output yourself
+.\"    in some meaninful fashion.
+.if \nF \{
+.de IX
+.tm Index:\\$1\t\\n%\t"\\$2"
+..
+.nr % 0
+.rr F
+.\}
+.TH VOS_SHADOW 1 "OpenAFS" "1/Apr/2008" "AFS Command Reference"
+.UC
+.if n .hy 0
+.if n .na
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.de CQ          \" put $1 in typewriter font
+.ft CW
+'if n "\c
+'if t \\&\\$1\c
+'if n \\&\\$1\c
+'if n \&"
+\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
+'.ft R
+..
+.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
+.      \" AM - accent mark definitions
+.bd B 3
+.      \" fudge factors for nroff and troff
+.if n \{\
+.      ds #H 0
+.      ds #V .8m
+.      ds #F .3m
+.      ds #[ \f1
+.      ds #] \fP
+.\}
+.if t \{\
+.      ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+.      ds #V .6m
+.      ds #F 0
+.      ds #[ \&
+.      ds #] \&
+.\}
+.      \" simple accents for nroff and troff
+.if n \{\
+.      ds ' \&
+.      ds ` \&
+.      ds ^ \&
+.      ds , \&
+.      ds ~ ~
+.      ds ? ?
+.      ds ! !
+.      ds /
+.      ds q
+.\}
+.if t \{\
+.      ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+.      ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+.      ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+.      ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+.      ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+.      ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
+.      ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
+.      ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.      ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
+.\}
+.      \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
+.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
+.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
+.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.ds oe o\h'-(\w'o'u*4/10)'e
+.ds Oe O\h'-(\w'O'u*4/10)'E
+.      \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+.      \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+.      ds : e
+.      ds 8 ss
+.      ds v \h'-1'\o'\(aa\(ga'
+.      ds _ \h'-1'^
+.      ds . \h'-1'.
+.      ds 3 3
+.      ds o a
+.      ds d- d\h'-1'\(ga
+.      ds D- D\h'-1'\(hy
+.      ds th \o'bp'
+.      ds Th \o'LP'
+.      ds ae ae
+.      ds Ae AE
+.      ds oe oe
+.      ds Oe OE
+.\}
+.rm #[ #] #H #V #F C
+.SH "NAME"
+vos_shadow \- Creates a shadow copy of a volume on a different server/partition
+.SH "SYNOPSIS"
+\fBvos shadow\fR <<\ [\fB\-id\fR]\ <\fIvolume\ name\ or\ ID\ on\ source\fR >>>
+    <<\ [\fB\-fromserver\fR]\ <\fImachine\ name\ on\ source\fR >>>
+    <<\ [\fB\-frompartition\fR]\ <\fIpartition\ name\ on\ source\fR >>>
+    <<\ [\fB\-toserver\fR]\ <\fImachine\ name\ on\ destination\fR >>>
+    <<\ [\fB\-topartition\fR]\ <\fIpartition\ name\ on\ destination\fR >>>
+    <<\ [\fB\-toname\fR\ <\fIvolume\ name\ on\ destination\fR] >>>
+    <<\ [\fB\-toid\fR\ <\fIvolume\ ID\ on\ destination\fR] >>> [\fB\-offline\fR] [\fB\-readonly\fR]
+    [\fB\-live\fR] [\fB\-incremental\fR] <<\ [\fB\-cell\fR\ <\fIcell\ name\fR] >>> [\fB\-noauth\fR]
+    [\fB\-localauth\fR] [\fB\-verbose\fR] [\fB\-encrypt\fR] [\fB\-help\fR]
+.SH "DESCRIPTION"
+The \fBvos shadow\fR command creates a shadow copy of a volume on a
+different partition or server.
+.PP
+A shadow volume is a copy of a volume that does not normally appear in
+the volume location database (VLDB). It is a primitive operation that
+is meant to be used in backup or disaster recovery situations.
+.SH "CAUTIONS"
+This command is not used during normal OpenAFS administration and may
+have adverse effects on the VLDB if not used properly! This command
+should only be used by an expert.
+.PP
+Using this command on a volume when the source volume is not the same
+as parent volume used to create the shadow will leave the destination
+volume in a unknown state.
+.PP
+Do NOT run the \fBvos syncserv\fR or \fBvos syncvldb\fR on any fileserver
+containing shadow volumes. This would update the VLDB to show all
+shadowed Read/Write volumes instead of the source volumes from which
+they were copied.
+.PP
+Currently, the maximum size of a volume is 2 terabytes (2^31 bytes).
+.SH "OPTIONS"
+.Ip "[\fB\-id\fR] <\fIvolume name or \s-1ID\s0\fR>" 4
+Specifies either the complete name or volume \s-1ID\s0 number of a read/write
+volume.
+.Ip "[\fB\-fromserver\fR] <\fImachine name for source\fR>" 4
+Identifies the file server machine where the source volume resides. Provide
+the machine's \s-1IP\s0 address or its host name (either fully qualified or using
+an unambiguous abbreviation). For details, see the \fIvos(1)\fR manpage.
+.Ip "[\fB\-frompartition\fR] <\fIpartition name for source\fR>" 4
+Names the partition where the source volume resides. Provide the full
+partition name (for, example, \fB/vicepa\fR) or one of the abbreviated forms
+described in the \fIvos(1)\fR manpage.
+.Ip "[\fB\-toserver\fR] <\fImachine name for destination\fR>" 4
+Identifies the file server machine to which to copy the volume.  Provide
+the machine's \s-1IP\s0 address or its host name (either fully qualified or using
+an unambiguous abbreviation). For details, see the \fIvos(1)\fR manpage.
+.Ip "[\fB\-topartition\fR] <\fIpartition name for destination\fR>" 4
+Names the partition to which to copy the volume. Provide the full partition
+name (for, example, \fB/vicepa\fR) or one of the abbreviated forms described in
+the \fIvos(1)\fR manpage.
+.Ip "\fB\-toname\fR <\fIvolume name for new copy\fR>" 4
+The complete name of the new volume to create.
+.Ip "\fB\-offline\fR" 4
+Leaves the new volume flagged as off-line in the volume database.
+.Ip "\fB\-readonly\fR" 4
+Flags the new volume as read-only in the volume database.
+.Ip "\fB\-live\fR" 4
+Copies the live volume without cloning.  This is normally not necessary and
+causes the volume to be kept locked for longer than the normal copy
+mechanism.
+.Ip "\fB\-incremental\fR" 4
+Copy the changes from the source volume to a previously created shadow
+volume.
+.Ip "\fB\-cell\fR <\fIcell name\fR>" 4
+Names the cell in which to run the command. Do not combine this argument
+with the \fB\-localauth\fR flag. For more details, see the \fIvos(1)\fR manpage.
+.Ip "\fB\-noauth\fR" 4
+Assigns the unprivileged identity \f(CWanonymous\fR to the issuer. Do not
+combine this flag with the \fB\-localauth\fR flag. For more details, see
+the \fIvos(1)\fR manpage.
+.Ip "\fB\-localauth\fR" 4
+Constructs a server ticket using a key from the local
+\fI/usr/afs/etc/KeyFile\fR file. The \fBvos\fR command interpreter presents
+it to the Volume Server and Volume Location Server during mutual
+authentication. Do not combine this flag with the \fB\-cell\fR argument or
+\fB\-noauth\fR flag. For more details, see the \fIvos(1)\fR manpage.
+.Ip "\fB\-verbose\fR" 4
+Produces on the standard output stream a detailed trace of the command's
+execution. If this argument is omitted, only warnings and error messages
+appear.
+.Ip "\fB\-encrypt\fR" 4
+Encrypts the command so that the operation's results are not transmitted
+across the network in clear text.
+.Ip "\fB\-help\fR" 4
+Prints the online help for this command. All other valid options are
+ignored.
+.SH "OUTPUT"
+This command has no output unless \f(CW-verbose\fR is specified or there is
+an error.
+.SH "PRIVILEGE REQUIRED"
+The issuer must be listed in the \fI/usr/afs/etc/UserList\fR file on the
+machines specified with the \fB\-toserver\fR and \fB\-fromserver\fR arguments and
+on each database server machine.  If the \fB\-localauth\fR flag is included,
+the issuer must instead be logged on to a server machine as the local
+superuser \f(CWroot\fR.
+.SH "SEE ALSO"
+the \fIvos(1)\fR manpage,
+the \fIvos_backup(1)\fR manpage,
+the \fIvos_copy(1)\fR manpage,
+the \fIvos_move(1)\fR manpage
+.PP
+the section on \fI/www.openafs.org/pipermail/openafs-info/2005-July/018469.html\fR in the \fIhttp:\fR manpage
+discusses motivation for the creation of this command.
+.PP
+the section on \fI/workshop.openafs.org/afsbpw06/talks/drh.scs.html\fR in the \fIhttp:\fR manpage discusses
+one possible use for it.
+.SH "COPYRIGHT"
+Copyright 2008 Jason Edgecombe <jason@rampaginggeek.com>
+.PP
+This documentation is covered by the BSD License as written in the
+doc/LICENSE file. This man page was written by Jason Edgecombe for
+OpenAFS.
+
+.rn }` ''
+.IX Title "VOS_SHADOW 1"
+.IX Name "vos_shadow - Creates a shadow copy of a volume on a different server/partition"
+
+.IX Header "NAME"
+
+.IX Header "SYNOPSIS"
+
+.IX Header "DESCRIPTION"
+
+.IX Header "CAUTIONS"
+
+.IX Header "OPTIONS"
+
+.IX Item "[\fB\-id\fR] <\fIvolume name or \s-1ID\s0\fR>"
+
+.IX Item "[\fB\-fromserver\fR] <\fImachine name for source\fR>"
+
+.IX Item "[\fB\-frompartition\fR] <\fIpartition name for source\fR>"
+
+.IX Item "[\fB\-toserver\fR] <\fImachine name for destination\fR>"
+
+.IX Item "[\fB\-topartition\fR] <\fIpartition name for destination\fR>"
+
+.IX Item "\fB\-toname\fR <\fIvolume name for new copy\fR>"
+
+.IX Item "\fB\-offline\fR"
+
+.IX Item "\fB\-readonly\fR"
+
+.IX Item "\fB\-live\fR"
+
+.IX Item "\fB\-incremental\fR"
+
+.IX Item "\fB\-cell\fR <\fIcell name\fR>"
+
+.IX Item "\fB\-noauth\fR"
+
+.IX Item "\fB\-localauth\fR"
+
+.IX Item "\fB\-verbose\fR"
+
+.IX Item "\fB\-encrypt\fR"
+
+.IX Item "\fB\-help\fR"
+
+.IX Header "OUTPUT"
+
+.IX Header "PRIVILEGE REQUIRED"
+
+.IX Header "SEE ALSO"
+
+.IX Header "COPYRIGHT"
+
diff --git a/doc/man-pages/pod1/vos_shadow.pod b/doc/man-pages/pod1/vos_shadow.pod
new file mode 100644 (file)
index 0000000..ee75981
--- /dev/null
@@ -0,0 +1,174 @@
+=head1 NAME
+
+vos_shadow - Creates a shadow copy of a volume on a different server/partition
+
+=head1 SYNOPSIS
+
+=for html
+<div class="synopsis">
+
+B<vos shadow> S<<< [B<-id>] <I<volume name or ID on source>> >>>
+    S<<< [B<-fromserver>] <I<machine name on source>> >>>
+    S<<< [B<-frompartition>] <I<partition name on source>> >>>
+    S<<< [B<-toserver>] <I<machine name on destination>> >>>
+    S<<< [B<-topartition>] <I<partition name on destination>> >>>
+    S<<< [B<-toname> <I<volume name on destination>>] >>>
+    S<<< [B<-toid> <I<volume ID on destination>>] >>> [B<-offline>] [B<-readonly>]
+    [B<-live>] [B<-incremental>] S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>]
+    [B<-localauth>] [B<-verbose>] [B<-encrypt>] [B<-help>]
+
+=for html
+</div>
+
+=head1 DESCRIPTION
+
+The B<vos shadow> command creates a shadow copy of a volume on a
+different partition or server.
+
+A shadow volume is a copy of a volume that does not normally appear in
+the volume location database (VLDB). It is a primitive operation that
+is meant to be used in backup or disaster recovery situations.
+
+=head1 CAUTIONS
+
+This command is not used during normal OpenAFS administration and may
+have adverse effects on the VLDB if not used properly! This command
+should only be used by an expert.
+
+Using this command on a volume when the source volume is not the same
+as parent volume used to create the shadow will leave the destination
+volume in a unknown state.
+
+Do NOT run the B<vos syncserv> or B<vos syncvldb> on any fileserver
+containing shadow volumes. This would update the VLDB to show all
+shadowed Read/Write volumes instead of the source volumes from which
+they were copied.
+
+Currently, the maximum size of a volume is 2 terabytes (2^31 bytes).
+
+=head1 OPTIONS
+
+=over 4
+
+=item [B<-id>] <I<volume name or ID>>
+
+Specifies either the complete name or volume ID number of a read/write
+volume.
+
+=item [B<-fromserver>] <I<machine name for source>>
+
+Identifies the file server machine where the source volume resides. Provide
+the machine's IP address or its host name (either fully qualified or using
+an unambiguous abbreviation). For details, see L<vos(1)>.
+
+=item [B<-frompartition>] <I<partition name for source>>
+
+Names the partition where the source volume resides. Provide the full
+partition name (for, example, B</vicepa>) or one of the abbreviated forms
+described in L<vos(1)>.
+
+=item [B<-toserver>] <I<machine name for destination>>
+
+Identifies the file server machine to which to copy the volume.  Provide
+the machine's IP address or its host name (either fully qualified or using
+an unambiguous abbreviation). For details, see L<vos(1)>.
+
+=item [B<-topartition>] <I<partition name for destination>>
+
+Names the partition to which to copy the volume. Provide the full partition
+name (for, example, B</vicepa>) or one of the abbreviated forms described in
+L<vos(1)>.
+
+=item B<-toname> <I<volume name for new copy>>
+
+The complete name of the new volume to create.
+
+=item B<-offline>
+
+Leaves the new volume flagged as off-line in the volume database.
+
+=item B<-readonly>
+
+Flags the new volume as read-only in the volume database.
+
+=item B<-live>
+
+Copies the live volume without cloning.  This is normally not necessary and
+causes the volume to be kept locked for longer than the normal copy
+mechanism.
+
+=item B<-incremental>
+
+Copy the changes from the source volume to a previously created shadow
+volume.
+
+=item B<-cell> <I<cell name>>
+
+Names the cell in which to run the command. Do not combine this argument
+with the B<-localauth> flag. For more details, see L<vos(1)>.
+
+=item B<-noauth>
+
+Assigns the unprivileged identity C<anonymous> to the issuer. Do not
+combine this flag with the B<-localauth> flag. For more details, see
+L<vos(1)>.
+
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. The B<vos> command interpreter presents
+it to the Volume Server and Volume Location Server during mutual
+authentication. Do not combine this flag with the B<-cell> argument or
+B<-noauth> flag. For more details, see L<vos(1)>.
+
+=item B<-verbose>
+
+Produces on the standard output stream a detailed trace of the command's
+execution. If this argument is omitted, only warnings and error messages
+appear.
+
+=item B<-encrypt>
+
+Encrypts the command so that the operation's results are not transmitted
+across the network in clear text.
+
+=item B<-help>
+
+Prints the online help for this command. All other valid options are
+ignored.
+
+=back
+
+=head1 OUTPUT
+
+This command has no output unless C<-verbose> is specified or there is
+an error.
+
+=head1 PRIVILEGE REQUIRED
+
+The issuer must be listed in the F</usr/afs/etc/UserList> file on the
+machines specified with the B<-toserver> and B<-fromserver> arguments and
+on each database server machine.  If the B<-localauth> flag is included,
+the issuer must instead be logged on to a server machine as the local
+superuser C<root>.
+
+=head1 SEE ALSO
+
+L<vos(1)>,
+L<vos_backup(1)>,
+L<vos_copy(1)>,
+L<vos_move(1)>
+
+L<http://www.openafs.org/pipermail/openafs-info/2005-July/018469.html>
+discusses motivation for the creation of this command.
+
+L<http://workshop.openafs.org/afsbpw06/talks/drh.scs.html> discusses
+one possible use for it.
+
+=head1 COPYRIGHT
+
+Copyright 2008 Jason Edgecombe <jason@rampaginggeek.com>
+
+This documentation is covered by the BSD License as written in the
+doc/LICENSE file. This man page was written by Jason Edgecombe for
+OpenAFS.
index 55897d12cf3d940d45300f9cc81ee5ed28eb1fa8..f308329d73e17185c0bdf866709fa101892339f1 100644 (file)
@@ -11,7 +11,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/DARWIN/osi_misc.c,v 1.6.2.2 2005/10/05 05:58:29 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/DARWIN/osi_misc.c,v 1.6.2.3 2008/03/24 17:10:40 shadow Exp $");
 
 #include "afs/sysincludes.h"
 #include "afsincludes.h"
@@ -102,10 +102,15 @@ uio_t afsio_darwin_partialcopy(uio_t auio, int size) {
    user_addr_t iovaddr;
    user_size_t iovsize;
 
-   /* XXX 64 bit userspaace? */
-   res = uio_create(uio_iovcnt(auio), uio_offset(auio),
-                    uio_isuserspace(auio) ? UIO_USERSPACE32 : UIO_SYSSPACE32,
-                    uio_rw(auio));
+   if (proc_is64bit(current_proc())) {
+       res = uio_create(uio_iovcnt(auio), uio_offset(auio),
+                       uio_isuserspace(auio) ? UIO_USERSPACE64 : UIO_SYSSPACE32,
+                       uio_rw(auio));
+   } else {
+       res = uio_create(uio_iovcnt(auio), uio_offset(auio),
+                       uio_isuserspace(auio) ? UIO_USERSPACE32 : UIO_SYSSPACE32,
+                       uio_rw(auio));
+   }
 
    for (i = 0;i < uio_iovcnt(auio) && size > 0;i++) {
        if (uio_getiov(auio, i, &iovaddr, &iovsize))
index 4162eac3bb67f7a6e115d9d037af2b2ea1013a06..26891713079bcffff5d12fb0dac0be6ef405a58e 100644 (file)
@@ -11,7 +11,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/LINUX/osi_file.c,v 1.19.2.15 2008/03/23 00:54:01 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/LINUX/osi_file.c,v 1.19.2.16 2008/03/26 04:10:52 shadow Exp $");
 
 #ifdef AFS_LINUX24_ENV
 #include "h/module.h" /* early to avoid printf->printk mapping */
@@ -64,6 +64,10 @@ osi_UFSOpen(afs_int32 ainode)
     memset(afile, 0, sizeof(struct osi_file));
 #if defined(HAVE_IGET)
     tip = iget(afs_cacheSBp, (u_long) ainode);
+    if (!tip)
+       osi_Panic("Can't get inode %d\n", ainode);
+
+    dp = d_alloc_anon(tip);
 #else
     fid.i32.ino = ainode;
     fid.i32.gen = 0;
index 7c5400e9300d70e8fe86cb4c24a5ae890efefe3f..e1a0aaa1f0f7e2201706fc98f033941fbd5f2c2c 100644 (file)
@@ -45,6 +45,7 @@
 
 /* Code to find the Linux syscall table */
 
+#if defined(EXPORTED_INIT_MM)
 #ifdef OSI_PROBE_STANDALONE
 #define OSI_PROBE_DEBUG
 #endif
@@ -1481,3 +1482,9 @@ module_init(osi_probe_init);
 module_exit(osi_probe_exit);
 #endif
 #endif
+#else
+void *osi_find_syscall_table(int which)
+{
+    return 0;
+}
+#endif /* EXPORTED_INIT_MM */
index 4bf1511dc3a60f6c004fa54cd043b806de027dec..f8d576b77f93877e43aea7fdeddaabc94a7e70c4 100644 (file)
@@ -22,7 +22,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.60 2007/11/27 19:32:43 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.63 2008/04/02 18:27:13 shadow Exp $");
 
 #include "afs/sysincludes.h"
 #include "afsincludes.h"
@@ -564,18 +564,26 @@ afs_linux_flush(struct file *fp)
 #endif
 {
     struct vrequest treq;
-    struct vcache *vcp = VTOAFS(FILE_INODE(fp));
-    cred_t *credp = crref();
+    struct vcache *vcp;
+    cred_t *credp;
     int code;
 
     AFS_GLOCK();
 
+    if ((fp->f_flags & O_ACCMODE) == O_RDONLY) { /* readers dont flush */
+       AFS_GUNLOCK();
+       return 0;
+    }
+
+    credp = crref();
+    vcp = VTOAFS(FILE_INODE(fp));
+
     code = afs_InitReq(&treq, credp);
     if (code)
        goto out;
 
     ObtainSharedLock(&vcp->lock, 535);
-    if (vcp->execsOrWriters > 0) {
+    if ((vcp->execsOrWriters > 0) && (file_count(fp) == 1)) {
        UpgradeSToWLock(&vcp->lock, 536);
        code = afs_StoreAllSegments(vcp, &treq, AFS_SYNC | AFS_LASTSTORE);
        ConvertWToSLock(&vcp->lock);
index cbd3f5859ccc25ec08ef8291b58b9acc4940fb5b..8f1a52454839697b040fb217d67198b236391b0b 100644 (file)
@@ -11,7 +11,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.81.2.31 2008/03/17 16:53:36 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.81.2.32 2008/03/22 04:17:33 jaltman Exp $");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #ifdef AFS_OBSD_ENV
@@ -3858,6 +3858,7 @@ DECL_PIOCTL(PNewUuid)
     afs_uuid_create(&afs_cb_interface.uuid);
     ReleaseWriteLock(&afs_xinterface);
     ForceAllNewConnections();
+    return 0;
 }
 
 DECL_PIOCTL(PCallBackAddr)
index 75201dd499ec6ede84748890a4176b2f10251f44..3e58f6a6ed5f39c1b76bebc70bce6dd47710b063 100644 (file)
@@ -1,19 +1,17 @@
 /* 
- * $Id: aklog.c,v 1.1.2.5 2005/07/15 16:11:24 rra Exp $
+ * $Id: aklog.c,v 1.1.2.6 2008/04/01 17:44:52 shadow Exp $
  *
  * Copyright 1990,1991 by the Massachusetts Institute of Technology
  * For distribution and copying rights, see the file "mit-copyright.h"
  */
 
 #if !defined(lint) && !defined(SABER)
-static char *rcsid = "$Id: aklog.c,v 1.1.2.5 2005/07/15 16:11:24 rra Exp $";
+static char *rcsid = "$Id: aklog.c,v 1.1.2.6 2008/04/01 17:44:52 shadow Exp $";
 #endif /* lint || SABER */
 
 #include <afs/stds.h>
 #include "aklog.h"
 
-#ifndef WINDOWS
-
 int
 main(int argc, char *argv[])
 {
@@ -21,87 +19,3 @@ main(int argc, char *argv[])
     exit(0);
 }
 
-#else /* WINDOWS */
-
-#include <windows.h>
-#include <windowsx.h>
-
-static void parse_cmdline();
-
-
-int PASCAL
-WinMain(HINSTANCE hinst, HINSTANCE hprevinstance, LPSTR cmdline, int noshow)
-{
-       int argc = 0;
-       char **argv;
-
-    aklog_params params;
-
-       parse_cmdline(cmdline, &argv, &argc);
-
-    aklog(argc, argv, &params);
-
-       return 0;
-}
-
-/*
- * Generate agrv/argc here from command line.
- * Note that windows doesn't pass us the executible name, so
- * we need to fill that in manually.
- */
-
-static void
-parse_cmdline(char *cmdline, char ***pargv, int *pargc)
-{
-       char **argv;
-       int argc = 0;
-       char *arg, *sep = " \t";
-       int argv_size = 10;             /* to start with */
-
-
-       argv = malloc(argv_size * sizeof(char *));
-
-       if (!argv) {
-               MessageBox(NULL, "Fatal Error: Out of memory", AKLOG_DIALOG_NAME, 
-                                  MB_OK | MB_ICONSTOP);
-               exit(1);
-       }
-
-       argv[argc++] = "aklog";
-
-       arg = strtok(cmdline, sep);
-
-       while(arg) {
-               argv[argc] = strdup(arg);
-
-               if (!argv[argc]) {
-                       MessageBox(NULL, "Fatal Error: Out of memory", AKLOG_DIALOG_NAME, 
-                                          MB_OK | MB_ICONSTOP);
-                       exit(1);
-               }
-
-               argc++;
-
-               if (argc == argv_size) {
-                       argv_size += 10;
-                       argv = realloc(argv, argv_size * sizeof(char *));
-
-                       if (!argv) {
-                               MessageBox(NULL, "Fatal Error: Out of memory",
-                                                  AKLOG_DIALOG_NAME, 
-                                                  MB_OK | MB_ICONSTOP);
-                               exit(1);
-                       }
-               }
-
-               arg = strtok(NULL, sep);
-       }
-
-       argv[argc] = NULL;
-
-       *pargv = argv;
-       *pargc = argc;
-}
-
-#endif /* WINDOWS */
-
index 48904baf21de48e4f0ef88d4628ad0d2d429028a..e46c9b8b0be7e10c8a45330918a83e3b11f543d0 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: aklog.h,v 1.1.2.6 2007/07/11 04:32:27 shadow Exp $
+ * $Id: aklog.h,v 1.1.2.7 2008/04/01 17:44:52 shadow Exp $
  *
  * Copyright 1990,1991 by the Massachusetts Institute of Technology
  * For distribution and copying rights, see the file "mit-copyright.h"
@@ -8,10 +8,6 @@
 #ifndef __AKLOG_H__
 #define __AKLOG_H__
 
-#if !defined(lint) && !defined(SABER)
-static char *rcsid_aklog_h = "$Id: aklog.h,v 1.1.2.6 2007/07/11 04:32:27 shadow Exp $";
-#endif /* lint || SABER */
-
 #include <krb5.h>
 #include "linked_list.h"
 #include <afsconfig.h>
index 7776d698b8b0dd5b89e77d454aae967a1381a254..ed8503f3ff22538c44aebda5ef2d6b4e611c7b5d 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: aklog_main.c,v 1.1.2.23 2008/01/05 04:48:40 shadow Exp $
+ * $Id: aklog_main.c,v 1.1.2.26 2008/04/01 18:15:53 shadow Exp $
  *
  * Copyright 1990,1991 by the Massachusetts Institute of Technology
  * For distribution and copying rights, see the file "mit-copyright.h"
  * such damages.                                                
  */
 
-#if !defined(lint) && !defined(SABER)
-static char *rcsid =
-       "$Id: aklog_main.c,v 1.1.2.23 2008/01/05 04:48:40 shadow Exp $";
-#endif /* lint || SABER */
-
 #include <afsconfig.h>
+RCSID
+     ("$Header: /cvs/openafs/src/aklog/aklog_main.c,v 1.1.2.26 2008/04/01 18:15:53 shadow Exp $");
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
@@ -58,7 +55,6 @@ static char *rcsid =
 #include <sys/stat.h>
 #include <fcntl.h>
 
-#ifndef WINDOWS
 #include <sys/param.h>
 #include <sys/errno.h>
 #include <netdb.h>
@@ -66,18 +62,10 @@ static char *rcsid =
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <pwd.h>
-#endif /* WINDOWS */
 
 #include <afs/stds.h>
 #include <krb5.h>
 
-#ifdef WINDOWS
-
-#include <afs/auth.h>
-#include <rx/rxkad.h>
-#include <afs/dirpath.h>
-
-#else /* !WINDOWS */
 #ifndef HAVE_KERBEROSV_HEIM_ERR_H
 #include <afs/com_err.h>
 #endif
@@ -93,7 +81,6 @@ static char *rcsid =
 #include <afs/ptserver.h>
 #include <afs/ptuser.h>
 #include <afs/dirpath.h>
-#endif /* WINDOWS */
 
 #include "aklog.h"
 #include "linked_list.h"
@@ -112,6 +99,7 @@ static char *rcsid =
 #define AFS_TRY_FULL_PRINC 1
 #endif /* AFS_TRY_FULL_PRINC */
 
+#define AKLOG_TRYAGAIN -1
 #define AKLOG_SUCCESS 0
 #define AKLOG_USAGE 1
 #define AKLOG_SOMETHINGSWRONG 2
@@ -153,16 +141,6 @@ static char linkedcell[MAXCELLCHARS+1];
 static char linkedcell2[MAXCELLCHARS+1];
 static krb5_ccache  _krb425_ccache = NULL;
 
-#ifdef WINDOWS
-
-/* libafsconf.dll */
-extern long cm_GetRootCellName();
-extern long cm_SearchCellFile();
-
-static long cm_SearchCellFile_CallBack();
-
-#else /* !WINDOWS */
-
 /*
  * Why doesn't AFS provide these prototypes?
  */
@@ -179,6 +157,10 @@ static krb5_error_code get_credv5(krb5_context context, char *, char *,
                                  char *, krb5_creds **);
 static int get_user_realm(krb5_context, char *);
 
+#define TRYAGAIN(x) (x == AKLOG_TRYAGAIN || \
+                    x == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || \
+                    x == KRB5KRB_ERR_GENERIC)
+
 #if defined(HAVE_KRB5_PRINC_SIZE) || defined(krb5_princ_size)
 
 #define get_princ_str(c, p, n) krb5_princ_component(c, p, n)->data
@@ -300,7 +282,6 @@ Done:
 
 #define deref_entry_enctype(entry)                     \
     deref_keyblock_enctype(&deref_entry_keyblock(entry))
-#endif /* WINDOWS */
 
 /*
  * Provide a replacement for strerror if we don't have it
@@ -343,6 +324,17 @@ static char *copy_cellinfo(cellinfo_t *cellinfo)
 }
 
 
+static char *copy_string(char *string)    
+{
+    char *new_string;
+
+    if ((new_string = (char *)calloc(strlen(string) + 1, sizeof(char))))
+       (void) strcpy(new_string, string);
+
+    return (new_string);
+}
+
+
 static int get_cellconfig(char *cell, struct afsconf_cell *cellconfig, char *local_cell, char *linkedcell)
 {
     int status = AKLOG_SUCCESS;
@@ -351,8 +343,6 @@ static int get_cellconfig(char *cell, struct afsconf_cell *cellconfig, char *loc
     memset(local_cell, 0, sizeof(local_cell));
     memset((char *)cellconfig, 0, sizeof(*cellconfig));
 
-#ifndef WINDOWS
-
     if (!(configdir = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH))) {
        fprintf(stderr, 
                "%s: can't get afs configuration (afsconf_Open(%s))\n",
@@ -379,101 +369,9 @@ static int get_cellconfig(char *cell, struct afsconf_cell *cellconfig, char *loc
 
     (void) afsconf_Close(configdir);
 
-#else /* WINDOWS */
-    /*
-     * We'll try to mimic the GetCellInfo call here and fill in as much
-     * of the afsconf_cell structure as we can.
-     */
-    if (cm_GetRootCellName(local_cell)) {
-       fprintf(stderr, "%s: can't get local cellname\n", progname);
-       exit(AKLOG_AFS);
-    }
-
-    if ((cell == NULL) || (cell[0] == 0))
-       cell = local_cell;
-
-    strcpy(cellconfig->name, cell);
-
-    /* No way of figuring this out as far as I can tell */
-    linkedcell[0] = '\0';
-
-    /* Initialize server info */
-    cellconfig->numServers = 0;
-    cellconfig->hostName[0][0] = "\0";
-
-    /*
-     * Get servers of cell. cm_SearchCellFile_CallBack() gets call with
-     * each server.
-     */
-    status = (int) cm_SearchCellFile(cell, NULL, &cm_SearchCellFile_CallBack,
-                                    cellconfig /* rock */);
-
-    switch(status) {
-    case 0:
-       break;
-
-    case -1:
-       fprintf(stderr, "%s: GetWindowsDirectory() failed.\n", progname);
-       break;
-
-    case -2:
-       fprintf(stderr, "%s: Couldn't open afsdcells.ini for reading\n",
-               progname);
-       break;
-
-    case -3:
-       fprintf(stderr, "%s: Couldn't find any servers for cell %s\n",
-               progname, cell);
-       break;
-
-    case -4:
-       fprintf(stderr, "%s: Badly formatted line in afsdcells.ini (does not begin with a \">\" or contain \"#\"\n",
-               progname);
-       break;
-
-    default:
-       fprintf(stderr, "%s cm_SearchCellFile returned unknown error %d\n",
-               status);
-    }
-
-    if (status) {
-       exit(AKLOG_AFS);
-    }
-
-    status = AKLOG_SUCCESS;
-
-    
-#endif /* WINDOWS */
-
     return(status);
 }
 
-
-#ifdef WINDOWS
-/*
- * Callback function for cm_SearchCellFile() in get_cellconfig() above.
- * This function gets called once for each server that is found for the cell.
- */
-static long
-cm_SearchCellFile_CallBack(void *rock /* cellconfig */,
-                          struct sockaddr_in *addr, /* Not used */
-                          char *server)
-{
-    struct afsconf_cell *cellconfig = rock;
-
-
-    /*
-     * Save server name and increment count of servers
-     */
-    strcpy(cellconfig->hostName[cellconfig->numServers++], server);
-    
-    return (long) 0;
-}
-
-    
-#endif /* WINDOWS */
-
-
 /* 
  * Log to a cell.  If the cell has already been logged to, return without
  * doing anything.  Otherwise, log to it and mark that it has been logged
@@ -485,39 +383,26 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm)
     char username[BUFSIZ];     /* To hold client username structure */
     afs_int32 viceId;          /* AFS uid of user */
 
-    char name[ANAME_SZ];       /* Name of afs key */
-    char primary_instance[INST_SZ];    /* Instance of afs key */
-    char secondary_instance[INST_SZ];  /* Backup instance to try */
-    int try_secondary = 0;             /* Flag to indicate if we try second */
     char realm_of_user[REALM_SZ]; /* Kerberos realm of user */
-    char realm_of_cell[REALM_SZ]; /* Kerberos realm of cell */
+    char *realm_from_princ = 0 ;  /* Calculated realm data */
+    char *realm_of_cell = 0;     /* Pointer to realm we're using */    
+    int retry;                   /* round, and round we go ... */
+    
     char local_cell[MAXCELLCHARS+1];
     char cell_to_use[MAXCELLCHARS+1]; /* Cell to authenticate to */
     static char lastcell[MAXCELLCHARS+1] = { 0 };
-#ifndef WINDOWS
     static char confname[512] = { 0 };
-#endif
     krb5_creds *v5cred = NULL;
     struct ktc_principal aserver;
     struct ktc_principal aclient;
     struct ktc_token atoken, btoken;
 
-#ifdef ALLOW_REGISTER
-    afs_int32 id;
-#endif /* ALLOW_REGISTER */
-
-    memset(name, 0, sizeof(name));
-    memset(primary_instance, 0, sizeof(primary_instance));
-    memset(secondary_instance, 0, sizeof(secondary_instance));
     memset(realm_of_user, 0, sizeof(realm_of_user));
-    memset(realm_of_cell, 0, sizeof(realm_of_cell));
 
-#ifndef WINDOWS
     if (confname[0] == '\0') {
        strncpy(confname, AFSDIR_CLIENT_ETC_DIRPATH, sizeof(confname));
        confname[sizeof(confname) - 2] = '\0';
     }
-#endif /* WINDOWS */
 
     /* NULL or empty cell returns information on local cell */
     if ((status = get_cellconfig(cell, &ak_cellconfig,
@@ -568,100 +453,128 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm)
                   cell_to_use, ak_cellconfig.hostName[0]);
        }
 
-       /*
-        * Find out which realm we're supposed to authenticate to.  If one
-        * is not included, use the kerberos realm found in the credentials
-        * cache.
-        */
-
-       if (realm && realm[0]) {
-           strcpy(realm_of_cell, realm);
-           if (dflag) {
-               printf("We were told to authenticate to realm %s.\n", realm);
-           }
+       if ((status = get_user_realm(context, realm_of_user))) {
+           fprintf(stderr, "%s: Couldn't determine realm of user:)",
+                   progname);
+           afs_com_err(progname, status, " while getting realm");
+           return(AKLOG_KERBEROS);
        }
-       else {
-           char *afs_realm = afs_realm_of_cell(context, &ak_cellconfig, FALSE);
 
-           if (!afs_realm) {
-               fprintf(stderr, 
-                       "%s: Couldn't figure out realm for cell %s.\n",
-                       progname, cell_to_use);
-               exit(AKLOG_MISC);
+       retry = 1;
+       
+       while(retry) {
+           
+           /* Cell on command line - use that one */
+           if (realm && realm[0]) {
+               realm_of_cell = realm;
+               status = AKLOG_TRYAGAIN;
+               if (dflag) {
+                   printf("We were told to authenticate to realm %s.\n", 
+                          realm);
+               }
+           } else {
+               /* Initially, try using afs/cell@USERREALM */
+               if (dflag) {
+                   printf("Trying to authenticate to user's realm %s.\n",
+                          realm_of_user);
+               }
+               
+               realm_of_cell = realm_of_user;
+               status = get_credv5(context, AFSKEY, cell_to_use, 
+                                   realm_of_cell, &v5cred);
+           
+               /* If that failed, try to determine the realm from the name of 
+                * one of the DB servers */
+               if (TRYAGAIN(status)) {
+                   realm_of_cell = afs_realm_of_cell(context, &ak_cellconfig, 
+                                                     FALSE);
+                   if (!realm_of_cell) {
+                       fprintf(stderr, 
+                               "%s: Couldn't figure out realm for cell %s.\n",
+                               progname, cell_to_use);
+                       exit(AKLOG_MISC);
+                   }
+
+                   if (dflag) {
+                       if (realm_of_cell[0])
+                           printf("We've deduced that we need to authenticate"
+                                  " to realm %s.\n", realm_of_cell);
+                   else
+                       printf("We've deduced that we need to authenticate "
+                              "using referrals.\n");
+                   }
+               }
            }
-
-           strcpy(realm_of_cell, afs_realm);
-
-           if (dflag) {
-               if (realm_of_cell[0])
-                   printf("We've deduced that we need to authenticate to"
-                          " realm %s.\n", realm_of_cell);
-               else
-                   printf("We've deduced that we need to authenticate "
-                          "using referrals.\n");
+       
+           if (TRYAGAIN(status)) {
+               /* If we've got the full-princ-first option, or we're in a
+                * different realm from the cell - use the cell name as the
+                * instance */
+               if (AFS_TRY_FULL_PRINC || 
+                   strcasecmp(cell_to_use, realm_of_cell)!=0) {
+                   status = get_credv5(context, AFSKEY, cell_to_use, 
+                                       realm_of_cell, &v5cred);
+
+                   /* If we failed & we've got an empty realm, then try 
+                    * calling afs_realm_for_cell again. */
+                   if (TRYAGAIN(status) && !realm_of_cell[0]) {
+                       /* This time, get the realm by taking the domain 
+                        * component of the db server and make it upper case */
+                       realm_of_cell = afs_realm_of_cell(context, 
+                                                         &ak_cellconfig, TRUE);
+                       if (!realm_of_cell) {
+                           fprintf(stderr,
+                                   "%s: Couldn't figure out realm for cell "
+                                   "%s.\n", progname, cell_to_use);
+                           exit(AKLOG_MISC);
+                       }
+                       printf("We've deduced that we need to authenticate to"
+                              " realm %s.\n", realm_of_cell);
+                   }
+                   status = get_credv5(context, AFSKEY, cell_to_use, 
+                                       realm_of_cell, &v5cred);
+               }
+          
+               /* If the realm and cell name match, then try without an 
+                * instance, but only if realm is non-empty */
+               
+               if (TRYAGAIN(status) && 
+                   strcasecmp(cell_to_use, realm_of_cell) == 0) {
+                   status = get_credv5(context, AFSKEY, NULL, 
+                                       realm_of_cell, &v5cred);
+                   if (!AFS_TRY_FULL_PRINC && TRYAGAIN(status)) {
+                       status = get_credv5(context, AFSKEY, cell_to_use,
+                                           realm_of_cell, &v5cred);
+                   }
+               }
            }
-       }
-
-       /* We use the afs.<cellname> convention here... 
-        *
-        * Doug Engert's original code had principals of the form:
-        *
-        * "afsx/cell@realm"
-        *
-        * in the KDC, so the name wouldn't conflict with DFS.  Since we're
-        * not using DFS, I changed it just to look for the following
-        * principals:
-        *
-        * afs/<cell>@<realm>
-        * afs@<realm>
-        *
-        * Because people are transitioning from afs@realm to afs/cell,
-        * we configure things so that if the first one isn't found, we
-        * try the second one.  You can select which one you prefer with
-        * a configure option.
-        */
 
-       strcpy(name, AFSKEY);
+           /* Try to find a service principal for this cell.
+            * Some broken MIT libraries return KRB5KRB_AP_ERR_MSG_TYPE upon 
+            * the first attempt, so we try twice to be sure */
 
-       if (AFS_TRY_FULL_PRINC || strcasecmp(cell_to_use, realm_of_cell) != 0) {
-           strncpy(primary_instance, cell_to_use, sizeof(primary_instance));
-           primary_instance[sizeof(primary_instance)-1] = '\0';
-           if (strcasecmp(cell_to_use, realm_of_cell) == 0) {
-               try_secondary = 1;
-               secondary_instance[0] = '\0';
+           if (status == KRB5KRB_AP_ERR_MSG_TYPE && retry == 1)
+               retry++;
+           else
+               retry = 0;
+       } 
+       
+       if (status != 0) {
+           if (dflag) {
+               printf("Kerberos error code returned by get_cred : %d\n",
+                      status);
            }
-       } else {
-           primary_instance[0] = '\0';
-           try_secondary = 1;
-           strncpy(secondary_instance, cell_to_use,
-                   sizeof(secondary_instance));
-           secondary_instance[sizeof(secondary_instance)-1] = '\0';
+           fprintf(stderr, "%s: Couldn't get %s AFS tickets:\n",
+                   progname, cell_to_use);
+           afs_com_err(progname, status, "while getting AFS tickets");
+           return(AKLOG_KERBEROS);
        }
-
-       /* 
-        * Extract the session key from the ticket file and hand-frob an
-        * afs style authenticator.
-        */
-
-       /*
-        * Try to obtain AFS tickets.  Because there are two valid service
-        * names, we will try both, but trying the more specific first.
-        *
-        *      afs/<cell>@<realm> i.e. allow for single name with "."
-        *      afs@<realm>
+       
+       /* If we've got a valid ticket, and we still don't know the realm name
+        * try to figure it out from the contents of the ticket
         */
-
-       if (dflag) {
-           printf("Getting tickets: %s%s%s@%s\n", name,
-                  primary_instance[0] ? "/" : "", 
-                  primary_instance, realm_of_cell);
-       }
-
-       status = get_credv5(context, name, primary_instance, realm_of_cell,
-                           &v5cred);
-
 #if !defined(USING_HEIMDAL) && defined(HAVE_KRB5_DECODE_TICKET)
-       if (status == 0 && strcmp(realm_of_cell, "") == 0) {
+       if (strcmp(realm_of_cell, "") == 0) {
            krb5_error_code code;
            krb5_ticket *ticket;
 
@@ -671,76 +584,25 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm)
                fprintf(stderr,
                        "%s: Couldn't decode ticket to determine realm for "
                        "cell %s.\n",
-                       progname, cell_to_use);
+                       progname, cell_to_use);
            } else {
                int len = realm_len(context, ticket->server);
                /* This really shouldn't happen. */
                if (len > REALM_SZ-1)
                    len = REALM_SZ-1;
 
-               strncpy(realm_of_cell, realm_data(context, ticket->server), 
+               realm_from_princ = (char *) malloc(sizeof(char) * (len+1));
+               
+               strncpy(realm_from_princ, realm_data(context, ticket->server), 
                        len);
-               realm_of_cell[len] = 0;
-
+               realm_from_princ[len] = 0;
+               realm_of_cell = realm_from_princ;
+               
                krb5_free_ticket(context, ticket);
            }
        }
 #endif
 
-       if ((status == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || status == KRB5KRB_ERR_GENERIC) &&
-           !realm_of_cell[0]) {
-           char *afs_realm = afs_realm_of_cell(context, &ak_cellconfig, TRUE);
-
-           if (!afs_realm) {
-               fprintf(stderr, 
-                       "%s: Couldn't figure out realm for cell %s.\n",
-                       progname, cell_to_use);
-               exit(AKLOG_MISC);
-           }
-
-           strcpy(realm_of_cell, afs_realm);
-
-           if (strcasecmp(cell_to_use, realm_of_cell) == 0) {
-               try_secondary = 1;
-               secondary_instance[0] = '\0';
-           }
-
-           if (dflag) {
-               printf("We've deduced that we need to authenticate to"
-                       " realm %s.\n", realm_of_cell);
-               printf("Getting tickets: %s%s%s@%s\n", name,
-                       primary_instance[0] ? "/" : "", 
-                       primary_instance, realm_of_cell);
-           }
-
-           status = get_credv5(context, name, primary_instance, realm_of_cell,
-                                &v5cred);
-
-       }
-       if (status == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || status == KRB5KRB_ERR_GENERIC) {
-           if (try_secondary) {
-               if (dflag) {
-                   printf("Principal not found, trying alternate "
-                          "service name: %s%s%s@%s\n", name,
-                           secondary_instance[0] ? "/" : "",
-                           secondary_instance, realm_of_cell);
-               }
-               status = get_credv5(context, name, secondary_instance,
-                                   realm_of_cell, &v5cred);
-           }
-       }
-
-       if (status) {
-           if (dflag) {
-               printf("Kerberos error code returned by get_cred: %d\n",
-                       status);
-           }
-           fprintf(stderr, "%s: Couldn't get %s AFS tickets:\n",
-                   progname, cell_to_use);
-               afs_com_err(progname, status, "while getting AFS tickets");
-           return(AKLOG_KERBEROS);
-       }
-
        strncpy(aserver.name, AFSKEY, MAXKTCNAMELEN - 1);
        strncpy(aserver.instance, AFSINST, MAXKTCNAMELEN - 1);
        strncpy(aserver.cell, cell_to_use, MAXKTCREALMLEN - 1);
@@ -836,22 +698,13 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm)
        noprdb = 1;
 #endif
 
-#ifndef WINDOWS
        if (noprdb) {
-#endif
            if (dflag) {
                printf("Not resolving name %s to id (-noprdb set)\n",
                        username);
            }
-#ifndef WINDOWS
        }
        else {
-           if ((status = get_user_realm(context, realm_of_user))) {
-               fprintf(stderr, "%s: Couldn't determine realm of user:)",
-                       progname);
-               afs_com_err(progname, status, " while getting realm");
-               return(AKLOG_KERBEROS);
-           }
            if (strcmp(realm_of_user, realm_of_cell)) {
                strcat(username, "@");
                strcat(username, realm_of_user);
@@ -890,19 +743,13 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm)
                 */
 
 #ifdef ALLOW_REGISTER
-       if (status == 0) {
-           if (viceId != ANONYMOUSID) {
-#else /* ALLOW_REGISTER */
-           if ((status == 0) && (viceId != ANONYMOUSID))
-#endif /* ALLOW_REGISTER */
-               sprintf (username, "AFS ID %d", (int) viceId);
-#ifdef ALLOW_REGISTER
-           } else if (strcmp(realm_of_user, realm_of_cell) != 0) {
+           if ((status == 0) && (viceId == ANONYMOUSID) &&
+               (strcmp(realm_of_user, realm_of_cell) != 0)) {
                if (dflag) {
                    printf("doing first-time registration of %s "
                            "at %s\n", username, cell_to_use);
                }
-               id = 0;
+               viceId = 0;
                strncpy(aclient.name, username, MAXKTCNAMELEN - 1);
                strcpy(aclient.instance, "");
                strncpy(aclient.cell, realm_of_user, MAXKTCREALMLEN - 1);
@@ -923,22 +770,23 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm)
                    printf("Error %d\n", status);
                }
 
-               if ((status = pr_CreateUser(username, &id))) {
+               if ((status = pr_CreateUser(username, &viceId))) {
                    fprintf(stderr, "%s: %s so unable to create remote PTS "
                            "user %s in cell %s (status: %d).\n", progname,
                            afs_error_message(status), username, cell_to_use,
                            status);
+                   viceId = ANONYMOUSID;
                } else {
                    printf("created cross-cell entry for %s (Id %d) at %s\n",
-                          username, id, cell_to_use);
-                   sprintf(username, "AFS ID %d", (int) id);
+                          username, viceId, cell_to_use);
                }
            }
-       }
 #endif /* ALLOW_REGISTER */
 
+           if ((status == 0) && (viceId != ANONYMOUSID)) {
+               sprintf(username, "AFS ID %d", (int) viceId);
+           }
        }
-#endif /* !WINDOWS */
 
        if (dflag) {
            fprintf(stdout, "Set username to %s\n", username);
@@ -964,38 +812,12 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm)
         */
        write(2,"",0); /* dummy write */
 #endif
-#ifndef WINDOWS
        if ((status = ktc_SetToken(&aserver, &atoken, &aclient, afssetpag))) {
            fprintf(stderr, 
                    "%s: unable to obtain tokens for cell %s (status: %d).\n",
                    progname, cell_to_use, status);
            status = AKLOG_TOKEN;
        }
-#else /* WINDOWS */
-       /* Note switched 2nd and 3rd args */
-       if ((status = ktc_SetToken(&aserver, &atoken, &aclient, afssetpag))) {
-           switch(status) {
-           case KTC_INVAL:
-               fprintf(stderr, "%s: Bad ticket length", progname);
-               break;
-           case KTC_PIOCTLFAIL:
-               fprintf(stderr, "%s: Unknown error contacting AFS service",
-                       progname);
-               break;
-           case KTC_NOCELL:
-               fprintf(stderr, "%s: Cell name (%s) not recognized by AFS service",
-                       progname, realm_of_cell);
-               break;
-           case KTC_NOCM:
-               fprintf(stderr, "%s: AFS service is unavailable", progname);
-               break;
-           default:
-               fprintf(stderr, "%s: Undocumented error (%d) contacting AFS service", progname, status);
-               break;  
-           }
-           status = AKLOG_TOKEN;           
-       }
-#endif /* !WINDOWS */
     }
     else
        if (dflag) {
@@ -1005,8 +827,6 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm)
     return(status);
 }
 
-#ifndef WINDOWS /* struct ViceIoctl missing */
-
 static int get_afs_mountpoint(char *file, char *mountpoint, int size)
 {
 #ifdef AFS_SUN_ENV
@@ -1103,8 +923,8 @@ static char *next_path(char *origpath)
            ? elast_comp - last_comp : strlen(last_comp);
        strncat(pathtocheck, last_comp, len);
        memset(linkbuf, 0, sizeof(linkbuf));
-       if (link = (readlink(pathtocheck, linkbuf, 
-                                   sizeof(linkbuf)) > 0)) {
+       if ((link = (readlink(pathtocheck, linkbuf, 
+                                   sizeof(linkbuf)) > 0))) {
            if (++symlinkcount > MAXSYMLINKS) {
                fprintf(stderr, "%s: %s\n", progname, strerror(ELOOP));
                exit(AKLOG_BADPATH);
@@ -1148,8 +968,6 @@ static char *next_path(char *origpath)
     return(pathtocheck);
 }
 
-#endif /* WINDOWS */
-
 #if 0
 /*****************************************/
 int dee_gettokens()
@@ -1180,8 +998,6 @@ int dee_gettokens()
 /*****************************************/
 #endif
 
-#ifndef WINDOWS /* struct ViceIoctl missing */
-
 static void add_hosts(char *file)
 {
 #ifdef AFS_SUN_ENV
@@ -1241,10 +1057,6 @@ static void add_hosts(char *file)
     }
 }
 
-#endif /* WINDOWS */
-
-#ifndef WINDOWS /* next_path(), get_afs_mountpoint() */
-
 /*
  * This routine descends through a path to a directory, logging to 
  * every cell it encounters along the way.
@@ -1332,8 +1144,6 @@ static int auth_to_path(krb5_context context, char *path)
     return(status);
 }
 
-#endif /* WINDOWS */
-
 
 /* Print usage message and exit */
 static void usage(void)
@@ -1410,9 +1220,7 @@ void aklog(int argc, char *argv[])
        progname = argv[0];
 
     krb5_init_context(&context);
-#ifndef WINDOWS
-       initialize_ktc_error_table ();
-#endif
+    initialize_ktc_error_table ();
 
     /* Initialize list of cells to which we have authenticated */
     (void)ll_init(&authedcells);
@@ -1461,32 +1269,20 @@ void aklog(int argc, char *argv[])
                usage();
        else if (((strcmp(argv[i], "-path") == 0) ||
                  (strcmp(argv[i], "-p") == 0)) && !cmode)
-#ifndef WINDOWS
            if (++i < argc) {
                pmode++;
                strcpy(path, argv[i]);
            }
            else
                usage();
-#else /* WINDOWS */
-       {
-           fprintf(stderr, "%s: path mode not supported.\n", progname);
-           exit(AKLOG_MISC);
-       }
-#endif /* WINDOWS */
            
        else if (argv[i][0] == '-')
            usage();
        else if (!pmode && !cmode) {
            if (strchr(argv[i], DIR) || (strcmp(argv[i], ".") == 0) ||
                (strcmp(argv[i], "..") == 0)) {
-#ifndef WINDOWS
                pmode++;
                strcpy(path, argv[i]);
-#else /* WINDOWS */
-               fprintf(stderr, "%s: path mode not supported.\n", progname);
-               exit(AKLOG_MISC);
-#endif /* WINDOWS */
            }
            else { 
                cmode++;
@@ -1527,12 +1323,11 @@ void aklog(int argc, char *argv[])
            memset(cell, 0, sizeof(cell));
            memset(realm, 0, sizeof(realm));
        }
-#ifndef WINDOWS
        else if (pmode) {
            /* Add this path to list of paths */
            if ((cur_node = ll_add_node(&paths, ll_tail))) {
-               char *new_path;
-               if ((new_path = strdup(path)))
+               char *new_path; 
+               if ((new_path = copy_string(path)))
                    ll_add_data(cur_node, new_path);
                else {
                    fprintf(stderr, "%s: failure copying path name.\n",
@@ -1548,7 +1343,6 @@ void aklog(int argc, char *argv[])
            pmode = FALSE;
            memset(path, 0, sizeof(path));
        }
-#endif /* WINDOWS */
     }
 
     /*
@@ -1600,7 +1394,6 @@ void aklog(int argc, char *argv[])
                                status = auth_to_cell(context, linkedcell2, NULL);
                }
 
-#ifndef WINDOWS
                /*
                 * Local hack - if the person has a file in their home
                 * directory called ".xlog", read that for a list of
@@ -1641,7 +1434,6 @@ void aklog(int argc, char *argv[])
                        }
                    }
                }
-#endif /* WINDOWS */
        }
     else {
        /* Log to all cells in the cells list first */
@@ -1663,13 +1455,11 @@ void aklog(int argc, char *argv[])
                }
        }
        
-#ifndef WINDOWS
        /* Then, log to all paths in the paths list */
        for (cur_node = paths.first; cur_node; cur_node = cur_node->next) {
            if ((status = auth_to_path(context, cur_node->data)))
                somethingswrong++;
        }
-#endif /* WINDOWS */
        
        /* 
         * If only one thing was logged to, we'll return the status 
@@ -1764,9 +1554,9 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
     code = krb5_kt_resolve(context, keytab, &kt);
     if (code) {
         if (keytab)
-            com_err(progname, code, "while resolving keytab %s", keytab);
+            afs_com_err(progname, code, "while resolving keytab %s", keytab);
         else
-            com_err(progname, code, "while resolving default keytab");
+            afs_com_err(progname, code, "while resolving default keytab");
         goto cleanup;
     }
 
@@ -1785,7 +1575,7 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
            }
         }
         if (code) {
-           com_err(progname, code,"while scanning keytab entries");
+           afs_com_err(progname, code,"while scanning keytab entries");
            goto cleanup;
         }
     } else {
@@ -1793,7 +1583,7 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
         int best = -1;
         memset(new, 0, sizeof *new);
         if ((code == krb5_kt_start_seq_get(context, kt, cursor))) {
-            com_err(progname, code, "while starting keytab scan");
+            afs_com_err(progname, code, "while starting keytab scan");
             goto cleanup;
         }
         while (!(code = krb5_kt_next_entry(context, kt, new, cursor))) {
@@ -1809,12 +1599,12 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
             } else krb5_free_keytab_entry_contents(context, new);
         }
         if ((i = krb5_kt_end_seq_get(context, kt, cursor))) {
-            com_err(progname, i, "while ending keytab scan");
+            afs_com_err(progname, i, "while ending keytab scan");
             code = i;
             goto cleanup;
         }
         if (best < 0) {
-            com_err(progname, code, "while scanning keytab");
+            afs_com_err(progname, code, "while scanning keytab");
             goto cleanup;
         }
         deref_keyblock_enctype(session_key) = deref_entry_enctype(entry);
@@ -1825,7 +1615,7 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
 #if USING_HEIMDAL
     if ((code = krb5_generate_random_keyblock(context,
                                              deref_keyblock_enctype(session_key), session_key))) {
-        com_err(progname, code, "while making session key");
+        afs_com_err(progname, code, "while making session key");
         goto cleanup;
     }
     enc_tkt_reply->flags.initial = 1;
@@ -1848,7 +1638,7 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
 #else
     if ((code = krb5_c_make_random_key(context,
                                       deref_keyblock_enctype(session_key), session_key))) {
-        com_err(progname, code, "while making session key");
+        afs_com_err(progname, code, "while making session key");
         goto cleanup;
     }
     enc_tkt_reply->magic = KV5M_ENC_TKT_PART;
@@ -1911,12 +1701,12 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
         ASN1_MALLOC_ENCODE(EncTicketPart, buf, buf_size,
                           enc_tkt_reply, &buf_len, code);
         if(code) {
-            com_err(progname, code, "while encoding ticket");
+            afs_com_err(progname, code, "while encoding ticket");
             goto cleanup;
         }
 
         if(buf_len != buf_size) {
-            com_err(progname, code,
+            afs_com_err(progname, code,
                    "%d != %d while encoding ticket (internal ASN.1 encoder error",
                    buf_len, buf_size);
             goto cleanup;
@@ -1934,7 +1724,7 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
         if (buf) free(buf);
         if (crypto) krb5_crypto_destroy(context, crypto);
         if(code) {
-            com_err(progname, code, "while %s", what);
+            afs_com_err(progname, code, "while %s", what);
             goto cleanup;
         }
     } /* crypto block */
@@ -1946,7 +1736,7 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
     ticket_reply->server = service_principal;
     ticket_reply->enc_part2 = enc_tkt_reply;
     if ((code = krb5_encrypt_tkt_part(context, &deref_entry_keyblock(entry), ticket_reply))) {
-        com_err(progname, code, "while making ticket");
+        afs_com_err(progname, code, "while making ticket");
         goto cleanup;
     }
     ticket_reply->enc_part.kvno = entry->vno;
@@ -1956,17 +1746,17 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
 
     if ((code = krb5_copy_principal(context, service_principal,
                                    &creds->server))) {
-        com_err(progname, code, "while copying service principal");
+        afs_com_err(progname, code, "while copying service principal");
         goto cleanup;
     }
     if ((code = krb5_copy_principal(context, client_principal,
                                    &creds->client))) {
-        com_err(progname, code, "while copying client principal");
+        afs_com_err(progname, code, "while copying client principal");
         goto cleanup;
     }
     if ((code = krb5_copy_keyblock_contents(context, session_key,
                                            &deref_session_key(creds)))) {
-        com_err(progname, code, "while copying session key");
+        afs_com_err(progname, code, "while copying session key");
         goto cleanup;
     }
 
@@ -1984,7 +1774,7 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
         ;
     else if ((code = krb5_copy_addresses(context,
                                         deref_enc_tkt_addrs(enc_tkt_reply), &creds->addresses))) {
-        com_err(progname, code, "while copying addresses");
+        afs_com_err(progname, code, "while copying addresses");
         goto cleanup;
     }
 
@@ -1994,13 +1784,13 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
        ASN1_MALLOC_ENCODE(Ticket, creds->ticket.data, creds->ticket.length,
                           ticket_reply, &creds_tkt_len, code);
        if(code) {
-           com_err(progname, code, "while encoding ticket");
+           afs_com_err(progname, code, "while encoding ticket");
            goto cleanup;
        }
     }
 #else
     if ((code = encode_krb5_ticket(ticket_reply, &temp))) {
-       com_err(progname, code, "while encoding ticket");
+       afs_com_err(progname, code, "while encoding ticket");
        goto cleanup;
     }
     creds->ticket = *temp;
@@ -2038,6 +1828,11 @@ static krb5_error_code get_credv5(krb5_context context,
     krb5_creds increds;
     krb5_error_code r;
     static krb5_principal client_principal = 0;
+
+    if (dflag) {
+       printf("Getting tickets: %s%s%s@%s\n", name, (inst && inst[0])
+              ? "/" : "", inst ? inst : "", realm);
+    }
     
     memset((char *)&increds, 0, sizeof(increds));
 /* ANL - instance may be ptr to a null string. Pass null then */
index c12355f554694b3898e4671cf6d0e2e691dd1c5e..47e96f7d6eb581a3226427a61727d6754a80ea90 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: asetkey.c,v 1.4.2.9 2008/03/18 16:11:50 shadow Exp $
+ * $Id: asetkey.c,v 1.4.2.10 2008/04/01 17:44:52 shadow Exp $
  *
  * asetkey - Manipulates an AFS KeyFile
  *
@@ -110,7 +110,7 @@ main(int argc, char *argv[])
 
        code = afsconf_AddKey(tdir, kvno, (char *) deref_key_contents(key), 1);
        if (code) {
-           fprintf(stderr, "%s: failed to set key, code %d.\n", argv[0], code);
+           fprintf(stderr, "%s: failed to set key, code %ld.\n", argv[0], code);
            exit(1);
        }
        krb5_free_principal(context, principal);
@@ -126,7 +126,7 @@ main(int argc, char *argv[])
        kvno = atoi(argv[2]);
        code = afsconf_DeleteKey(tdir, kvno);
        if (code) {
-           fprintf(stderr, "%s: failed to delete key %d, (code %d)\n",
+           fprintf(stderr, "%s: failed to delete key %ld, (code %ld)\n",
                    argv[0], kvno, code);
            exit(1);
        }
@@ -137,7 +137,7 @@ main(int argc, char *argv[])
        
        code = afsconf_GetKeys(tdir, &tkeys);
        if (code) {
-           fprintf(stderr, "%s: failed to get keys, code %d\n", argv[0], code);
+           fprintf(stderr, "%s: failed to get keys, code %ld\n", argv[0], code);
            exit(1);
        }
        for(i=0;i<tkeys.nkeys;i++) {
index d757906c0cc07fd2696f3616069e7ffb1e117f87..c8890d414bf383a58fcf282661e375a7066ceece 100644 (file)
@@ -30,9 +30,7 @@
 
 #include <stdio.h>
 #include <pwd.h>
-#if 0
 #include <afs/com_err.h>
-#endif
 #include <afs/auth.h>
 #include <afs/afsutil.h>
 #include <afs/cellconfig.h>
 #define USING_HEIMDAL 1
 #endif
 
-#ifndef USING_HEIMDAL
-extern krb5_cc_ops krb5_mcc_ops;
-#endif
-
 #include "assert.h"
-
+#include "skipwrap.h"
 
 /* This code borrowed heavily from the previous version of log.  Here is the
    intro comment for that program: */
@@ -353,8 +347,6 @@ CommandProc(struct cmd_syndesc *as, char *arock)
     krb5_principal princ = 0;
     char *cell, *pname, **hrealms, *service;
     char service_temp[MAXKTCREALMLEN + 20];
-    char realm[MAXKTCREALMLEN];
-    char lrealm[MAXKTCREALMLEN];       /* uppercase copy of local cellname */
     krb5_creds incred[1], mcred[1], *outcred = 0, *afscred;
     krb5_ccache cc = 0;
     krb5_get_init_creds_opt gic_opts[1];
@@ -379,11 +371,8 @@ CommandProc(struct cmd_syndesc *as, char *arock)
     static int Pipe = 0;       /* reading from a pipe */
     static int Silent = 0;     /* Don't want error messages */
 
-    int local;                 /* explicit cell is same a local one */
     int writeTicketFile = 0;   /* write ticket file to /tmp */
 
-    char *reason;              /* string describing errors */
-
     service = 0;
     memset(incred, 0, sizeof *incred);
     /* blow away command line arguments */
@@ -437,7 +426,7 @@ CommandProc(struct cmd_syndesc *as, char *arock)
        authtype |= env_afs_rxk5_default();
 #endif
 
-    cell = as->parms[aCELL].items ? cell = as->parms[aCELL].items->data : 0;
+    cell = as->parms[aCELL].items ? as->parms[aCELL].items->data : 0;
     if ((code = afsconf_GetCellInfo(tdir, cell, "afsprot", cellconfig))) {
        if (cell)
            com_err(rn, code, "Can't get cell information for '%s'", cell);
@@ -604,11 +593,6 @@ CommandProc(struct cmd_syndesc *as, char *arock)
                what = "getting default ccache";
                code = krb5_cc_default(k5context, &cc);
            } else {
-#ifdef HAVE_KRB5_CC_REGISTER
-               what = "krb5_cc_register";
-               code = krb5_cc_register(k5context, &krb5_mcc_ops, FALSE);
-               if (code && code != KRB5_CC_TYPE_EXISTS) goto Failed;
-#endif
                what = "krb5_cc_resolve";
                code = krb5_cc_resolve(k5context, "MEMORY:core", &cc);
                if (code) goto Failed;
index 259ea4bb4efa44575afd7846b2e7c1d70710ea36..559d51a36e65c08dfb6618ce9bd5bd3df1e7de4d 100644 (file)
@@ -9,10 +9,9 @@
  * <mit-copyright.h>.
  */
 
-#ifndef lint
-static char rcsid_send_to_kdc_c[] =
-"$Id: krb_util.c,v 1.1.2.5 2007/02/10 13:56:54 jaltman Exp $";
-#endif /* lint */
+#include <afsconfig.h>
+RCSID
+    ("$Header: /cvs/openafs/src/aklog/krb_util.c,v 1.1.2.6 2008/04/01 17:44:52 shadow Exp $");
 
 #if 0
 #include <kerberosIV/mit-copyright.h>
@@ -25,18 +24,10 @@ static char rcsid_send_to_kdc_c[] =
 #define MAX_HSTNM 100
 #endif
 
-#ifdef WINDOWS
-
-#include "aklog.h"             /* for struct afsconf_cell */
-
-#else /* !WINDOWS */
-
-#include <afs/param.h>
 #include <afs/cellconfig.h>
 
-#endif /* WINDOWS */
-
 #include <string.h>
+#include <ctype.h>
 
 #define S_AD_SZ sizeof(struct sockaddr_in)
 
@@ -61,8 +52,8 @@ char *afs_realm_of_cell(krb5_context context, struct afsconf_cell *cellconfig, i
                *p = toupper(*p);
        }
     } else {
-       if (retval = krb5_get_host_realm(context,
-                                        cellconfig->hostName[0], &hrealms))
+       if ((retval = krb5_get_host_realm(context,
+                                        cellconfig->hostName[0], &hrealms)))
            return 0; 
        if(!hrealms[0]) return 0;
        strcpy(krbrlm, hrealms[0]);
index e7dc689c716f8c9bcf65e3c5e0bd317778b13dc1..d5f4ecf0ff4128371650baca66e569cbad33b3f6 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: linked_list.c,v 1.1.2.2 2005/07/15 16:11:24 rra Exp $
+ * $Id: linked_list.c,v 1.1.2.3 2008/04/01 17:44:52 shadow Exp $
  * 
  * This file contains general linked list routines.
  * 
@@ -7,9 +7,9 @@
  * For distribution and copying rights, see the file "mit-copyright.h"
  */
 
-#if !defined(lint) && !defined(SABER)
-static char *rcsid_list_c = "$Id: linked_list.c,v 1.1.2.2 2005/07/15 16:11:24 rra Exp $";
-#endif /* lint || SABER */
+#include <afsconfig.h>
+RCSID
+    ("$Header: /cvs/openafs/src/aklog/linked_list.c,v 1.1.2.3 2008/04/01 17:44:52 shadow Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -46,11 +46,7 @@ void ll_init(linked_list *list)
     }
 
     /* This sets everything to zero, which is what we want. */
-#ifdef WINDOWS
-       memset(list, 0, sizeof(linked_list));
-#else
     bzero((char *)list, sizeof(linked_list));
-#endif /* WINDOWS */
 }
 
 ll_node *ll_add_node(linked_list *list, ll_end which_end)
@@ -164,10 +160,10 @@ int ll_string(linked_list *list, ll_s_action action, char *string)
       case ll_s_add:
        /* Add a string to the list. */
        if (!ll_string(list, ll_s_check, string)) {
-           if (cur_node = ll_add_node(list, ll_tail)) {
+           if ((cur_node = ll_add_node(list, ll_tail))) {
                char *new_string;
-               if (new_string = (char *)calloc(strlen(string) + 1, 
-                                               sizeof(char))) {
+               if ((new_string = (char *)calloc(strlen(string) + 1, 
+                                               sizeof(char)))) {
                    strcpy(new_string, string);
                    ll_add_data(cur_node, new_string);
                }
index 415e599bf38f8568bdb430cea95101441d6d65a5..9030ba4a533c0d33b3a4b4928c452dd9aabfab91 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: linked_list.h,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $
+ * $Id: linked_list.h,v 1.1.2.2 2008/04/01 17:44:52 shadow Exp $
  *
  * This is the header file for a general list linked package.
  * 
 #ifndef __LINKED_LIST_H__
 #define __LINKED_LIST_H__
 
-#if !defined(lint) && !defined(SABER)
-static char *rcsid_linked_list_h = "$Id: linked_list.h,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $";
-#endif /* lint || SABER */
-
 #define LL_SUCCESS 0
 #define LL_FAILURE -1
 
index d920bd7d647fa2dd6e239ab0dd66569df2731b8a..6d3723f4da43b4e2f58503cf0a70d2a0096d0b0e 100644 (file)
@@ -34,6 +34,7 @@
 #include <stdio.h>
 #include <aklog.h>
 #include <krb5.h>
+#include "skipwrap.h"
 
 /* evil hack */
 #define SEQUENCE 16
diff --git a/src/aklog/skipwrap.h b/src/aklog/skipwrap.h
new file mode 100644 (file)
index 0000000..b2b9684
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef _AKLOG_SKIPWRAP_H
+#define _AKLOG_SKIPWRAP_H
+
+int afs_krb5_skip_ticket_wrapper(char *tix, size_t tixlen, char **enc, 
+                                size_t *enclen);
+
+#endif
+
index d4078cc9a32bea5d31c97a01a6e36278d6ad40c1..76c51bbc49fb22bbc31891ed4f1db6ea12469b92 100644 (file)
@@ -72,10 +72,9 @@ AC_DEFUN([LINUX_EXPORTS_INIT_MM], [
   AC_MSG_CHECKING([for exported init_mm])
   AC_CACHE_VAL([ac_cv_linux_exports_init_mm], [
     AC_TRY_KBUILD(
-[#include <linux/modversions.h>],
-[#ifndef __ver_init_mm
-#error init_mm not exported
-#endif],
+[extern struct mm_struct init_mm;],
+[void *address = &init_mm;
+printk("%p\n", address);],
       ac_cv_linux_exports_init_mm=yes,
       ac_cv_linux_exports_init_mm=no)])
   AC_MSG_RESULT($ac_cv_linux_exports_init_mm)])
index 699bddcacde0fc47c2519a41838e28a9c9955c72..31b5a62602605322528fb14dd1b6e5a116d78de7 100644 (file)
@@ -49,6 +49,9 @@
 /* define if sys/param.h defines the endiness */
 #undef ENDIANESS_IN_SYS_PARAM_H
 
+/* define if your kernel exports init_mm */
+#undef EXPORTED_INIT_MM
+
 /* define if your linux kernel exports sys_chdir */
 #undef EXPORTED_SYS_CHDIR
 
 /* define if your struct address_space has page_lock */
 #undef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
 
+/* define if your struct file_operations has flock */
+#undef STRUCT_FILE_OPERATIONS_HAS_FLOCK
+
 /* define if your struct file_operations has sendfile */
 #undef STRUCT_FILE_OPERATIONS_HAS_SENDFILE
 
index 1f935eca2163f296bbb6f79e406f023cfc70594f..3281d5a6af00aa41727f0380976af3fda0b4c73a 100644 (file)
@@ -5,8 +5,8 @@
 #define AFS_X86_ENV 1
 #define AFSLITTLE_ENDIAN 1
 
-#define SYS_NAME       "i386_nbsd40"
-#define SYS_NAME_ID    SYS_NAME_ID_i386_nbsd40
+#define SYS_NAME       "i386_nbsd30"
+#define SYS_NAME_ID    SYS_NAME_ID_i386_nbsd30
 
 #ifndef UKERNEL
 /* This section for kernel libafs compiles only */
diff --git a/src/config/param.i386_nbsd40.h b/src/config/param.i386_nbsd40.h
new file mode 100644 (file)
index 0000000..25fd882
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef        AFS_I386_PARAM_H
+#define        AFS_I386_PARAM_H
+
+#define AFS_X86_XBSD_ENV 1
+#define AFS_X86_ENV 1
+#define AFSLITTLE_ENDIAN 1
+
+#define SYS_NAME       "i386_nbsd40"
+#define SYS_NAME_ID    SYS_NAME_ID_i386_nbsd40
+
+#ifndef UKERNEL
+/* This section for kernel libafs compiles only */
+
+#else /* !defined(UKERNEL) */
+
+/* This section for user space compiles only */
+
+#endif /* !defined(UKERNEL) */
+
+#endif /* AFS_I386_PARAM_H */
index 9dc069694eb5e9a11f85dc60e594ee86e4d8b03d..8f0a2a051a81f222237a9fa6736658bd60b380ef 100644 (file)
@@ -1,11 +1,11 @@
-# Openafs Spec $Revision: 1.1.2.18 $
+# Openafs Spec $Revision: 1.1.2.19 $
 
 %define afsvers @VERSION@
 %define pkgvers @VERSION@
 # for beta/rc releases make pkgrel 0.X.<tag>
 # for real releases make pkgrel 1 (or more for extra releases)
 #%define pkgrel 0.1.rc1
-%define pkgrel 1
+%define pkgrel @LINUX_VERSION@
 
 %if %{?osvers:0}%{!?osvers:1}
 %define osvers 1
index 7457d608827c8b32a922e0a68fba5ec67f6b2933..0134d3a01a1cbf81f58fde99e570fb55c102a9e0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pt_util.c,v 1.9.2.5 2008/03/09 01:41:27 jaltman Exp $ */
+/* $Id: pt_util.c,v 1.9.2.6 2008/03/27 18:40:22 shadow Exp $ */
 
 /*
  *
@@ -23,7 +23,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/ptserver/pt_util.c,v 1.9.2.5 2008/03/09 01:41:27 jaltman Exp $");
+    ("$Header: /cvs/openafs/src/ptserver/pt_util.c,v 1.9.2.6 2008/03/27 18:40:22 shadow Exp $");
 
 #include <afs/cmd.h>           /*Command line parsing */
 #include <errno.h>
@@ -196,8 +196,9 @@ CommandProc(register struct cmd_syndesc *a_as, void *arock)
        fprintf(stderr, "pt_util: %s: Bad UBIK_MAGIC. Is %x should be %x\n",
                pfile, ntohl(uh->magic), UBIK_MAGIC);
     memcpy(&uv, &uh->version, sizeof(struct ubik_version));
-    if (wflag && uv.epoch == 0 && uv.counter == 0) {
-       uv.epoch = 2;           /* a ubik version of 0 or 1 has special meaning */
+
+    if (wflag && ntohl(uv.epoch) == 0 && ntohl(uv.counter) == 0) {
+       uv.epoch = htonl(2); /* a ubik version of 0 or 1 has special meaning */
        memcpy(&uh->version, &uv, sizeof(struct ubik_version));
        lseek(dbase_fd, 0, SEEK_SET);
        if (write(dbase_fd, buffer, HDRSIZE) < 0) {
@@ -206,6 +207,11 @@ CommandProc(register struct cmd_syndesc *a_as, void *arock)
            exit(1);
        }
     }
+
+    /* Now that any writeback is done, swap these */
+    uv.epoch = ntohl(uv.epoch);
+    uv.counter = ntohl(uv.counter);
+
     fprintf(stderr, "Ubik Version is: %d.%d\n", uv.epoch, uv.counter);
     if (read(dbase_fd, &prh, sizeof(struct prheader)) < 0) {
        fprintf(stderr, "pt_util: error reading %s: %s\n", pfile,
@@ -329,6 +335,10 @@ CommandProc(register struct cmd_syndesc *a_as, void *arock)
        exit(1);
     }
     uh = (struct ubik_hdr *)buffer;
+
+    uh->version.epoch = ntohl(uh->version.epoch);
+    uh->version.counter = ntohl(uh->version.counter);
+
     if ((uh->version.epoch != uv.epoch)
        || (uh->version.counter != uv.counter)) {
        fprintf(stderr,
index f972c7a744a2b1fddea380f612f228963081649c..71ab24740bd038d421e442347f9c013ca2e2d186 100644 (file)
@@ -359,7 +359,7 @@ install:
 
 uninstall:
 
-all: run-tests dirpath.conf OpenAFS/Dirpath.pm libxfiles.a libdumpscan.a $(TEST_PROGRAMS)\
+all: run-tests OpenAFS/Dirpath.pm libxfiles.a libdumpscan.a $(TEST_PROGRAMS)\
        afsdump_scan afsdump_dirlist afsdump_extract dumptool
        @chmod +x run-tests
 
@@ -378,25 +378,9 @@ check: run-tests $(TEST_PROGRAMS)
 check-fast: run-tests $(TEST_PROGRAMS)
        ./run-tests -all -fast
 
-dirpath.conf: Makefile
-       @echo "creating $@"
-       @echo "# auto-generated by src/tests/Makefile"      >$@
-       @echo "# DO NOT EDIT"                               >>$@
-       @echo "afsconfdir=@afsconfdir@"                     >>$@
-       @echo "viceetcdir=@viceetcdir@"                     >>$@
-       @echo "afssrvbindir=@afssrvbindir@"                 >>$@
-       @echo "afssrvsbindir=@afssrvsbindir@"               >>$@
-       @echo "afssrvlibexecdir=@afssrvlibexecdir@"         >>$@
-       @echo "afsdbdir=@afsdbdir@"                         >>$@
-       @echo "afslogsdir=@afslogsdir@"                     >>$@
-       @echo "afslocaldir=@afslocaldir@"                   >>$@
-       @echo "afsbackupdir=@afsbackupdir@"                 >>$@
-       @echo "afsbosconfigdir=@afsbosconfigdir@"           >>$@
-       @echo "afskerneldir=@afskerneldir@"                 >>$@
-       @echo "initdir=@sysconfdir@"                        >>$@
-       @echo "localstatedir=@localstatedir@"               >>$@
-       @echo "ostype=@MKAFS_OSTYPE@"                       >>$@
-
+# Note: The autoconf variables are not fully expanded
+#       until make is run so we resort to creating the
+#       configuration at make time.
 OpenAFS/Dirpath.pm: Makefile
        @echo "Creating OpenAFS/Dirpath.pm"
        @echo "# This is -*- perl -*-"                          >$@
@@ -420,12 +404,25 @@ OpenAFS/Dirpath.pm: Makefile
        @echo "  'afslocaldir'      => '@afslocaldir@',"        >>$@
        @echo "  'afsbackupdir'     => '@afsbackupdir@',"       >>$@
        @echo "  'afsbosconfigdir'  => '@afsbosconfigdir@',"    >>$@
-       @echo "  'afskerneldir'     => '@afskerneldir@',"       >>$@
-       @echo "  'initdir'          => '@sysconfdir@',"         >>$@
-       @echo "  'localstatedir'    => '@localstatedir@',"      >>$@
        @echo "  'ostype'           => '@MKAFS_OSTYPE@',"       >>$@
+       @if test "@afsconfdir@" = "/usr/afs/etc" ; then \
+               echo "  # transarc paths" ;\
+               echo "  'cachedir'     => '/usr/vice/cache'," ;\
+               echo "  'afsddir'      => '/usr/vice/etc'," ;\
+               echo "  'initdir'      => '/usr/vice/etc',"  ;\
+               echo "  'afskerneldir' => '/usr/vice/etc/modload'," ;\
+               echo "  'afswsbindir'  => '/usr/afsws/bin'," ;\
+       else \
+               echo "  # modern paths" ;\
+               echo "  'cachedir'     => '@localstatedir@/openafs/cache'," ;\
+               echo "  'afsddir'      => '@afssrvsbindir@'," ;\
+               echo "  'initdir'      => '@sysconfdir@',"  ;\
+               echo "  'afskerneldir' => '@afskerneldir@'," ;\
+               echo "  'afswsbindir'  => '@afssrvbindir@'," ;\
+       fi >>$@
        @echo "};"                                              >>$@
        @echo ""                                                >>$@
        @echo "1;"                                              >>$@
 
+
 .PHONY:                all install clean realclean distclean mostlyclean install uninstall check
index 2523433811713fe27245259d4f593036663a7ba6..ac0b9641a756267c7a2f47670637b41d243e1980 100644 (file)
@@ -7,6 +7,18 @@ use OpenAFS::Dirpath;
 use OpenAFS::ConfigUtils;
 
 my $path = $OpenAFS::Dirpath::openafsdirpath;
+my $classes = {
+  'mit'      => 'OpenAFS::Auth::MIT',
+  #'heimdal' => 'OpenAFS::Auth::Heimdal',
+  'kaserver' => 'OpenAFS::Auth::Kaserver',
+};
+
+my $bos       = "$path->{'afssrvbindir'}/bos";
+my $aklog     = "$path->{'afswsbindir'}/aklog";
+my $tokens    = "$path->{'afswsbindir'}/tokens";
+my $asetkey   = "$path->{'afssrvbindir'}/asetkey";
+my $kas       = "$path->{'afssrvsbindir'}/kas";
+my $klog      = "$path->{'afswsbindir'}/klog";
 
 #
 # Create an auth type for the specified Kerberos implementation.
@@ -27,24 +39,36 @@ my $path = $OpenAFS::Dirpath::openafsdirpath;
 #  $auth->authorize('admin');
 #
 sub create {
+  my $parms = {@_};
+  my $type = 'mit';
+
+  if (defined $parms->{'type'}) {
+    $type = $parms->{'type'};
+  }
+  $type =~ tr/A-Z/a-z/;
+  my $class = $classes->{$type};
+  unless($class) {
+    die "Unsupported kerberos type: $type\n";
+  }
+  return $class->new(@_);
+}
+
+#
+# Create an auth instance.
+#
+sub new {
+  my $class = shift;
   my $self = {
      # default values
      'type' => 'MIT',
-     'keytab' =>  "$path->{'afsconfdir'}/krb5.keytab",
      'cell' => '',
      'realm' => '', 
+     'admin' => 'admin',
      'debug' => '0',
      # user specified values
      @_,
   };
 
-  # check for supported kerberos type.
-  my $type = $self->{'type'};
-  $self->{'type'} = _check_kerberos_type($type) or 
-    die "Unsupported kerberos type: $type\n";
-
-  # create the sub-class for the kerberos type.
-  my $class = "OpenAFS::Auth::$self->{'type'}";
   $self = bless($self, $class);
 
   # attempt get default values.
@@ -75,19 +99,6 @@ sub create {
   return $self;
 }
 
-#
-# Check for supported kerberos type, and allow for case insensitivity.
-#
-sub _check_kerberos_type {
-  my $type = shift;
-  foreach my $supported ('MIT', 'Heimdal', 'Kaserver') {
-     if ($type =~ /^$supported$/i) {
-        return $supported;
-     }
-  }
-  return undef;
-}
-
 #
 # Returns the cell name from the ThisCell configuration file.
 #
@@ -149,6 +160,19 @@ sub debug {
   return $self->{'debug'};
 }
 
+#
+# check_program($prog) - verify the program is installed.
+#
+sub check_program {
+  my $self = shift;
+  my $program = shift;
+  unless ( -f $program ) {
+     die "error: Missing program: $program\n";
+  }
+  unless ( -x $program ) {
+     die "error: Not executable: $program\n";
+  }
+}
 
 #------------------------------------------------------------------------------------
 # MIT Kerberos authorization commands.
@@ -159,20 +183,17 @@ use OpenAFS::Dirpath;
 use OpenAFS::ConfigUtils;
 our @ISA = ("OpenAFS::Auth");
 
+
 #
 # Sanity checks before we get started.
 #
 sub _sanity_check {
   my $self = shift;
-  unless (defined $path->{'afssrvbindir'}) {
-    die "error: \$path->{'afssrvbindir'} is not defined.\n";
-  }
-  unless (-f "$path->{'afssrvbindir'}/aklog") {
-    die "error: $path->{'afssrvbindir'}/aklog not found.\n";
-  }
-  unless (-x "$path->{'afssrvbindir'}/aklog") {
-    die "error: $path->{'afssrvbindir'}/aklog not executable.\n";
-  }
+
+  $self->check_program($aklog);
+  $self->check_program($tokens);
+  $self->check_program($asetkey);
+
   unless ($self->{'realm'}) {
     die "error: Missing realm parameter Auth::create().\n";
   }
@@ -182,44 +203,20 @@ sub _sanity_check {
   unless ( -f $self->{'keytab'} ) {
     die "error: Kerberos keytab file not found: $self->{'keytab'}\n";
   }
-  unless ( -f $self->{'keytab'} ) {
-    die "error: Keytab file not found: $self->{'keytab'}\n";
-  }
+
+  print "debug: Verifying the keytab and admin name, $self->{'admin'}.\n" if $self->debug;
+  run("kinit -k -t $self->{'keytab'} $self->{'admin'}");
+
+  print "debug: Getting the afs principal and kvno from the keytab.\n" if $self->debug;
+  $self->_prepare_make_keyfile();
 }
 
 #
-# Create the KeyFile from the Kerberos keytab file. The keytab file
-# should be created using the Kerberos kadmin command (or with the kadmin.local command
-# as root on the KDC). See the OpenAFS asetkey man page for details.
-# 
-sub make_keyfile {
+# Read the keytab to find the kvno of the afs principal.
+#
+sub _prepare_make_keyfile {
   my $self = shift;
 
-  # asetkey annoyance. The current asetkey implementation requires the ThisCell and CellServDB files
-  # to be present but they really are not needed to create the KeyFile. This check is done here
-  # rather than in the _sanity_checks() because the ThisCell/CellServerDB are created later in 
-  # the process of creating the new cell.
-  unless ( -f "$path->{'afsconfdir'}/ThisCell" ) {
-    die "error: OpenAFS configuration file is required, $path->{'afsconfdir'}/ThisCell\n";
-  }
-  unless ( -f "$path->{'afsconfdir'}/CellServDB" ) {
-    die "error: OpenAFS configuration file is required, $path->{'afsconfdir'}/CellServDB\n";
-  }
-
-  unless ( -f "$path->{'afssrvbindir'}/asetkey" ) {
-    die "error: $path->{'afssrvbindir'}/asetkey is missing.\nWas OpenAFS built with Kerberos support?\n";
-  }
-  unless ( -x "$path->{'afssrvbindir'}/asetkey" ) {
-    die "error: Do not have execute permissions on $path->{'afssrvbindir'}/asetkey\n";
-  }
-  unless ( -d $path->{'afsconfdir'} ) {
-    die "error: OpenAFS configuration directory '$path->{'afsconfdir'}' is missing.\n";
-  }
-  unless ( -w $path->{'afsconfdir'} ) {
-    die "error: Write access to the OpenAFS configuration directory '$path->{'afsconfdir'}' is required.\n";
-  }
-
-
   # Run klist to get the kvno of the afs key. Search for afs/cellname@REALM
   # then afs@REALM. klist must be in the path.
   my %keys = ();
@@ -262,9 +259,37 @@ sub make_keyfile {
     die "error: Could not find an afs key matching 'afs/$cell\@$realm' or ".
       "'afs/$cell' in keytab $self->{'keytab'}\n";
   }
+  
+  $self->{'afs_principal'} = $afs_principal;
+  $self->{'afs_kvno'}      = $afs_kvno;
+}
+
+#
+# Create the KeyFile from the Kerberos keytab file. The keytab file
+# should be created using the Kerberos kadmin command (or with the kadmin.local command
+# as root on the KDC). See the OpenAFS asetkey man page for details.
+#
+sub make_keyfile {
+  my $self = shift;
+  
+  # The current asetkey implementation requires the ThisCell and CellServDB files
+  # to be present but they really are not needed to create the KeyFile. A check is done here
+  # rather than in the _sanity_checks() because the ThisCell/CellServerDB are created later in 
+  # the process of creating the new cell.
+  unless ( -d $path->{'afsconfdir'} ) {
+    die "error: OpenAFS configuration directory '$path->{'afsconfdir'}' is missing.\n";
+  }
+  unless ( -w $path->{'afsconfdir'} ) {
+    die "error: Write access to the OpenAFS configuration directory '$path->{'afsconfdir'}' is required.\n";
+  }
+  unless ( -f "$path->{'afsconfdir'}/ThisCell" ) {
+    die "error: OpenAFS configuration file is required, $path->{'afsconfdir'}/ThisCell\n";
+  }
+  unless ( -f "$path->{'afsconfdir'}/CellServDB" ) {
+    die "error: OpenAFS configuration file is required, $path->{'afsconfdir'}/CellServDB\n";
+  }
 
-  # Run asetkey on the keytab to create the KeyFile. asetkey must be in the PATH.
-  run("$path->{'afssrvbindir'}/asetkey add $afs_kvno $self->{'keytab'} $afs_principal");
+  run("$asetkey add $self->{'afs_kvno'} $self->{'keytab'} $self->{'afs_principal'}");
 }
 
 #
@@ -272,13 +297,13 @@ sub make_keyfile {
 #
 sub authorize {
   my $self = shift;
-  my $principal = shift || 'admin';
+  my $principal = shift || $self->{'admin'};
   my $opt_aklog = "";
   $opt_aklog .= " -d" if $self->debug;
 
   run("kinit -k -t $self->{'keytab'} $principal");
-  run("$path->{'afssrvbindir'}/aklog $opt_aklog");
-  run("$path->{'afssrvbindir'}/tokens");
+  run("$aklog $opt_aklog");
+  run("$tokens");
 }
 
 
@@ -305,6 +330,11 @@ sub _sanity_check {
   }
 }
 
+sub make_keyfile {
+  my $self = shift;
+  die "not implemented.";
+}
+
 #
 # Get kerberos ticket and AFS token for the user.
 #
@@ -321,23 +351,36 @@ use OpenAFS::Dirpath;
 use OpenAFS::ConfigUtils;
 our @ISA = ("OpenAFS::Auth");
 
+
 #
 # Various checks during initialization.
 #
 sub _sanity_check {
   my $self = shift;
+  $self->check_program($kas);
+  $self->check_program($klog);
+  $self->check_program($tokens);
   unless ($self->{'realm'}) {
     die "Missing realm parameter Auth::create().\n";
   }
 }
 
+sub make_keyfile {
+  my $self = shift;
+  run("$kas create afs -noauth");
+  run("$kas create admin -noauth");
+  run("$kas setfields admin -flags admin -noauth");
+  run("$bos addkey localhost -kvno 0 -noauth");
+}
+
 #
 # Get kerberos ticket and AFS token for the user.
 #
 sub authorize {
   my $self = shift;
   my $principal = shift || 'admin';
-  run("echo \"Proceeding w/o authentication\"|klog -pipe ${principal}\@$self->{'realm'}");
+  #run("echo \"Proceeding w/o authentication\"|klog -pipe ${principal}\@$self->{'realm'}");
+  run("klog $principal\@$self->{'realm'}");
 }
 
 1;
index d30afd03dc91de17cab15731c87f6469a8572e57..6d685acb7ce658b94b151e4c08c5f6ca40d6aae9 100644 (file)
@@ -13,30 +13,24 @@ my $path = $OpenAFS::Dirpath::openafsdirpath;
 # and commands.
 #
 sub create {
+  my $class = _get_class($path->{'ostype'});
+  $class->new(@_);
+}
+
+#
+# Create the OS object.
+#
+sub new {
+  my $class = shift;
   my $self = {
     'debug'=>0,
     'ostype'=>$path->{'ostype'},
     @_,
   };
 
-  my $class = _get_class($self->{'ostype'});
   $self = bless($self, $class);
+  $self->{'syscnf'} = "$path->{'initdir'}/test-afs-rc.conf";
   $self->{'commands'} = $self->get_commands();
-
-  # Put the paths to the cache and afsd into the path
-  # table. Assume legacy paths if the the viceetcdir is set to
-  # the Transarc path.
-  if ($path->{'viceetcdir'} eq '/usr/vice/etc') {
-    # set in the makefile dest targets
-    $path->{'cachedir'} = "/usr/vice"     unless $path->{'cachedir'};  
-    $path->{'afsddir'}  = "/usr/vice/etc" unless $path->{'afsddir'};
-  }
-  else {
-    # set in the makefile install targets
-    $path->{'cachedir'} = "$path->{'localstatedir'}/openafs" unless $path->{'cachedir'};
-    $path->{'afsddir'}  = "$path->{'afssrvsbindir'}"         unless $path->{'afsddir'};
-  }  
-
   return $self;
 }
 
@@ -156,6 +150,16 @@ sub find_pids {
   return @pids;
 }
 
+#
+# Returns the number of pids found for a program name.
+#
+sub number_running {
+  my $self = shift;
+  my $program = shift;
+  my @pids = $self->find_pids($program);
+  return scalar @pids;
+}
+
 #--------------------------------------------------------------
 package OpenAFS::OS::Linux;
 use warnings;
@@ -169,12 +173,11 @@ our @ISA = qw(OpenAFS::OS::Unix);
 #
 sub get_commands {
   my $self = shift;
-  my $syscnf = "$path->{'initdir'}/testclient.conf";
 
   my $commands = {
-    'client-start'         => "SYSCNF=$syscnf $path->{'initdir'}/afs.rc start",
-    'client-stop'          => "SYSCNF=$syscnf $path->{'initdir'}/afs.rc stop",
-    'client-restart'       => "SYSCNF=$syscnf $path->{'initdir'}/afs.rc restart",
+    'client-start'         => "SYSCNF=$self->{'syscnf'} $path->{'initdir'}/afs.rc start",
+    'client-stop'          => "SYSCNF=$self->{'syscnf'} $path->{'initdir'}/afs.rc stop",
+    'client-restart'       => "SYSCNF=$self->{'syscnf'} $path->{'initdir'}/afs.rc restart",
     'client-forcestop'     => sub { $self->client_forcestop() },
     'fileserver-start'     => sub { $self->fileserver_start() },
     'fileserver-stop'      => sub { $self->fileserver_stop() },
@@ -201,12 +204,11 @@ sub configure_client {
   };
   
   my $debug = $self->{'debug'};
-  my $syscnf = "$path->{'initdir'}/testclient.conf";
 
-  open (SYSCNF, "> $syscnf") or
-    die "error: Cannot open afs.rc configuration file $syscnf, $!\n";
+  open (SYSCNF, "> $self->{'syscnf'}") or
+    die "error: Cannot open afs.rc configuration file $self->{'syscnf'}, $!\n";
 
-  print "debug: creating afs.rc configuration file $syscnf\n" if $debug; 
+  print "debug: creating afs.rc configuration file $self->{'syscnf'}\n" if $debug; 
   print SYSCNF <<"_SYSCNF_";
 AFS_CLIENT=on
 AFS_SERVER=off
@@ -216,7 +218,7 @@ CACHESIZE=$config->{'cachesize'}
 OPTIONS="-confdir $path->{'viceetcdir'}"
 WAIT_FOR_SALVAGE=no
 AFSDIR=/afs
-CACHEDIR=$path->{'cachedir'}/cache
+CACHEDIR=$path->{'cachedir'}
 CACHEINFO=$path->{'viceetcdir'}/cacheinfo
 VERBOSE=
 AFS_POST_INIT=
@@ -228,7 +230,7 @@ MODLOADDIR=$path->{'afskerneldir'}
 _SYSCNF_
   close SYSCNF;
   if ($debug) {
-    if (open(SYSCNF, "< $syscnf")) {
+    if (open(SYSCNF, "< $self->{'syscnf'}")) {
       while (<SYSCNF>) {
         chomp; print "debug:  $_\n";
       }
@@ -237,10 +239,10 @@ _SYSCNF_
   }
 
   # Create a cache directory if none.
-  unless ( -d "$path->{'cachedir'}/cache" ) {
-    print "debug: making cache directory: $path->{'cachedir'}/cache\n" if $debug;
-    system("mkdir -p $path->{'cachedir'}/cache");
-    system("chmod 0700 $path->{'cachedir'}/cache"); 
+  unless ( -d "$path->{'cachedir'}" ) {
+    print "debug: making cache directory: $path->{'cachedir'}\n" if $debug;
+    system("mkdir -p $path->{'cachedir'}");
+    system("chmod 0700 $path->{'cachedir'}"); 
   }
 
   # Create the local /afs directory on which the afs filespace will be mounted. 
index 9e5333bf9fcc322ed11574e1345cdc3564a4e53a..9e4052899ed8fb9521d34fd6f43815dce278e6bc 100644 (file)
@@ -94,12 +94,10 @@ what you want...
 
 =cut
 
-@CmdPath = (split(/:/, $ENV{PATH}),
+@CmdPath = (
             $OpenAFS::Dirpath::openafsdirpath->{'afssrvbindir'},        # For servers
-           '/usr/local/bin',      # Many sites put AFS in /usr/local
-           '/usr/local/etc',
-           '/usr/afsws/bin',      # For people who use Transarc's
-           '/usr/afsws/etc');     # silly reccommendations
+            $OpenAFS::Dirpath::openafsdirpath->{'afswsbindir'},
+        );
 
 =item $err_table_dir - Error table directory
 
index b2bf36212a054c29dc2210f71b117eeb43966c85..8ec1bc1c313190fb8ba8c895010befbf17651a43 100755 (executable)
@@ -12,38 +12,39 @@ use OpenAFS::OS;
 use OpenAFS::Auth;
 use Getopt::Long;
 use Pod::Usage;
+use Socket;
 
 =head1  NAME
 
-   afs-newcell - Set up initial database server for AFS cell.
+   afs-newcell - Set up the initial database and file server for a new OpenAFS cell.
 
 =head1 SYNOPSIS
 
 B<afs-newcell>
-       B<--batch>
-       B<--debug>
-       B<--dont-unwind>
-       B<--help>
-       B<--ostype>=os
-       B<--server>=hostname
-       B<--cellname>=cell
-       B<--partition>=partition
-       B<--admin>=administrator
-       B<--kerberos-type>=authentication_type
-       B<--kerberos-realm>=realm_name
-       B<--kerberos-keytab>=keytab_file
-       B<--skip-make-keyfile>
-       B<--with-dafs>
-       B<--options-fileserver>=options
-       B<--options-volserver>=options
-       B<--options-salvageserver>=options
-          B<--options-salvager>=options 
+       [ B<--batch> ]
+       [ B<--debug> ]
+       [ B<--unwind> ]
+       [ B<--help> ]
+       [ B<--server>=hostname ]
+       [ B<--cellname>=cell ]
+       [ B<--partition>=partition ]
+       [ B<--admin>=administrator ]
+       [ B<--kerberos-type>=authentication_type ]
+       [ B<--kerberos-realm>=realm_name ]
+       [ B<--kerberos-keytab>=keytab_file ]
+       [ B<--with-dafs> ]
+       [ B<--options-ptserver>=options ]
+       [ B<--options-vlserver>=options ]
+       [ B<--options-fileserver>=options ]
+       [ B<--options-volserver>=options ] 
+       [ B<--options-salvageserver>=options ]
+       [ B<--options-salvager>=options ]
 
 =head1 DESCRIPTION
 
 This script sets up the initial AFS database and configures the first
-database/file server. It also sets up an AFS cell's root volumes.  It assumes
-that you already have a fileserver and database servers installed.  The
+database/file server. It also sets up an AFS cell's root volumes.  The
+fileserver and database server binaries must already be installed.  The
 fileserver should have an empty root.afs. This script creates root.cell, user,
 service and populates root.afs.  
 
@@ -88,7 +89,7 @@ The asetkey command requires a cell configuration.
 You will need an administrative principal created in a Kerberos realm.  This
 principal will be added to system:administrators and thus will be able to run
 administrative commands.  Generally the user is a root instance of some
-administravie user.  For example if jruser is an administrator then it would be
+administrative user.  For example if jruser is an administrator then it would be
 reasonable to create jruser/root and specify jruser/root as the user to be
 added in this script using the 'admin' command line option.  You will also need
 to create a keyfile for this adminstrative user which is used by the script to
@@ -125,17 +126,17 @@ sub prompt($$) {
 #
 sub mkvol($$$$) {
     my ($vol, $mnt, $srv, $part) = @_;
-    run("$path->{'afssrvsbindir'}/vos create $srv $part $vol -maxquota 0 -localauth");
-    unwind("$path->{'afssrvsbindir'}/vos remove $srv $part $vol -localauth");
-    run("$path->{'afssrvbindir'}/fs mkm $mnt $vol ");
-    run("$path->{'afssrvbindir'}/fs sa $mnt system:anyuser rl");
+    run("$path->{'afssrvsbindir'}/vos create $srv $part $vol -maxquota 0");
+    unwind("$path->{'afssrvsbindir'}/vos remove $srv $part $vol");
+    run("$path->{'afssrvbindir'}/fs mkmount $mnt $vol ");
+    run("$path->{'afssrvbindir'}/fs setacl $mnt system:anyuser rl");
 }
 
 #-----------------------------------------------------------------------------------
 # check_program($prog) - verify the program is installed.
 #
 sub check_program($) {
-    my ($program) = @_;
+  my ($program) = @_;
   unless ( -f $program ) {
      die "error: Missing program: $program\n";
   }
@@ -150,32 +151,30 @@ sub check_program($) {
 # options
 my $batch = 0;
 my $debug = 0;
-my $dont_unwind = 0;
+my $unwind = 1;
 my $help = 0;
-my $ostype = $path->{'ostype'};
-my $server = 'localhost';
 my $cellname = 'testcell';
-my $partition = '/vicepa';
+my $partition = 'a';
 my $admin = 'admin';
 my $kerberos_type = 'MIT';
 my $kerberos_realm = 'TESTCELL';
 my $kerberos_keytab = "$path->{'afsconfdir'}/krb5.keytab";
-my $skip_make_keyfile = 0;
 my $with_dafs = 0;
+my $options_ptserver = '';
+my $options_vlserver = '';
 my $options_fileserver = '';
 my $options_volserver = '';
 my $options_salvageserver = '';
 my $options_salvager = '';
 
-$server = `hostname`;
+my $server = `hostname -f`;
 chomp $server;
 
 GetOptions (
-       "batch" => \$batch, 
+       "batch!" => \$batch, 
        "debug!" => \$debug,
-       "dont-unwind!" => \$dont_unwind,
+       "unwind!" => \$unwind,
        "help" => \$help,
-       "ostype=s" => \$ostype,
        "server=s" => \$server,
        "cellname=s" => \$cellname, 
        "partition=s" => \$partition,
@@ -183,8 +182,9 @@ GetOptions (
        "kerberos-type=s" => \$kerberos_type,
        "kerberos-realm=s" => \$kerberos_realm,
        "kerberos-keytab=s" => \$kerberos_keytab,
-       "skip-make-keyfile" => \$skip_make_keyfile,
        "with-dafs" => \$with_dafs,
+       "options-ptserver=s" => \$options_ptserver,
+       "options-vlserver=s" => \$options_vlserver,
        "options-fileserver=s" => \$options_fileserver,
        "options-volserver=s" => \$options_volserver,
        "options-salvageserver=s" => \$options_salvageserver,
@@ -196,17 +196,17 @@ if ($help) {
   exit 0;
 }
 
-# print debug messages when running commands.
+# To print debug messages in the run() calls.
 $OpenAFS::ConfigUtils::debug = $debug;
 
-#
-# Verify we have a clean slate before starting.
+#-----------------------------------------------------------------------------
+# Prereq: Must be root and must not already have a cell configuration.
 #
 my @problems = ();
 my $try_rm_cell = 0;
 
 if ($> != 0) {
-  push(@problems, "This script should run as root.");
+  push(@problems, "You must be root to run this script.");
 }
 
 my @afsconfigfiles = (
@@ -215,6 +215,8 @@ my @afsconfigfiles = (
   "$path->{'afsconfdir'}/UserList",
   "$path->{'afsdbdir'}/prdb.DB0",
   "$path->{'afsbosconfigdir'}/BosConfig",
+  "$path->{'afsddir'}/ThisCell",
+  "$path->{'afsddir'}/CellServDB",
 );
 foreach my $configfile (@afsconfigfiles) {
   if ( -f $configfile ) {
@@ -231,8 +233,8 @@ if (@problems) {
   exit 1;
 }
 
-#
-# Interactive mode
+#-----------------------------------------------------------------------------
+# Prereq: System requirements notification.
 #
 unless ($batch) {
 
@@ -246,20 +248,16 @@ this script. See 'pod2text $0' for more details.
    the --partition option for alternative mount points.)
 
 2) The OpenAFS client and server binaries must be installed.
-   The init scripts to start and stop the client and servers 
-   must be installed and configured. OpenAFS/OS.pm must be 
-   configured for your system. There should be no remants
-   from a previous cell. Run afs-rmcell to remove any.
+   There should be no remnants from a previous cell. 
+   Run afs-rmcell to remove any.
 
-3) A Kerberos realm with Kerberos4 support must be available.
+3) A Kerberos realm with Kerberos 4 support must be available.
    Supported Kerberos implementations are Heimdal with
    Kth-kerberos compatibility, MIT Kerberos 5, and 
-   Kaserver (deprecated). OpenAFS/Auth.pm must be configured
-   for your system.
+   Kaserver (deprecated). 
 
 4) A Kerberos keytab file containing the afs principal 
-   and the administrator principal must be be present at
-   $path->{'afsconfdir'}/krb5.keytab.
+   and the administrator principal must be be present.
    See the asetkey man page for information about creating the
    keytab file.  The default name of the administrator 
    principal is 'admin'. See the --admin option for
@@ -270,87 +268,154 @@ eoreqs
   my $answer = prompt("Does your system meet these requirements? (yes/no)", "no");
   unless ($answer=~/^y/i ) {
     print "OK: Aborted.\n";
-  exit 0;
+    exit 0;
   }
+}
 
-  print "\nServer options:\n"; 
-  $ostype = prompt("Which OS?", $ostype);
-  $server = prompt("What server name should be used?", $server);
-  $cellname = prompt("What cellname should be used?", $cellname);
-  $partition = prompt("What vice partition?", $partition);
-  $admin = prompt("What administrator username?", $admin);
-  if($admin =~ /@/) {
-    die "error: Please specify the username without the realm name.\n";
-  }
+#-----------------------------------------------------------------------------
+# Prereq: Verify required binaries, directories, and permissions.
+#
+my $bosserver = "$path->{'afssrvsbindir'}/bosserver";
+my $bos       = "$path->{'afssrvbindir'}/bos";
+my $fs        = "$path->{'afssrvbindir'}/fs";
+my $pts       = "$path->{'afssrvbindir'}/pts";
+my $vos       = "$path->{'afssrvsbindir'}/vos";
+my $afsrc     = "$path->{'initdir'}/afs.rc";
+my $aklog     = "$path->{'afswsbindir'}/aklog";
+my $tokens    = "$path->{'afswsbindir'}/tokens";
+my $klog      = "$path->{'afswsbindir'}/klog";
+my $kas       = "$path->{'afssrvsbindir'}/kas";
 
-  print "\nKerberos options:\n";
-  $kerberos_type = prompt("Which Kerberos is to be used?", $kerberos_type);
-  if ($kerberos_type!~/kaserver/i) {
-    $kerberos_realm  = prompt("What Kerberos realm?", $kerberos_realm);
-    $kerberos_keytab = prompt("What keytab file?", $kerberos_keytab);
-    $answer = prompt("Create OpenAFS KeyFile from a keytab? (yes/no)", "yes");
-    $skip_make_keyfile = ($answer=~/^y/i) ? 0 : 1;
-  }
+check_program($bosserver);
+check_program($bos);
+check_program($fs);
+check_program($pts);
+check_program($vos);
+check_program($afsrc);
+check_program($tokens);
 
-  print "\nFileserver options:\n";
-  $answer = prompt("Use DAFS fileserver (requires DAFS build option)? (yes/no)", "no");
-  $with_dafs = ($answer=~/^y/i) ? 1 : 0;
-  $options_fileserver = prompt("fileserver options:", $options_fileserver);
-  $options_volserver = prompt("volserver options:",  $options_volserver);
-  $options_salvageserver = prompt("salvageserver options:",  $options_salvageserver);
-  $options_salvager = prompt("salvager options:", $options_salvager);
-
-  print "\nConfirmation:\n";
-  print "OS Type                : $ostype\n";
-  print "Server name            : $server\n";
-  print "Cell name              : $cellname\n";
-  print "Partition              : $partition\n";
-  print "Administrator          : $admin\n";
-  print "Kerberos               : $kerberos_type\n";
+#-----------------------------------------------------------------------------
+# Prereq: Cell configuration
+#
+if ($batch) {
   if ($kerberos_type!~/kaserver/i) {
-    print "Realm                  : $kerberos_realm\n";
-    print "Keytab file            : $kerberos_keytab\n";
-    print "Make KeyFile           : ", $skip_make_keyfile ? "yes" : "no", "\n";
+    check_program($aklog);
+    unless ( -f $kerberos_keytab ) {
+      die "error: Missing keytab file: $kerberos_keytab\n";
+    }
   }
-  print "DAFS fileserver        : ", $with_dafs ? "yes" : "no", "\n";
-  print "fileserver options     : $options_fileserver\n";
-  print "volserver options      : $options_volserver\n";
-  print "salvagerserver options : $options_salvageserver\n";
-  print "salvager options       : $options_salvager\n";
-  print "\n";
-
-  $answer = prompt("Continue? (yes/no)", "yes");
-  unless ($answer=~/^y/i ) {
-    print "OK: Aborted.\n";
-  exit 0;
+}
+else {
+  my $answer;
+  get_options: {
+    $answer = prompt("Print afs-newcell debugging messages? (yes/no)", $debug ? "yes" : "no");
+    $debug = ($answer=~/^y/i) ? 1 : 0;
+
+    print "\nServer options:\n"; 
+    $server = prompt("What server name should be used?", $server);
+    $cellname = prompt("What cellname should be used?", $cellname);
+    $partition = prompt("What vice partition?", $partition);
+    $admin = prompt("What administrator username?", $admin);
+    if($admin =~ /@/) {
+      die "error: Please specify the username without the realm name.\n";
+    }
+  
+    print "\nKerberos options:\n";
+    $kerberos_type = prompt("Which Kerberos is to be used?", $kerberos_type);
+    if ($kerberos_type=~/kaserver/i) {
+      check_program($klog);
+      check_program($kas);
+    }
+    else {
+      check_program($aklog);
+      $kerberos_realm = $cellname;
+      $kerberos_realm =~ tr/a-z/A-Z/;
+      $kerberos_realm = prompt("What Kerberos realm?", $kerberos_realm);
+      get_keytab: {
+        $kerberos_keytab = prompt("What keytab file?", $kerberos_keytab);
+        unless ( -f $kerberos_keytab ) {
+          print "Cannot find keytab file $kerberos_keytab\n";
+          redo get_keytab;
+        }
+      }
+    }
+  
+    print "\nDatabase Server options:\n";
+    $options_ptserver = prompt("ptserver options:", $options_ptserver);
+    $options_vlserver = prompt("vlserver options:", $options_vlserver);
+
+    print "\nFileserver options:\n";
+    $answer = prompt("Use DAFS fileserver (requires DAFS build option)? (yes/no)", "no");
+    $with_dafs = ($answer=~/^y/i) ? 1 : 0;
+    $options_fileserver = prompt("fileserver options:", $options_fileserver);
+    $options_volserver = prompt("volserver options:",  $options_volserver);
+    $options_salvageserver = prompt("salvageserver options:",  $options_salvageserver);
+    $options_salvager = prompt("salvager options:", $options_salvager);
+  
+    print "\nConfirmation:\n";
+    print "Server name            : $server\n";
+    print "Cell name              : $cellname\n";
+    print "Partition              : $partition\n";
+    print "Administrator          : $admin\n";
+    print "Kerberos               : $kerberos_type\n";
+    if ($kerberos_type!~/kaserver/i) {
+      print "Realm                  : $kerberos_realm\n";
+      print "Keytab file            : $kerberos_keytab\n";
+    }
+    print "DAFS fileserver        : ", $with_dafs ? "yes" : "no", "\n";
+    print "ptserver options       : $options_ptserver\n";
+    print "vlserver options       : $options_vlserver\n";
+    print "fileserver options     : $options_fileserver\n";
+    print "volserver options      : $options_volserver\n";
+    print "salvagerserver options : $options_salvageserver\n";
+    print "salvager options       : $options_salvager\n";
+    print "\n";
+  
+    $answer = prompt("Correct? (yes/no/quit)", "yes");
+    exit(0)          if $answer=~/^q/i;
+    redo get_options if $answer!~/^y/i;
   }
 
-  # Save the options for the next time.
-  $answer = prompt("Save as command-line options? (yes/no)", "yes");
+  # Save the options as a shell script for the next run.
+  $answer = prompt("Save these options? (yes/no)", "yes");
   if ($answer=~/^y/i ) {
-    my $switches = "";
-    $switches .= "--batch";
-    $switches .= " --debug"                                          if $debug;
-    $switches .= " --dont_unwind"                                    if $dont_unwind;
-    $switches .= " --ostype='$ostype'"                               if $ostype;
-    $switches .= " --server='$server'"                               if $server;
-    $switches .= " --cellname='$cellname'"                           if $cellname;
-    $switches .= " --partition='$partition'"                         if $partition;
-    $switches .= " --admin='$admin'"                                 if $admin;
-    $switches .= " --kerberos-type='$kerberos_type'"                 if $kerberos_type;
-    $switches .= " --kerberos-realm='$kerberos_realm'"               if $kerberos_realm;
-    $switches .= " --kerberos-keytab='$kerberos_keytab'"             if $kerberos_keytab;
-    $switches .= " --skip-make-keyfile"                              if $skip_make_keyfile;
-    $switches .= " --with-dafs"                                      if $with_dafs;
-    $switches .= " --options-fileserver='$options_fileserver'"       if $options_fileserver;
-    $switches .= " --options-volserver='$options_volserver'"         if $options_volserver;;
-    $switches .= " --options-salvageserver='$options_salvageserver'" if $options_salvageserver;;
-    $switches .= " --options-salvager='$options_salvager'"           if $options_salvager;
+    my $script = '';
+    get_script_name: {
+      $script = prompt("File name for save?", "run-afs-newcell.sh");
+      last get_script_name if ! -f $script;
+
+      $answer = prompt("File $script already exists. Overwrite? (yes/no/quit)", "no");
+      exit(0)              if $answer=~/^q/i;
+      last get_script_name if $answer=~/^yes/i;
+      redo get_script_name;
+    }
+
+    my @switches = ();
+    push(@switches, "--batch"); # automatically added to the script
+    push(@switches, "--debug")                                          if $debug;
+    push(@switches, "--nounwind")                                       unless $unwind;
+    push(@switches, "--server='$server'")                               if $server;
+    push(@switches, "--cellname='$cellname'")                           if $cellname;
+    push(@switches, "--partition='$partition'")                         if $partition;
+    push(@switches, "--admin='$admin'")                                 if $admin;
+    push(@switches, "--kerberos-type='$kerberos_type'")                 if $kerberos_type;
+    push(@switches, "--kerberos-realm='$kerberos_realm'")               if $kerberos_realm;
+    push(@switches, "--kerberos-keytab='$kerberos_keytab'")             if $kerberos_keytab;
+    push(@switches, "--with-dafs")                                      if $with_dafs;
+    push(@switches, "--options-ptserver='$options_ptserver'")           if $options_ptserver;
+    push(@switches, "--options-vlserver='$options_vlserver'")           if $options_vlserver;
+    push(@switches, "--options-fileserver='$options_fileserver'")       if $options_fileserver;
+    push(@switches, "--options-volserver='$options_volserver'")         if $options_volserver;;
+    push(@switches, "--options-salvageserver='$options_salvageserver'") if $options_salvageserver;;
+    push(@switches, "--options-salvager='$options_salvager'")           if $options_salvager;
   
-    my $conf = prompt("Filename for save?", "afs-newcell.conf");
-    open(CONF, "> $conf") or die "error: Cannot open file $conf: $!\n";
-    print CONF "$switches\n";
-    close CONF;
+    open(SCRIPT, "> $script") or die "error: Cannot open file $script: $!\n";
+    print SCRIPT "#!/bin/sh\n";
+    print SCRIPT "perl afs-newcell.pl \\\n";
+    print SCRIPT join(" \\\n", map("  $_", @switches));
+    print SCRIPT "\n\n";
+    close SCRIPT;
+    chmod(0755, $script);
   }
 }
 
@@ -358,9 +423,8 @@ if ($debug) {
   print "debug: afs-newcell options\n";
   print "debug:  \$batch = '$batch'\n";
   print "debug:  \$debug = '$debug'\n";
-  print "debug:  \$dont_unwind = '$dont_unwind'\n";
+  print "debug:  \$unwind = '$unwind'\n";
   print "debug:  \$help = '$help'\n";
-  print "debug:  \$ostype = '$ostype'\n";
   print "debug:  \$server = '$server'\n";
   print "debug:  \$cellname = '$cellname'\n";
   print "debug:  \$partition = '$partition'\n";
@@ -368,51 +432,77 @@ if ($debug) {
   print "debug:  \$kerberos_type = '$kerberos_type'\n";
   print "debug:  \$kerberos_realm = '$kerberos_realm'\n";
   print "debug:  \$kerberos_keytab = '$kerberos_keytab'\n";
-  print "debug:  \$skip_make_keyfile = '$skip_make_keyfile'\n";
   print "debug:  \$with_dafs = '$with_dafs'\n";
+  print "debug:  \$options_pteserver = '$options_ptserver'\n";
+  print "debug:  \$options_pteserver = '$options_vlserver'\n";
   print "debug:  \$options_fileserver = '$options_fileserver'\n";
   print "debug:  \$options_volserver = '$options_volserver'\n";
   print "debug:  \$options_salvageserver = '$options_salvageserver'\n";
   print "debug:  \$options_salvager = '$options_salvager'\n";
 }
 
-# 
-# Create an auth object for the type of kerberos
-# to be used for authentication in our cell.
+
+#-----------------------------------------------------------------------------
+# Prereq: Sanity check the forward and reverse name resolution.
+#
+if ($server eq 'localhost') {
+  die "error: localhost is not a valid --server parameter. Use the ip hostname of this machine.\n";
+}
+my $packed_ip = gethostbyname($server);
+unless (defined $packed_ip) {
+  die "error: gethostbyname failed, $?\n";
+}
+my $ip_from_name = inet_ntoa($packed_ip);
+print "debug: $server ip address is $ip_from_name\n" if $debug;
+if ($ip_from_name=~/^127/) {
+  die "error: Loopback address $ip_from_name cannot not be used for server $server. Check your /etc/hosts file.\n";
+}
+
+my $name_from_ip  = gethostbyaddr($packed_ip, AF_INET);
+print "debug: hostname of $ip_from_name is $name_from_ip\n" if $debug;
+if ($name_from_ip ne $server) {
+  die "error: Name from ip $name_from_ip does not match ip from name $ip_from_name for --server $server. ".
+      " Use the correct --server parameter and verify forward and reverse name resolution is working.\n";
+}
+
+#-----------------------------------------------------------------------------
+# Prereq: The vice partition must be available and empty.
 #
+unless ($partition=~/^(([a-z])|([a-h][a-z])|([i][a-v]))$/) {
+  die "error: Invalid partition id specified: $partition. Valid values are a..z and aa..iv\n";
+}
+unless ( -d "/vicep$partition" ) {
+  die "error: Missing fileserver partition, /vicep$partition\n";
+}
+if ( -d "/vicep$partition/AFSIDat" ) {
+  die "error: Fileserver partition is not empty. /vicep$partition/AFSIDat needs to be removed.\n";
+}
+open(LS, "ls /vicep$partition |") or 
+  die "error: ls /vicep$partition failed, $!\n";
+while (<LS>) {
+  chomp;
+  if (/^V\d+.vol$/) {
+    die "error: Fileserver partition, /vicep$partition, is not empty.\n";
+  }
+}
+close LS;
+
+# Prereq: authorization and platform specific objects.
 my $auth = OpenAFS::Auth::create(
       'debug'=>$debug,
       'type'=>$kerberos_type, 
       'cell'=>$cellname,
       'realm'=>$kerberos_realm,
       'keytab'=>$kerberos_keytab,
+      'admin'=>$admin,
       );
 
 my $os = OpenAFS::OS::create(
       'debug'=>$debug,
-      'ostype'=>$ostype,
       );
 
-#
-# Sanity checks before we begin. Make sure we have correct
-# binaries, directories, and permissions.
-#
-
-my $bosserver = "$path->{'afssrvsbindir'}/bosserver";
-my $bos       = "$path->{'afssrvbindir'}/bos";
-my $fs        = "$path->{'afssrvbindir'}/fs";
-my $pts       = "$path->{'afssrvbindir'}/pts";
-my $vos       = "$path->{'afssrvsbindir'}/vos";
-
-check_program($bosserver);
-check_program($bos);
-check_program($fs);
-check_program($pts);
-check_program($vos);
-
-
-#
-# Sanity check admin username and convert kerberos 5 notation to afs.
+#-----------------------------------------------------------------------------
+# Prereq: Sanity check admin username and convert kerberos 5 notation to afs.
 #
 if ($admin =~ /@/) {
    die "error: Please specify the username without the realm name.\n";
@@ -420,20 +510,51 @@ if ($admin =~ /@/) {
 my $username = $admin;
 $username=~s:/:.:g;   # convert kerberos separators to afs separators.
 
-# Shutdown the client and server, if running.
+#-----------------------------------------------------------------------------
+# Prereq: Save the paths and setup configuration in a form that is easily
+# read by the shell scripts.
+#
+open(CONF, "> dirpath.conf") or die "error: Cannot open file dirpath.conf for writing: $!\n";
+my ($n, $v);
+while(($n,$v)=each(%{$path})) {
+  print CONF "$n=$v\n";
+}
+close CONF;
+open(CONF, "> run-tests.conf") or die "error: Cannot open file run-tests.conf for writing: $!\n";
+  print CONF <<"__CONF__";
+CELLNAME=$cellname
+PARTITION=$partition
+ADMIN=$admin
+KERBEROS_TYPE=$kerberos_type
+KERBEROS_REALM=$kerberos_realm
+KERBEROS_KEYTAB=$kerberos_keytab
+__CONF__
+close CONF;
+
+unless ($batch) {
+  my $answer = prompt("Last chance to cancel before setup begins. Continue? (yes/no)", "yes");
+  exit(0) unless $answer=~/^y/i;
+}
+
+#-----------------------------------------------------------------------------
+# Prereq: Shutdown the client and server, if running.
+#
 run($os->command('client-stop'));
 run($os->command('fileserver-stop'));
 
+#-----------------------------------------------------------------------------
+# Prereq: Verify the server processes are not running.
 #
-# Attempt the client setup for this system before we try to create the cell.
-#
-$os->configure_client();
+foreach my $program ('bosserver', 'ptserver', 'vlserver', 'kaserver', 'fileserver') {
+  die "error: program is already running, $program\n" if $os->number_running($program);
+}
 
-#
-# Create the initial server configuration and the server administrator, temporarily running
-# with -noauth.
-#
+#-----------------------------------------------------------------------------
+# Perform Platform-Specific Procedures
+$os->configure_client();
 
+#-----------------------------------------------------------------------------
+# WORKAROUND:
 # bosserver attempts to create the following directories with these limited 
 # permissions. However, bosserver does not create parent directories as needed, so
 # the directories are not successfully created when they are more than one level
@@ -451,158 +572,219 @@ run("chmod 0700 $path->{'afsdbdir'}");
 run("chmod 0755 $path->{'afslogsdir'}"); 
 run("chmod 0777 $path->{'viceetcdir'}");
 
+#-----------------------------------------------------------------------------
+# Starting the BOS Server
+#
+# Start the bosserver and create the initial server configuration.
+# Authorization is disabled by the -noauth flag.
+#
 print "debug: Starting bosserver...\n" if $debug;
 run("$path->{'afssrvsbindir'}/bosserver -noauth");
+if ($unwind) {
     unwind($os->command('remove', "$path->{'afsconfdir'}/ThisCell"));
     unwind($os->command('remove', "$path->{'afsconfdir'}/CellServDB"));
     unwind($os->command('remove', "$path->{'afsconfdir'}/UserList"));
     unwind($os->command('remove', "$path->{'afsbosconfigdir'}/BosConfig"));
     unwind($os->command('fileserver-stop'));
+}
+sleep(10); # allow bosserver some time to start accepting connections...
 
-run("$bos setcellname $server $cellname -localauth");
-run("$bos addhost $server $server -localauth");
-run("$bos adduser $server $username -localauth");
-    unwind("$bos removeuser $server $username -localauth");
-
+#-----------------------------------------------------------------------------
+# Defining Cell Name and Membership for Server Processes
 #
-# Create the AFS KeyFile. (This must be done after bosserver creates the configuration files.)
-#
-unless ($skip_make_keyfile) {
-  print "debug: Making the keyfile...\n" if $debug;
-  $auth->make_keyfile();
-}
-unless ( -f "$path->{'afsconfdir'}/KeyFile") {
-  die "You do not have an AFS keyfile.  Please create this using asetkey or the bos addkey command.\n";
+run("$bos setcellname $server $cellname -noauth");
+run("$bos addhost $server $server -noauth");
+run("$bos adduser $server $username -noauth");
+if ($unwind) {
+    unwind("$bos removeuser $server $username -noauth");
 }
 
-# make the krb.conf file if the realm name is different than the cell name.
-$auth->make_krb_config();
+# WORKAROUND:
+# The initial bosserver startup may create CellServDB entry which does
+# not match the host name retured by gethostbyaddr(). This entry will
+# cause ptserver/vlserver quorum errors and so is removed.
+open(HOSTS, "$bos listhosts $server |") or 
+  die "error: failed to run bos listhosts, $?\n";
+my @hosts = <HOSTS>;
+close HOSTS;
+foreach (@hosts) {
+  chomp;
+  if (/^\s+Host \d+ is (.*)/) {
+    my $host = $1;
+    print "debug: bos listhosts: host=[$host]\n" if $debug; 
+    if ($host ne $name_from_ip) {
+      print "debug: removing invalid host '$host' from CellServDB.\n" if $debug;
+      run("$bos removehost $server $host -noauth");
+    }
+  }
+}
 
-#
-# Start up the ptserver and vlserver.
+#-----------------------------------------------------------------------------
+# Starting the Database Server Processes
 #
 print "debug: Starting the ptserver and vlserver...\n" if $debug;
-run("$bos create $server ptserver simple $path->{'afssrvlibexecdir'}/ptserver -localauth");
+run("$bos create $server ptserver simple -cmd \"$path->{'afssrvlibexecdir'}/ptserver $options_ptserver\" -noauth"); 
+if ($unwind) {
     unwind($os->command('remove', "$path->{'afsdbdir'}/prdb.DB0"));
     unwind($os->command('remove', "$path->{'afsdbdir'}/prdb.DBSYS1"));
-    unwind("$bos delete $server ptserver -localauth");
-    unwind("$bos stop $server ptserver -localauth");
+    unwind("$bos delete $server ptserver -noauth");
+    unwind("$bos stop $server ptserver -noauth");
+}
 
-run("$path->{'afssrvbindir'}/bos create $server vlserver simple $path->{'afssrvlibexecdir'}/vlserver -localauth");
+run("$bos create $server vlserver simple -cmd \"$path->{'afssrvlibexecdir'}/vlserver $options_vlserver\" -noauth");
+if ($unwind) {
     unwind($os->command('remove', "$path->{'afsdbdir'}/vldb.DB0"));
     unwind($os->command('remove', "$path->{'afsdbdir'}/vldb.DBSYS1"));
-    unwind("$bos delete $server vlserver -localauth");
-    unwind("$bos stop $server vlserver -localauth");
+    unwind("$bos delete $server vlserver -noauth");
+    unwind("$bos stop $server vlserver -noauth");
+}
+
+if ($kerberos_type =~ /kaserver/i) {
+  print "warning: kaserver is deprecated!\n";
+  run("$bos create $server kaserver simple -cmd \"$path->{'afssrvlibexecdir'}/kaserver $options_vlserver\" -noauth");
+  if ($unwind) {
+    unwind($os->command('remove', "$path->{'afsdbdir'}/kaserver.DB0"));
+    unwind($os->command('remove', "$path->{'afsdbdir'}/kaserver.DBSYS1"));
+    unwind("$bos delete $server kaserver -noauth");
+    unwind("$bos stop $server kaserver -noauth");
+  }
+}
 
+sleep(10); # to allow the database servers to start servicing requests.
+
+#-----------------------------------------------------------------------------
+# Initializing Cell Security
 #
-# Start the file server.
+# Create the AFS administrative account and the AFS server encryption key.
+# Make the krb.conf file if the realm name is different than the cell name.
+
+$auth->make_krb_config();
+$auth->make_keyfile();
+unless ( -f "$path->{'afsconfdir'}/KeyFile") {
+  die "Failed to create $path->{'afsconfdir'}/KeyFile. Please create this using asetkey or the bos addkey command.\n";
+}
+
+print "debug: Creating admin user...\n" if $debug;
+run("$pts createuser -name $username -cell $cellname -noauth");
+run("$pts adduser $username system:administrators -cell $cellname -noauth");
+run("$pts membership $username -cell $cellname -noauth");
+
+print "debug: Restarting the database servers to use the new encryption key.\n" if $debug;
+run("$bos restart $server -all -noauth");
+sleep(10); # to allow the database servers to start servicing requests.
+
+#-----------------------------------------------------------------------------
+# Starting the File Server, Volume Server, and Salvager
 #
 print "debug: Starting the fileserver...\n" if $debug;
 if ($with_dafs) {
   run( "$bos create $server dafs dafs ".
-       "-cmd $path->{'afssrvlibexecdir'}/fileserver $options_fileserver ".
-       "-cmd $path->{'afssrvlibexecdir'}/volserver $options_volserver ".
-       "-cmd $path->{'afssrvlibexecdir'}/salvageserver $options_salvageserver".
-       "-cmd $path->{'afssrvlibexecdir'}/salvager $options_salvager".
-     "-localauth");
+       "-cmd \"$path->{'afssrvlibexecdir'}/fileserver $options_fileserver\" ".
+       "-cmd \"$path->{'afssrvlibexecdir'}/volserver $options_volserver\"".
+       "-cmd \"$path->{'afssrvlibexecdir'}/salvageserver $options_salvageserver\" ".
+       "-cmd \"$path->{'afssrvlibexecdir'}/salvager $options_salvager\" ".
+       "-noauth");
+  if ($unwind) {
+    unwind("$bos delete $server dafs -noauth");
+    unwind("$bos stop $server dafs -noauth");
+  }
 }
 else {
   run( "$bos create $server fs fs ".
-       "-cmd $path->{'afssrvlibexecdir'}/fileserver $options_fileserver ".
-       "-cmd $path->{'afssrvlibexecdir'}/volserver $options_volserver ".
-       "-cmd $path->{'afssrvlibexecdir'}/salvager $options_salvager ".
-     "-localauth");
+       "-cmd \"$path->{'afssrvlibexecdir'}/fileserver $options_fileserver\" ".
+       "-cmd \"$path->{'afssrvlibexecdir'}/volserver $options_volserver\" ".
+       "-cmd \"$path->{'afssrvlibexecdir'}/salvager $options_salvager\" ".
+       "-noauth");
+  if ($unwind) {
+    unwind("$bos delete $server fs -noauth");
+    unwind("$bos stop $server fs -noauth");
+  }
 }
-  unwind("$bos delete $server fs -localauth ");
-  unwind("$bos stop $server fs -localauth ");
 
-#
-# Create the AFS administrator (with the same name as the server administrator).
-#
-print "debug: Creating users...\n" if $debug;
-sleep(10); # wait to avoid "no quorum elected" errors.
-
-run("$pts createuser -name $username -cell $cellname -noauth");
-run("$pts adduser $username system:administrators -cell $cellname -noauth");
-run("$pts membership $username -cell $cellname -noauth");
-
-#
-# Create the root afs volume.
-#
+# Create the root.afs volume.
 print "debug: Creating root.afs volume...\n" if $debug;
 run("$vos create $server $partition root.afs -cell $cellname -noauth");
+if ($unwind) {
     unwind($os->command('remove', "$partition/AFSIDat "));
     unwind($os->command('remove', "$partition/V*.vol"));
     unwind($os->command('remove', "$partition/Lock"));
-    unwind("$vos remove $server $partition root.afs -cell $cellname -noauth");
-
-# The initial configuration is done, turn on authorization checking.
-#run("$bos setauth $server -authrequired on -cell $cellname -localauth");
-#    unwind("$bos setauth $server -authrequired off -cell $cellname -localauth");
-
+    unwind("$vos remove $server $partition root.afs -cell $cellname -localauth");
+}
 
-#
-# Bring up the AFS client.
+#-----------------------------------------------------------------------------
+# Installing Client Functionality
 #
 print "debug: Starting the OpenAFS client...\n" if $debug;
 run($os->command('client-start'));
+if ($unwind) {
     unwind($os->command('client-stop'));
+}
 
-#
 # Run as the administrator.
-#
-$auth->authorize($admin);
+$auth->authorize();
 
+#-----------------------------------------------------------------------------
+# Configuring the Top Levels of the AFS Filespace
 #
-# Create the root cell volumes, read-only and read-write.
-#
-print "debug: Creating the root volumes...\n" if $debug;
+print "debug: Creating the volumes...\n" if $debug;
 run("$fs setacl /afs system:anyuser rl");
 
-run("$vos create $server $partition root.cell -localauth");
+run("$vos create $server $partition root.cell");
+if ($unwind) {
     unwind("$vos remove $server $partition root.cell -localauth");
+}
 
 run("$fs mkmount /afs/$cellname root.cell -cell $cellname -fast");
+if ($unwind) {
     unwind("$fs rmmount /afs/$cellname");
+}
 
 run("$fs setacl /afs/$cellname system:anyuser rl");
 run("$fs mkmount /afs/.$cellname root.cell -cell $cellname -rw");
+if ($unwind) {
     unwind("$fs rmmount /afs/.$cellname");
+}
 
-#run("$fs mkmount /afs/.root.afs root.afs -rw");
-#    unwind("$fs rmmmount /afs/.root.afs");
+run("$fs examine /afs");
+run("$fs examine /afs/$cellname");
 
-#
-# Create some volumes in our new cell.
-#
-print "debug: Creating the test volumes...\n" if $debug;
-mkvol("user", "/afs/$cellname/user", $server, $partition);
-mkvol("service", "/afs/$cellname/service", $server, $partition);
-mkvol("unrep", "/afs/$cellname/unreplicated", $server, $partition);
+run("$vos addsite $server $partition root.afs");
+run("$vos addsite $server $partition root.cell");
+run("$vos release root.cell");
+run("$vos release root.afs");
 
-# make a read-only volume
-mkvol("rep", "/afs/$cellname/.replicated", $server, $partition);
-run("$fs mkmount /afs/$cellname/replicated rep.readonly");
-run("$vos addsite $server $partition rep -localauth");
-run("$vos release rep -localauth");
-    unwind("$vos remove $server $partition rep.readonly -localauth");
+run("$fs checkvolumes"); # so client notices the releases
+print "debug: the following should show root.afs.readonly\n" if $debug;
+run("$fs examine /afs");
+print "debug: the following should show root.cell.readonly\n" if $debug;
+run("$fs examine /afs/$cellname");
+print "debug: the following should show root.cell\n" if $debug;
+run("$fs examine /afs/.$cellname");
 
+# Create some volumes in our new cell.
+print "debug: Creating the test volumes...\n" if $debug;
+mkvol("user",    "/afs/.$cellname/user",         $server, $partition);
+mkvol("service", "/afs/.$cellname/service",      $server, $partition);
+mkvol("unrep",   "/afs/.$cellname/unreplicated", $server, $partition);
+mkvol("rep",     "/afs/.$cellname/replicated",   $server, $partition);
+
+run("$vos addsite $server $partition rep");
+if ($unwind) {
+    unwind("$vos remsite $server $partition rep");
+}
+run("$vos release rep");
+run("$fs mkmount /afs/.$cellname/.replicated rep -rw");
+run("$fs setacl  /afs/.$cellname/.replicated system:anyuser rl");
 
-#
-# Create readonly volumes of our roots.
-#
-run("$vos addsite $server $partition root.afs -localauth");
-run("$vos addsite $server $partition root.cell -localauth");
-run("$vos release root.afs -localauth");
-run("$vos release root.cell -localauth");
-    unwind("$vos remove $server $partition root.cell.readonly -localauth");
-    unwind("$vos remove $server $partition root.afs.readonly -localauth");
+# Show the new volumes in the read-only path.
+run("$vos release root.cell"); 
 
 # done.
 @unwinds = (); # clear unwinds
+print "info: DONE\n";
 
 END {
-  if (!$dont_unwind && scalar @unwinds) {
+  if ($unwind && scalar @unwinds) {
     print "\ninfo: Error encountered, unwinding...\n"; 
     while (@unwinds) {
       eval { 
index 7e0550fae0fe070cebb9163370efb44c1e5747a4..92d8c69e7c8ee5f9540d610012afebc142a971ad 100644 (file)
@@ -65,10 +65,12 @@ unless ($partition_id=~/^(([a-z])|([a-h][a-z])|([i][a-v]))$/) {
 
 unless ($batch) {
   my $rl = new Term::ReadLine('afs-rmcell');
-  print "\n*** WARNING!! WARNING!! WARNING!! *** \n";
-  print "You are about to permanently DESTROY the OpenAFS configuration, database, and volumes on this machine!\n\n";
-  my $answer = $rl->readline("Do you really want to destroy the AFS cell data? (y/n) [n] ");
-  unless ($answer=~/^y/i ) {
+  print "\n***  WARNING !!   WARNING !!   WARNING !!  *** \n\n";
+  print "You are about to permanently DESTROY the OpenAFS\n";
+  print "configuration, databases, and volumes on this machine!\n";
+  my $answer = $rl->readline("Do you really want to destroy the AFS cell? (destroy/no) [no] ");
+  unless ($answer eq "destroy" ) {
+    print "info: must answer 'destroy' to continue.\n" if $answer!~/^n/i;
     print "info: Aborted.\n";
     exit 0;
   }
@@ -87,6 +89,8 @@ $os->remove("$path->{'afsdbdir'}/prdb.DB0");
 $os->remove("$path->{'afsdbdir'}/prdb.DBSYS1");
 $os->remove("$path->{'afsdbdir'}/vldb.DB0");
 $os->remove("$path->{'afsdbdir'}/vldb.DBSYS1");
+$os->remove("$path->{'afsdbdir'}/kaserver.DB0");
+$os->remove("$path->{'afsdbdir'}/kaserver.DBSYS1");
 $os->remove("$path->{'afsbosconfigdir'}/BosConfig");
 $os->remove("$path->{'afslogsdir'}/*");
 $os->remove("$path->{'afslocaldir'}/*");
@@ -95,6 +99,8 @@ $os->remove("$path->{'afsconfdir'}/ThisCell");
 $os->remove("$path->{'afsconfdir'}/CellServDB");
 $os->remove("$path->{'afsconfdir'}/KeyFile");
 $os->remove("$path->{'afsconfdir'}/krb.conf");
+$os->remove("$path->{'afsddir'}/ThisCell");
+$os->remove("$path->{'afsddir'}/CellServDB");
 $os->remove("/vicep$partition_id/AFSIDat ");
 $os->remove("/vicep$partition_id/V*.vol");
 $os->remove("/vicep$partition_id/Lock");
index 375c9e36b199064b114d3fd9b4503bcdef24972e..02d62bec0a4afad8d5559bf40d3b619b485466d7 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $Id: run-tests.in,v 1.5.8.1 2008/01/21 19:50:32 shadow Exp $
+# $Id: run-tests.in,v 1.5.8.2 2008/03/31 15:53:48 shadow Exp $
 #
 
 # Directory paths configured during the build.
@@ -8,10 +8,13 @@ if test -f dirpath.conf; then
   . dirpath.conf
 else
   echo "error: Missing dirpath.conf file, try make dirpath.conf"
+  exit 1
 fi
 
-if test -f run-test.conf; then
-  . run-test.conf
+if test -f run-tests.conf; then
+  . run-tests.conf
+else
+  echo "warning: Missing run-tests.conf, using default values."
 fi  
 
 
@@ -324,7 +327,7 @@ do
   -help|--help) echo $usage; 
        echo "tests available: $linebreak"; for a in "$ALL_TESTS"; do echo $a ; done;
        exit 0;;
-  -version|--version) echo "$0 $Id: run-tests.in,v 1.5.8.1 2008/01/21 19:50:32 shadow Exp $"; exit 0;;
+  -version|--version) echo "$0 $Id: run-tests.in,v 1.5.8.2 2008/03/31 15:53:48 shadow Exp $"; exit 0;;
   -*) echo "$0: Bad option $1"; echo $usage; exit 1;;
   *) break;;
   esac
@@ -372,6 +375,12 @@ objdir=`cd $objdir; pwd`
 export srcdir
 export objdir
 
+# login
+if [ "$KERBEROS_TYPE" != "kaserver" ] ; then
+  kinit -k -t $KERBEROS_KEYTAB $ADMIN || exit 1;
+  $afswsbindir/aklog -d -c $CELLNAME || exit 1;
+fi
+
 echo "-------------------------------------------------"
 echo "$PACKAGE-$VERSION"
 echo "hosttype $host"
@@ -401,6 +410,10 @@ for a in $RUNTESTS; do
   else
     b="${objdir}/$a"
   fi
+  if test "`echo $a | cut -c1`" = "#" ; then  # tests to skip
+    echo "Skipping $a"
+    continue
+  fi
   echo "Running $a"
   test "X$VERBOSE" != "X" && echo "Running test $a ($b)."
   if test "$a" = "setgroups" ; then
index 464cc2dcfd76b2aa13b21ca85c2844f71427a2c3..e63dc4937019af2493e5a54f5dcef91c21389f8e 100644 (file)
@@ -11,7 +11,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/vlserver/vlserver.c,v 1.18.2.11 2008/03/10 22:35:37 shadow Exp $");
+    ("$Header: /cvs/openafs/src/vlserver/vlserver.c,v 1.18.2.12 2008/04/01 16:55:41 shadow Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -85,7 +85,7 @@ CheckSignal(void *unused)
 
     if (errorcode =
        Init_VLdbase(&trans, LOCKREAD, VLGETSTATS - VL_LOWEST_OPCODE))
-       return errorcode;
+       return (void *)errorcode;
     VLog(0, ("Dump name hash table out\n"));
     for (i = 0; i < HASHSIZE; i++) {
        HashNDump(trans, i);
index fd104c6e3a901718848cbcb9cdd393dd0647ef10..967cbdf854a8b655f692e1355f81cb4f20422ba9 100644 (file)
@@ -51,7 +51,7 @@ static int newVLDB = 1;
 #include <afs/afsutil.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/vol/Attic/fssync.c,v 1.26.2.9 2008/03/21 16:59:26 shadow Exp $");
+    ("$Header: /cvs/openafs/src/vol/Attic/fssync.c,v 1.26.2.10 2008/04/01 20:05:47 shadow Exp $");
 
 #include <sys/types.h>
 #include <stdio.h>
@@ -102,11 +102,6 @@ RCSID
 
 /*@printflike@*/ extern void Log(const char *format, ...);
 
-#ifdef osi_Assert
-#undef osi_Assert
-#endif
-#define osi_Assert(e) (void)(e)
-
 int (*V_BreakVolumeCallbacks) ();
 
 #define MAXHANDLERS    4       /* Up to 4 clients; must be at least 2, so that