afsio: rewrite using libafscp

afsio is a utility for file transfer to and from AFS file space
without the help of the AFS client/cache manager.  Using libafscp,
this (partially rewritten) version of afsio is able to accomplish
(1) authenticated access to an AFS path or FID (an existing
KerberosV ticket is required), (2) fall back on unauthenticated
("anonymous") access if authentication (token acquisition) fails,
and (3) work independtly of the AFS cache manager (afsd need not
be running, though CellServDB and ThisCell are currently required).

issues:
1) libvldbint and libafsint are not compiled pthreaded. we link in
what we need. this should be changed when we are all-pthreaded.
2) venus is not a pthreaded-directory otherwise. same deal:
in an all-pthreaded universe, undo the bodge that we do here.
3) venus is not an all-krb5 directory either. slight ick.

Change-Id: I946e6eef58ac77c6fb97be256c4c564188201262
Reviewed-on: http://gerrit.openafs.org/4381
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Chaz Chandler 2010-07-20 10:25:20 -04:00 committed by Derrick Brashear
parent 44f13d8feb
commit 94d44d59e3
5 changed files with 751 additions and 1231 deletions

View File

@ -349,7 +349,7 @@ dvolser: project tviced usd libafsrpc libafsauthent volser
rxosdsrc: rxgen
+${COMPILE_PART1} rxosd ${COMPILE_PART2A} source
venus: cmd comerr volser ptserver
venus: cmd comerr volser ptserver libafscp
+${COMPILE_PART1} venus ${COMPILE_PART2}
+${COMPILE_PART1} venus/test ${COMPILE_PART2}

View File

@ -68,6 +68,13 @@ afsreg_headers:
$(NTMAKE_HEADERS)
$(CD) ..\..\..
libafscp_headers:
@echo ***** $@
$(DOCD) $(SRC)\libafscp
$(CD) $(SRC)\libafscp
$(NTMAKE_HEADERS)
$(CD) ..\..\..
lwp_headers:
@echo ***** $@
$(DOCD) $(SRC)\lwp
@ -676,7 +683,7 @@ rpctestlib: fsint libafsrpc
$(NTMAKE)
$(CD) ..\..
libafscp: util afs volser vlserver rx auth fsint afsdobjs
libafscp: libafscp_headers util afs volser vlserver rx auth fsint afsdobjs
@echo ***** $@
$(DOCD) $(SRC)\$@
$(CD) $(SRC)\$@

View File

