mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 06:50:12 +00:00
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.
Reviewed-on: http://gerrit.openafs.org/4381
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 94d44d59e3
)
Change-Id: Ibe140c58970f1b4f2f9e7f016e55d770f8cdcc09
Reviewed-on: http://gerrit.openafs.org/5383
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
parent
ac301978a0
commit
e475ca5410
@ -340,7 +340,7 @@ dvolser: project tviced usd libafsrpc libafsauthent volser
|
||||
echo Not building DAFS volser for ${SYS_NAME} ;; \
|
||||
esac
|
||||
|
||||
venus: cmd comerr volser ptserver
|
||||
venus: cmd comerr volser ptserver libafscp
|
||||
+${COMPILE_PART1} venus ${COMPILE_PART2}
|
||||
+${COMPILE_PART1} venus/test ${COMPILE_PART2}
|
||||
|
||||
|
11
NTMakefile
11
NTMakefile
@ -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
|
||||
@ -480,7 +487,7 @@ client_osi: license
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
afsd: client_osi
|
||||
afsd: client_osi libafscp
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
@ -648,7 +655,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)\$@
|
||||
|
@ -1248,6 +1248,7 @@ AC_CHECK_HEADERS(security/pam_modules.h ucontext.h regex.h sys/statvfs.h sys/sta
|
||||
AC_CHECK_HEADERS(linux/errqueue.h,,,[#include <linux/types.h>])
|
||||
AC_CHECK_HEADERS(et/com_err.h)
|
||||
AC_CHECK_HEADERS(ncurses.h curses.h)
|
||||
AC_CHECK_HEADERS(search.h)
|
||||
|
||||
AC_CHECK_TYPES([fsblkcnt_t],,,[
|
||||
#include <sys/types.h>
|
||||
@ -1297,7 +1298,7 @@ else
|
||||
fi
|
||||
AC_SUBST(BUILD_LOGIN)
|
||||
|
||||
AC_CHECK_FUNCS(snprintf strlcat strlcpy flock getrlimit)
|
||||
AC_CHECK_FUNCS(snprintf strlcat strlcpy flock getrlimit strnlen tsearch)
|
||||
AC_CHECK_FUNCS(setprogname getprogname sigaction mkstemp vsnprintf strerror strcasestr)
|
||||
AC_CHECK_FUNCS(setvbuf vsyslog getcwd)
|
||||
AC_CHECK_FUNCS(regcomp regexec regerror)
|
||||
|
@ -395,7 +395,6 @@ EXELIBS3 = \
|
||||
$(DESTDIR)\lib\afs\afscmd.lib \
|
||||
$(DESTDIR)\lib\afsrxkad.lib
|
||||
|
||||
|
||||
# klog.exe
|
||||
$(EXEDIR)\klog.exe: $(OUT)\cklog.obj $(OUT)\klog.res $(EXELIBS)
|
||||
$(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
|
||||
@ -468,7 +467,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)
|
||||
@ -476,8 +475,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)
|
||||
|
@ -64,6 +64,9 @@
|
||||
/* Define if you have the socket function. */
|
||||
#define HAVE_SOCKET
|
||||
|
||||
/* Define if you have the strnlen function. */
|
||||
#define HAVE_STRNLEN 1
|
||||
|
||||
/* Define if you have the <direct.h> header file. */
|
||||
#undef HAVE_DIRECT_H
|
||||
|
||||
|
@ -23,6 +23,7 @@ LIBOBJS = \
|
||||
afscp_init.o \
|
||||
afscp_util.o \
|
||||
afscp_dirops.o \
|
||||
afscp_roken.o \
|
||||
afscp_acl.o
|
||||
|
||||
all: \
|
||||
@ -30,6 +31,8 @@ all: \
|
||||
${TOP_LIBDIR}/libafscp.a \
|
||||
depinstall
|
||||
|
||||
afscp_roken.o: afscp_roken.c
|
||||
${CCRULE}
|
||||
afscp_callback.o: afscp_callback.c
|
||||
${CCRULE}
|
||||
afscp_server.o: afscp_server.c
|
||||
|
@ -35,6 +35,7 @@ LIBOBJS =\
|
||||
$(OUT)\afscp_init.obj \
|
||||
$(OUT)\afscp_util.obj \
|
||||
$(OUT)\afscp_dirops.obj \
|
||||
$(OUT)\afscp_roken.obj \
|
||||
$(OUT)\afscp_acl.obj \
|
||||
$(OUT)\AFS_component_version_number.obj
|
||||
|
||||
|
@ -27,7 +27,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <afsconfig.h>
|
||||
#include <afs/param.h>
|
||||
|
||||
#ifdef HAVE_SEARCH_H
|
||||
#include <search.h>
|
||||
#else
|
||||
#include "afscp_search.h"
|
||||
#endif
|
||||
|
||||
#include <afs/vlserver.h>
|
||||
#include <afs/vldbint.h>
|
||||
|
@ -27,7 +27,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <afsconfig.h>
|
||||
#include <afs/param.h>
|
||||
|
||||
#ifdef HAVE_SEARCH_H
|
||||
#include <search.h>
|
||||
#else
|
||||
#include "afscp_search.h"
|
||||
#endif
|
||||
|
||||
#include <afs/vlserver.h>
|
||||
#include <afs/vldbint.h>
|
||||
|
243
src/libafscp/afscp_roken.c
Normal file
243
src/libafscp/afscp_roken.c
Normal file
@ -0,0 +1,243 @@
|
||||
/*
|
||||
* Copyright (c) 1995 - 1999 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* this file can go away when roken appears in this branch */
|
||||
#include <afsconfig.h>
|
||||
#include "afscp.h"
|
||||
#include "afscp_internal.h"
|
||||
|
||||
#ifdef ROKEN_LIB_FUNCTION
|
||||
#error this file can go away when roken appears in this branch
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define ROKEN_LIB_FUNCTION
|
||||
#define ROKEN_LIB_CALL __cdecl
|
||||
#else
|
||||
#define ROKEN_LIB_FUNCTION
|
||||
#define ROKEN_LIB_CALL
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNLEN
|
||||
ROKEN_LIB_FUNCTION size_t ROKEN_LIB_CALL
|
||||
strnlen(const char *s, size_t len)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for(i = 0; i < len && s[i]; i++)
|
||||
;
|
||||
return i;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_TSEARCH
|
||||
/*
|
||||
* Tree search generalized from Knuth (6.2.2) Algorithm T just like
|
||||
* the AT&T man page says.
|
||||
*
|
||||
* The node_t structure is for internal use only, lint doesn't grok it.
|
||||
*
|
||||
* Written by reading the System V Interface Definition, not the code.
|
||||
*
|
||||
* Totally public domain.
|
||||
*
|
||||
* $NetBSD: tsearch.c,v 1.3 1999/09/16 11:45:37 lukem Exp $
|
||||
* $NetBSD: twalk.c,v 1.1 1999/02/22 10:33:16 christos Exp $
|
||||
* $NetBSD: tdelete.c,v 1.2 1999/09/16 11:45:37 lukem Exp $
|
||||
* $NetBSD: tfind.c,v 1.2 1999/09/16 11:45:37 lukem Exp $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include "afscp_search.h"
|
||||
|
||||
typedef struct node {
|
||||
char *key;
|
||||
struct node *llink, *rlink;
|
||||
} node_t;
|
||||
|
||||
#ifndef __DECONST
|
||||
#define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* find or insert datum into search tree
|
||||
*
|
||||
* Parameters:
|
||||
* vkey: key to be located
|
||||
* vrootp: address of tree root
|
||||
*/
|
||||
|
||||
ROKEN_LIB_FUNCTION void *
|
||||
rk_tsearch(const void *vkey, void **vrootp,
|
||||
int (*compar)(const void *, const void *))
|
||||
{
|
||||
node_t *q;
|
||||
node_t **rootp = (node_t **)vrootp;
|
||||
|
||||
if (rootp == NULL)
|
||||
return NULL;
|
||||
|
||||
while (*rootp != NULL) { /* Knuth's T1: */
|
||||
int r;
|
||||
|
||||
if ((r = (*compar)(vkey, (*rootp)->key)) == 0) /* T2: */
|
||||
return *rootp; /* we found it! */
|
||||
|
||||
rootp = (r < 0) ?
|
||||
&(*rootp)->llink : /* T3: follow left branch */
|
||||
&(*rootp)->rlink; /* T4: follow right branch */
|
||||
}
|
||||
|
||||
q = malloc(sizeof(node_t)); /* T5: key not found */
|
||||
if (q != 0) { /* make new node */
|
||||
*rootp = q; /* link new node to old */
|
||||
/* LINTED const castaway ok */
|
||||
q->key = __DECONST(void *, vkey); /* initialize new node */
|
||||
q->llink = q->rlink = NULL;
|
||||
}
|
||||
return q;
|
||||
}
|
||||
|
||||
/*
|
||||
* Walk the nodes of a tree
|
||||
*
|
||||
* Parameters:
|
||||
* root: Root of the tree to be walked
|
||||
*/
|
||||
static void
|
||||
trecurse(const node_t *root, void (*action)(const void *, VISIT, int),
|
||||
int level)
|
||||
{
|
||||
|
||||
if (root->llink == NULL && root->rlink == NULL)
|
||||
(*action)(root, leaf, level);
|
||||
else {
|
||||
(*action)(root, preorder, level);
|
||||
if (root->llink != NULL)
|
||||
trecurse(root->llink, action, level + 1);
|
||||
(*action)(root, postorder, level);
|
||||
if (root->rlink != NULL)
|
||||
trecurse(root->rlink, action, level + 1);
|
||||
(*action)(root, endorder, level);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Walk the nodes of a tree
|
||||
*
|
||||
* Parameters:
|
||||
* vroot: Root of the tree to be walked
|
||||
*/
|
||||
ROKEN_LIB_FUNCTION void
|
||||
rk_twalk(const void *vroot,
|
||||
void (*action)(const void *, VISIT, int))
|
||||
{
|
||||
if (vroot != NULL && action != NULL)
|
||||
trecurse(vroot, action, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* delete node with given key
|
||||
*
|
||||
* vkey: key to be deleted
|
||||
* vrootp: address of the root of the tree
|
||||
* compar: function to carry out node comparisons
|
||||
*/
|
||||
ROKEN_LIB_FUNCTION void *
|
||||
rk_tdelete(const void * __restrict vkey, void ** __restrict vrootp,
|
||||
int (*compar)(const void *, const void *))
|
||||
{
|
||||
node_t **rootp = (node_t **)vrootp;
|
||||
node_t *p, *q, *r;
|
||||
int cmp;
|
||||
|
||||
if (rootp == NULL || (p = *rootp) == NULL)
|
||||
return NULL;
|
||||
|
||||
while ((cmp = (*compar)(vkey, (*rootp)->key)) != 0) {
|
||||
p = *rootp;
|
||||
rootp = (cmp < 0) ?
|
||||
&(*rootp)->llink : /* follow llink branch */
|
||||
&(*rootp)->rlink; /* follow rlink branch */
|
||||
if (*rootp == NULL)
|
||||
return NULL; /* key not found */
|
||||
}
|
||||
r = (*rootp)->rlink; /* D1: */
|
||||
if ((q = (*rootp)->llink) == NULL) /* Left NULL? */
|
||||
q = r;
|
||||
else if (r != NULL) { /* Right link is NULL? */
|
||||
if (r->llink == NULL) { /* D2: Find successor */
|
||||
r->llink = q;
|
||||
q = r;
|
||||
} else { /* D3: Find NULL link */
|
||||
for (q = r->llink; q->llink != NULL; q = r->llink)
|
||||
r = q;
|
||||
r->llink = q->rlink;
|
||||
q->llink = (*rootp)->llink;
|
||||
q->rlink = (*rootp)->rlink;
|
||||
}
|
||||
}
|
||||
free(*rootp); /* D4: Free node */
|
||||
*rootp = q; /* link parent to new node */
|
||||
return p;
|
||||
}
|
||||
|
||||
/*
|
||||
* find a node, or return 0
|
||||
*
|
||||
* Parameters:
|
||||
* vkey: key to be found
|
||||
* vrootp: address of the tree root
|
||||
*/
|
||||
ROKEN_LIB_FUNCTION void *
|
||||
rk_tfind(const void *vkey, void * const *vrootp,
|
||||
int (*compar)(const void *, const void *))
|
||||
{
|
||||
node_t **rootp = (node_t **)vrootp;
|
||||
|
||||
if (rootp == NULL)
|
||||
return NULL;
|
||||
|
||||
while (*rootp != NULL) { /* T1: */
|
||||
int r;
|
||||
|
||||
if ((r = (*compar)(vkey, (*rootp)->key)) == 0) /* T2: */
|
||||
return *rootp; /* key found */
|
||||
rootp = (r < 0) ?
|
||||
&(*rootp)->llink : /* T3: follow left branch */
|
||||
&(*rootp)->rlink; /* T4: follow right branch */
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
57
src/libafscp/afscp_search.h
Normal file
57
src/libafscp/afscp_search.h
Normal file
@ -0,0 +1,57 @@
|
||||
/*-
|
||||
* Written by J.T. Conklin <jtc@netbsd.org>
|
||||
* Public domain.
|
||||
*
|
||||
* $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $
|
||||
*/
|
||||
|
||||
#ifndef _rk_SEARCH_H_
|
||||
#define _rk_SEARCH_H_ 1
|
||||
|
||||
#ifndef ROKEN_LIB_FUNCTION
|
||||
#ifdef _WIN32
|
||||
#define ROKEN_LIB_FUNCTION
|
||||
#define ROKEN_LIB_CALL __cdecl
|
||||
#else
|
||||
#define ROKEN_LIB_FUNCTION
|
||||
#define ROKEN_LIB_CALL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define ROKEN_CPP_START extern "C" {
|
||||
#define ROKEN_CPP_END }
|
||||
#else
|
||||
#define ROKEN_CPP_START
|
||||
#define ROKEN_CPP_END
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <sys/cdefs.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef enum {
|
||||
preorder,
|
||||
postorder,
|
||||
endorder,
|
||||
leaf
|
||||
} VISIT;
|
||||
|
||||
ROKEN_CPP_START
|
||||
|
||||
ROKEN_LIB_FUNCTION void * ROKEN_LIB_CALL rk_tdelete(const void * __restrict, void ** __restrict,
|
||||
int (*)(const void *, const void *));
|
||||
ROKEN_LIB_FUNCTION void * ROKEN_LIB_CALL rk_tfind(const void *, void * const *,
|
||||
int (*)(const void *, const void *));
|
||||
ROKEN_LIB_FUNCTION void * ROKEN_LIB_CALL rk_tsearch(const void *, void **, int (*)(const void *, const void *));
|
||||
ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL rk_twalk(const void *, void (*)(const void *, VISIT, int));
|
||||
|
||||
ROKEN_CPP_END
|
||||
|
||||
#define tdelete rk_tdelete
|
||||
#define tfind rk_tfind
|
||||
#define tsearch rk_tsearch
|
||||
#define twalk rk_twalk
|
||||
|
||||
#endif /* !_rk_SEARCH_H_ */
|
@ -27,7 +27,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <afsconfig.h>
|
||||
#include <afs/param.h>
|
||||
|
||||
#ifdef HAVE_SEARCH_H
|
||||
#include <search.h>
|
||||
#else
|
||||
#include "afscp_search.h"
|
||||
#endif
|
||||
|
||||
#include <afs/vlserver.h>
|
||||
#include <afs/vldbint.h>
|
||||
|
@ -11,11 +11,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 \
|
||||
@ -45,7 +62,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
|
||||
@ -55,6 +72,9 @@ cacheout: cacheout.o
|
||||
|
||||
cacheout.o: cacheout.c
|
||||
|
||||
PTH_CFLAGS=$(COMMON_CFLAGS) $(MT_CFLAGS)
|
||||
PTH_LDFLAGS=$(COMMON_LDFLAGS) $(MT_LDFLAGS)
|
||||
PTH_CCRULE=$(MT_CC) $(PTH_CFLAGS) -o $@ -c
|
||||
|
||||
up.o: up.c AFS_component_version_number.c
|
||||
|
||||
@ -66,10 +86,22 @@ fs.o: fs.c ${INCLS} AFS_component_version_number.c
|
||||
fs: fs.o $(LIBS)
|
||||
${CC} ${CFLAGS} -o fs fs.o ${TOP_LIBDIR}/libprot.a $(LIBS) ${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)
|
||||
${CC} ${CFLAGS} -o afsio afsio.o ${TOP_LIBDIR}/libprot.a ${TOP_LIBDIR}/libafsint.a $(LIBS) ${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) $(PTH_CFLAGS) -o afsio afsio.o vldbint.cs.o afscbint.ss.o vldbint.xdr.o ${AFSIO_LIBS} \
|
||||
${MT_LIBS} ${XLIBS} ${KRB5LIBS} ; \
|
||||
else \
|
||||
echo "Skipping afsio (KRB5 build disabled)" ; \
|
||||
fi
|
||||
|
||||
livesys.o: livesys.c ${INCLS} AFS_component_version_number.c
|
||||
|
||||
@ -267,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}
|
||||
@ -277,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? ) \
|
||||
@ -307,7 +342,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
|
||||
@ -317,6 +352,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? ) \
|
||||
@ -355,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
|
||||
$(RM) -f *.o *.a up fs kdump-* kdump kdump64 core cmdebug AFS_component_version_number.c fstrace gcpags livesys dedebug afsio
|
||||
|
||||
test:
|
||||
cd test; $(MAKE)
|
||||
|
1873
src/venus/afsio.c
1873
src/venus/afsio.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user