@ -388,7 +388,6 @@ EXELIBS3 = \
$(DESTDIR)\lib\afshcrypto.lib \
$(DESTDIR)\lib\afsroken.lib
# klog.exe
$(EXEDIR)\klog.exe: $(OUT)\cklog.obj $(OUT)\klog.res $(EXELIBS)
$(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
@ -462,7 +461,7 @@ $(EXEDIR)\fs.exe: $(FSOBJS) $(OUT)\fs.res $(EXELIBS)
$(SYMSTORE_IMPORT)
# cmdebug.exe
$(EXEDIR)\cmdebug.exe: $(CMDBGOBJS) $(OUT)\cmdebug.res $(EXELIBS2)
$(EXEDIR)\cmdebug.exe: $(CMDBGOBJS) $(OUT)\cmdebug.res
$(EXECONLINK) $(EXELIBS2) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib rpcrt4.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
@ -470,8 +469,25 @@ $(EXEDIR)\cmdebug.exe: $(CMDBGOBJS) $(OUT)\cmdebug.res $(EXELIBS2)
$(SYMSTORE_IMPORT)
# afsio.exe
$(EXEDIR)\afsio.exe: $(AFSIOOBJS) $(OUT)\afsio.res $(RXOBJS) $(AFSD_EXELIBS) $(EXELIBS3)
$(EXECONLINK) $(RXOBJS) $(AFSD_EXELIBS) $(EXELIBS3) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib rpcrt4.lib
AFSCPLIB = \
$(DESTDIR)\lib\afs\afscp.lib
!IF "$(CPU)" == "IA64" || "$(CPU)" == "AMD64" || "$(CPU)" == "ALPHA64"
KFWLIBS = \
..\kfw\lib\$(CPU)\krb5_64.lib \
..\kfw\lib\$(CPU)\comerr64.lib \
dnsapi.lib mpr.lib delayimp.lib
LINKOPTS = /DELAYLOAD:krb5_64.dll /DELAYLOAD:comerr64.dll
!else
KFWLIBS = \
..\kfw\lib\$(CPU)\krb5_32.lib \
..\kfw\lib\$(CPU)\comerr32.lib \
dnsapi.lib mpr.lib delayimp.lib
LINKOPTS = /DELAYLOAD:krbv4w32.dll /DELAYLOAD:krb5_32.dll /DELAYLOAD:comerr32.dll
!endif
$(EXEDIR)\afsio.exe: $(AFSIOOBJS) $(OUT)\afsio.res $(RXOBJS) $(AFSD_EXELIBS) $(EXELIBS3) $(AFSCPLIB)
$(EXECONLINK) $(KFWLIBS) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib rpcrt4.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
$(CODESIGN_USERLAND)

View File

@ -13,11 +13,28 @@ INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
KRB5CFLAGS = @KRB5_CPPFLAGS@
KRB5LIBS = @KRB5_LIBS@
INCLS=${TOP_INCDIR}/afs/afsint.h \
${TOP_INCDIR}/afs/cmd.h \
${TOP_INCDIR}/afs/afsutil.h
AFSIO_INCLS=${TOP_INCDIR}/afs/afsint.h \
${TOP_INCDIR}/afs/cmd.h \
${TOP_INCDIR}/afs/auth.h \
${TOP_INCDIR}/afs/vlserver.h \
${TOP_INCDIR}/afs/ihandle.h \
${TOP_INCDIR}/afs/com_err.h \
${TOP_INCDIR}/afs/afscp.h \
${TOP_INCDIR}/afs/afsutil.h
AFSIO_LIBS=${TOP_LIBDIR}/libafscp.a \
${TOP_LIBDIR}/libafsauthent.a \
${TOP_LIBDIR}/libafsrpc.a \
${TOP_LIBDIR}/libcmd.a \
$(TOP_LIBDIR)/libafsutil.a
FSLIBS=${TOP_LIBDIR}/libsys.a \
${TOP_LIBDIR}/libvldb.a \
${TOP_LIBDIR}/libubik.a \
@ -47,7 +64,7 @@ CMLIBS=${TOP_LIBDIR}/libsys.a \
LIBS = ${FSLIBS}
all: fs up fstrace cmdebug livesys kdump-build cacheout
all: fs up fstrace cmdebug livesys kdump-build cacheout afsio
#
# Build targets
@ -69,12 +86,22 @@ fs: fs.o $(LIBS)
$(AFS_LDRULE) fs.o ${TOP_LIBDIR}/libprot.a $(LIBS) \
$(LIB_roken) ${XLIBS}
afsio.o: afsio.c ${INCLS} AFS_component_version_number.c
afsio.o: afsio.c ${AFSIO_INCLS} AFS_component_version_number.c
${PTH_CCRULE} afsio.c
vldbint.cs.o: ${srcdir}/../vlserver/vldbint.cs.c
${PTH_CCRULE} ${srcdir}/../vlserver/vldbint.cs.c
vldbint.xdr.o: ${srcdir}/../vlserver/vldbint.xdr.c
${PTH_CCRULE} ${srcdir}/../vlserver/vldbint.xdr.c
afscbint.ss.o: ${srcdir}/../fsint/afscbint.ss.c
${PTH_CCRULE} ${srcdir}/../fsint/afscbint.ss.c
afsio: afsio.o $(LIBS)
$(AFS_LDRULE) afsio.o ${TOP_LIBDIR}/libprot.a \
${TOP_LIBDIR}/libafsint.a $(LIBS) \
$(LIB_roken) ${XLIBS}
afsio: afsio.o vldbint.cs.o afscbint.ss.o vldbint.xdr.o ${AFSIO_LIBS}
+if test "@BUILD_KRB5@" = "yes"; then \
$(MT_CC) @KRB5_CPPFLAGS@ $(PTH_LDFLAGS) $(AFS_CFLAGS) -o afsio afsio.o vldbint.cs.o afscbint.ss.o vldbint.xdr.o ${AFSIO_LIBS} \
$(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS} ${KRB5LIBS} ; \
else \
echo "Skipping afsio (KRB5 build disabled)" ; \
fi
livesys.o: livesys.c ${INCLS} AFS_component_version_number.c
@ -272,7 +299,7 @@ kdump-alpha_linux-@LINUX_VERSION@: kdump-alpha_linux-@LINUX_VERSION@.o
#
# Install targets
#
install: kdump-build fs livesys up fstrace cmdebug
install: kdump-build fs livesys up fstrace cmdebug afsio
${INSTALL} -d ${DESTDIR}${bindir}
${INSTALL} -d ${DESTDIR}${afssrvbindir}
${INSTALL} -d ${DESTDIR}${sbindir}
@ -282,6 +309,9 @@ install: kdump-build fs livesys up fstrace cmdebug
${INSTALL_PROGRAM} up ${DESTDIR}${bindir}/up
${INSTALL_PROGRAM} fstrace ${DESTDIR}${sbindir}/fstrace
${INSTALL_PROGRAM} cmdebug ${DESTDIR}${bindir}/cmdebug
if test "@BUILD_KRB5@" = "yes"; then \
${INSTALL_PROGRAM} afsio ${DESTDIR}${bindir}/afsio ; \
fi
-set -x; \
case ${SYS_NAME} in \
sgi_6? ) \
@ -310,7 +340,7 @@ install: kdump-build fs livesys up fstrace cmdebug
${INSTALL_PROGRAM} kdump64 ${DESTDIR}${sbindir}/kdump; \
fi
dest: kdump-build fs livesys up fstrace cmdebug
dest: kdump-build fs livesys up fstrace cmdebug afsio
${INSTALL} -d ${DEST}/bin
${INSTALL} -d ${DEST}/etc
${INSTALL} -d ${DEST}/root.server/usr/afs/bin
@ -320,6 +350,9 @@ dest: kdump-build fs livesys up fstrace cmdebug
${INSTALL_PROGRAM} up ${DEST}/bin/up
${INSTALL_PROGRAM} fstrace ${DEST}/etc/fstrace
${INSTALL_PROGRAM} cmdebug ${DEST}/bin/cmdebug
if test "@BUILD_KRB5@" = "yes"; then \
${INSTALL_PROGRAM} afsio ${DEST}/bin/afsio ; \
fi
-set -x; \
case ${SYS_NAME} in \
sgi_6? ) \
@ -360,7 +393,7 @@ dest: kdump-build fs livesys up fstrace cmdebug
clean:
$(RM) -f *.o *.a up fs kdump-* kdump kdump64 core cmdebug \
AFS_component_version_number.c fstrace gcpags livesys dedebug \
cacheout
cacheout afsio
test:
cd test; $(MAKE)

File diff suppressed because it is too large Load Diff