audit: util rx rxkad fsint
+${COMPILE_PART1} audit ${COMPILE_PART2} #TODO
-comerr: util
+comerr: util $(DIR_roken)
+${COMPILE_PART1} comerr ${COMPILE_PART2}
cmd: comerr
rxkad: cmd comerr des rx rxkad_depinstall
+${COMPILE_PART1} rxkad ${COMPILE_PART2}
-auth: cmd comerr comerr des lwp rx rxkad audit sys_depinstall auth_depinstall
+auth: cmd comerr des lwp rx rxkad audit sys_depinstall auth_depinstall
+${COMPILE_PART1} auth ${COMPILE_PART2}
ubik: cmd comerr auth ubik_depinstall sys
echo No efs stuff for ${SYS_NAME};; \
esac
-vol: cmd comerr dir afs sgiefs
+vol: cmd comerr dir afs sgiefs $(DIR_roken)
+${COMPILE_PART1} vol ${COMPILE_PART2}
tsalvaged: vol libafsrpc libafsauthent cmd util
#define ifaddr usr_ifaddr
#define ifnet usr_ifnet
#define in_ifaddr usr_in_ifaddr
+#undef socket
#define socket usr_socket
#define crget usr_crget
#define crcopy usr_crcopy
LDFLAGS_afsd = $(AFSD_LDFLAGS)
afsd: afsd.o afsd_kernel.o $(AFSLIBS) $(AFSD_LIBS)
${AFS_LDRULE} afsd.o afsd_kernel.o $(NON_SHARED) \
- $(AFSLIBS) $(LIB_roken) ${XLIBS} ${AFSD_LIBS}
+ $(AFSLIBS) ${AFSD_LIBS} $(LIB_roken) $(XLIBS)
LDFLAGS_afsd.fuse = $(AFSD_LDFLAGS)
afsd.fuse: afsd_fuse.o $(UAFSLIBS) $(AFSD_LIBS)
#include <afsconfig.h>
#include <afs/param.h>
+#include <roken.h>
+
#define VFS 1
#include <afs/cmd.h>
#include <sys/file.h>
#endif
#include <sys/types.h>
+
#include <afs/stds.h>
#include <afs/bubasics.h>
#include <afs/afsutil.h>
dirpath.o \
serverLog.o \
snprintf.o \
- strlcat.o \
- strlcpy.o \
fileutil.o
RXKADOBJS = \
snprintf.o: ${UTIL}/snprintf.c
${AFS_CCRULE} ${UTIL}/snprintf.c
-strlcat.o: ${UTIL}/strlcat.c
- ${AFS_CCRULE} ${UTIL}/strlcat.c
-
-strlcpy.o: ${UTIL}/strlcpy.c
- ${AFS_CCRULE} ${UTIL}/strlcpy.c
-
fileutil.o: ${UTIL}/fileutil.c
${AFS_CCRULE} ${UTIL}/fileutil.c
UTILOBJS =\
assert.o \
casestrcpy.o \
- base64.o \
- strlcat.o \
- strlcpy.o
+ base64.o
COMERROBJS =\
error_msg.o \
base64.o: ${UTIL}/base64.c
$(AFS_CCRULE) $(UTIL)/base64.c
-strlcat.o: ${UTIL}/strlcat.c
- $(AFS_CCRULE) $(UTIL)/strlcat.c
-
-strlcpy.o: ${UTIL}/strlcpy.c
- $(AFS_CCRULE) $(UTIL)/strlcpy.c
-
fasttime.o: ${LWP}/fasttime.c
$(AFS_CCRULE) $(LWP)/fasttime.c
${TOP_LIBDIR}/libdes.a ${TOP_LIBDIR}/libafsutil.a \
$(LIB_roken) $(TEST_LIBS) $(XLIBS)
-
CRULE1= $(CC) $(COMMON_INCLUDE) $(OPTF) -DKERNEL $(LIBJUAFS_FLAGS) $(CFLAGS) -c $?
CRULE2= $(CC) $(COMMON_INCLUDE) $(OPTF) $(WEBOPTS) -DKERNEL $(LIBJUAFS_FLAGS) $(CFLAGS) -c $?
dirpath.o \
serverLog.o \
snprintf.o \
- strlcat.o \
- strlcpy.o \
fileutil.o
RXKADOBJS = \
${LIBAFSAUTHENT}: ${LIBOBJS} libafsauthent.map
../config/shlib-build -d $(srcdir) -l libafsauthent \
-M ${LIBAFSAUTHENTMAJOR} -m ${LIBAFSAUTHENTMINOR} -- \
- -L${TOP_LIBDIR} -lafsrpc ${LIB_crypt} ${LIBOBJS} ${LIB_AFSDB} ${MT_LIBS}
+ -L${TOP_LIBDIR} $(LDFLAGS_roken) \
+ $(LIBOBJS) \
+ -lafsrpc $(LIB_roken) $(LIB_crypt) $(LIB_AFSDB) \
+ ${MT_LIBS}
libafsauthent_pic.a: ${LIBOBJS}
$(RM) -f $@
ubik_int.xdr.o: ../ubik/ubik_int.xdr.c
${AFS_CCRULE} ../ubik/ubik_int.xdr.c
-
get_krbrlm.o: ${UTIL}/get_krbrlm.c
${AFS_CCRULE} ${UTIL}/get_krbrlm.c
snprintf.o: ${UTIL}/snprintf.c
${AFS_CCRULE} ${UTIL}/snprintf.c
-strlcat.o: ${UTIL}/strlcat.c
- ${AFS_CCRULE} ${UTIL}/strlcat.c
-
-strlcpy.o: ${UTIL}/strlcpy.c
- ${AFS_CCRULE} ${UTIL}/strlcpy.c
-
fileutil.o: ${UTIL}/fileutil.c
${AFS_CCRULE} ${UTIL}/fileutil.c
assert.o \
casestrcpy.o \
base64.o \
- strlcat.o \
- strlcpy.o
COMERROBJS =\
error_msg.o \
${LIBAFSRPC}: ${LIBOBJS} libafsrpc.map
../config/shlib-build -d $(srcdir) -l libafsrpc \
-M ${LIBAFSRPCMAJOR} -m ${LIBAFSRPCMINOR} -- \
- ${LIBOBJS} ${MT_LIBS}
+ $(LDFLAGS_roken) ${LIBOBJS} ${MT_LIBS} $(LIB_roken)
libafsrpc_pic.a: ${LIBOBJS}
$(RM) -f $@
base64.o: ${UTIL}/base64.c
$(AFS_CCRULE) $(UTIL)/base64.c
-strlcat.o: ${UTIL}/strlcat.c
- $(AFS_CCRULE) $(UTIL)/strlcat.c
-
-strlcpy.o: ${UTIL}/strlcpy.c
- $(AFS_CCRULE) $(UTIL)/strlcpy.c
-
fasttime.o: ${LWP}/fasttime.c
$(AFS_CCRULE) $(LWP)/fasttime.c
#include <afsconfig.h>
#include <afs/param.h>
-
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#endif /* ITIMER_REAL */
#endif
+
+#include <roken.h>
+
#include <rx/xdr.h>
#include <afs/afsint.h>
#include <afs/afs_assert.h>
UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
volparse.o flipbase64.o softsig.o hostparse.o snprintf.o \
- pthread_glock.o strlcat.o strlcpy.o strnlen.o
+ pthread_glock.o
LIBS=${RXOBJS} ${UTILOBJS} ${TOP_LIBDIR}/libafsrpc.a ${TOP_LIBDIR}/liblwp.a \
${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/libcmd.a \
volparse.o: ${UTIL}/volparse.c
$(AFS_CCRULE) $(UTIL)/volparse.c
-strlcat.o: ${UTIL}/strlcat.c
- $(AFS_CCRULE) $(UTIL)/strlcat.c
-
-strlcpy.o: ${UTIL}/strlcpy.c
- $(AFS_CCRULE) $(UTIL)/strlcpy.c
-
-strnlen.o: ${UTIL}/strnlen.c
- $(AFS_CCRULE) $(UTIL)/strnlen.c
-
flipbase64.o: ${UTIL}/flipbase64.c
$(AFS_CCRULE) $(UTIL)/flipbase64.c
#include <sys/time.h>
#include <sys/file.h>
#endif
-#include <afs/afs_assert.h>
#include <sys/stat.h>
#include <afs/stds.h>
+#include <afs/afs_assert.h>
#include <rx/xdr.h>
#include <lwp.h>
#include <afsconfig.h>
#include <afs/param.h>
-
#include <stdio.h>
#include <errno.h>
#include <sys/file.h>
#include <time.h>
#include <string.h>
+#include <roken.h>
+
#include <afs/stds.h>
#include <rx/xdr.h>
#include <afs/afs_assert.h>
${TOP_LIBDIR}/liblwp.a \
${TOP_LIBDIR}/libcmd.a \
${TOP_LIBDIR}/libcom_err.a\
- ${TOP_LIBDIR}/util.a \
- ${XLIBS}
+ ${TOP_LIBDIR}/util.a
OBJS = uss_procs.o \
uss_common.o \
y.tab.o
uss: uss.o ${OBJS}
- $(AFS_LDRULE) uss.o ${OBJS} ${LIBS} $(LIB_roken)
+ $(AFS_LDRULE) uss.o ${OBJS} ${LIBS} $(LIB_roken) $(XLIBS)
uss.o: uss.c AFS_component_version_number.c
hostparse.o exec.o \
hputil.o kreltime.o isathing.o get_krbrlm.o uuid.o serverLog.o \
dirpath.o fileutil.o netutils.o flipbase64.o fstab.o \
- afs_atomlist.o afs_lhash.o snprintf.o strlcat.o strlcpy.o strnlen.o \
- pthread_glock.o daemon.o ${REGEX_OBJ}
+ afs_atomlist.o afs_lhash.o snprintf.o pthread_glock.o \
+ ${REGEX_OBJ}
includes = \
${TOP_INCDIR}/afs/dirpath.h \
$(OUT)\readdir_nt.obj \
$(OUT)\serverLog.obj \
$(OUT)\snprintf.obj \
- $(OUT)\strlcat.obj \
$(OUT)\uuid.obj \
$(OUT)\volparse.obj \
$(OUT)\winsock_nt.obj \
$(OUT)\errmap_nt.obj \
$(OUT)\dirpath.obj \
- $(OUT)\strnlen.obj \
- $(OUT)\strlcpy.obj \
$(OUT)\fileutil.obj \
$(OUT)\secutil_nt.obj
$(OUT)\readdir_nt.obj \
$(OUT)\serverLog_mt.obj \
$(OUT)\snprintf.obj \
- $(OUT)\strlcat.obj \
$(OUT)\uuid.obj \
$(OUT)\volparse.obj \
$(OUT)\winsock_nt.obj \
$(OUT)\errmap_nt.obj \
$(OUT)\dirpath_mt.obj \
- $(OUT)\strnlen.obj \
- $(OUT)\strlcpy.obj \
$(OUT)\fileutil.obj \
$(OUT)\secutil_nt.obj
/* b64_string_t is 8 bytes, in stds.h */
typedef char lb64_string_t[12];
-#ifndef HAVE_STRLCAT
-extern size_t strlcat(char *dst, const char *src, size_t siz);
-#endif
-
-#ifndef HAVE_STRLCPY
-extern size_t strlcpy(char *dst, const char *src, size_t siz);
-#endif
-
#include <afs/ktime.h>
#include "afsutil_prototypes.h"
extern int afs_config_get_bool(const afs_config_section *, ...);
extern int afs_config_get_int(const afs_config_section *c, ...);
-/* daemon.c */
-#ifndef HAVE_DAEMON
-int daemon(int nochdir, int noclose);
-#endif
-
/* dirpath.c */
extern unsigned int initAFSDirPath(void);
extern const char *getDirPath(afsdir_id_t string_id);
/* snprintf.c */
-/* strl */
-#ifndef HAVE_STRLCPY
-extern size_t strlcpy(char *dst, const char *src, size_t siz);
-#endif
-#ifndef HAVE_STRLCAT
-extern size_t strlcat(char *dst, const char *src, size_t siz);
-#endif
-
-/* strn */
-extern size_t afs_strnlen(char * buf, size_t len);
-
-
/* sys.c */
+++ /dev/null
-#include <afsconfig.h>
-#include <afs/param.h>
-
-#ifndef HAVE_DAEMON
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <sys/types.h>
-
-int daemon(int nochdir, int noclose)
-{
- int err = -1;
- pid_t pid;
-
- pid = fork();
- if (pid == -1) {
- goto out;
- } else if (pid) {
- exit(0);
- }
-
- err = setsid();
- if (err == -1) {
- goto out;
- }
-
- if (!nochdir) {
- err = chdir("/");
- if (err == -1) {
- goto out;
- }
- }
-
- err = -1;
- if (!noclose) {
- if (!freopen("/dev/null", "r", stdin)) {
- goto out;
- }
-
- if (!freopen("/dev/null", "w", stdout)) {
- goto out;
- }
-
- if (!freopen("/dev/null", "w", stderr)) {
- goto out;
- }
- }
-
- err = 0;
-
-out:
- return(err);
-}
-#endif
return val;
}
-#if defined(AFS_OSF20_ENV) && !defined(AFS_DUX50_ENV) || defined(AFS_AIX32_ENV) || (defined(AFS_SUN55_ENV) && !defined(AFS_SUN56_ENV)) || !defined(HAVE_VSNPRINTF) || defined(TEST_SNPRINTF)
-
-#if defined(AFS_AIX51_ENV) || defined(AFS_NT40_ENV)
-int
-vsnprintf(char *p, size_t avail, const char *fmt, va_list ap)
-#else
-void
-vsnprintf(char *p, unsigned int avail, char *fmt, va_list ap)
-#endif
-{
- int result;
- result = afs_vsnprintf(p, avail, fmt, ap);
-#if defined(AFS_AIX51_ENV) || defined(AFS_NT40_ENV)
- return result;
-#endif
-}
-#endif /* AFS_OSF20_ENV || AFS_AIX32_ENV */
#ifndef AFS_NT40_ENV
#ifndef HAVE_VSYSLOG
syslog(priority, "%s", buf);
}
#endif
-
-#if defined(AFS_OSF20_ENV) && !defined(AFS_DUX50_ENV) || defined(AFS_AIX32_ENV) || (defined(AFS_SUN55_ENV) && !defined(AFS_SUN56_ENV)) || !defined(HAVE_SNPRINTF)
-
-#ifdef AFS_AIX51_ENV
-int
-snprintf(char *p, size_t avail, const char *fmt, ...)
-#else
-void
-snprintf(char *p, unsigned int avail, char *fmt, ...)
-#endif
-{
- va_list ap;
- int result;
-
- va_start(ap, fmt);
- result = afs_vsnprintf(p, avail, fmt, ap);
- va_end(ap);
-#ifdef AFS_AIX51_ENV
- return result;
#endif
-}
-#endif /* AFS_OSF20_ENV || AFS_AIX32_ENV */
-#endif /* AFS_NT40_ENV */
+++ /dev/null
-/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#ifndef HAVE_STRLCAT
-
-#include <sys/types.h>
-#include <string.h>
-
-/*
- * Appends src to string dst of size siz (unlike strncat, siz is the
- * full size of dst, not space left). At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
- * Returns strlen(src) + MIN(siz, strlen(initial dst)).
- * If retval >= siz, truncation occurred.
- */
-size_t
-strlcat(char *dst, const char *src, size_t siz)
-{
- char *d = dst;
- const char *s = src;
- size_t n = siz;
- size_t dlen;
-
- /* Find the end of dst and adjust bytes left but don't go past end */
- while (n-- != 0 && *d != '\0')
- d++;
- dlen = d - dst;
- n = siz - dlen;
-
- if (n == 0)
- return (dlen + strlen(s));
- while (*s != '\0') {
- if (n != 1) {
- *d++ = *s;
- n--;
- }
- s++;
- }
- *d = '\0';
-
- return (dlen + (s - src)); /* count does not include NUL */
-}
-#endif
+++ /dev/null
-/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#ifndef HAVE_STRLCPY
-
-#include <sys/types.h>
-
-/*
- * Copy src to string dst of size siz. At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz == 0).
- * Returns strlen(src); if retval >= siz, truncation occurred.
- */
-size_t
-strlcpy(char *dst, const char *src, size_t siz)
-{
- char *d = dst;
- const char *s = src;
- size_t n = siz;
-
- /* Copy as many bytes as will fit */
- if (n != 0 && --n != 0) {
- do {
- if ((*d++ = *s++) == 0)
- break;
- } while (--n != 0);
- }
-
- /* Not enough room in dst, add NUL and traverse rest of src */
- if (n == 0) {
- if (siz != 0)
- *d = '\0'; /* NUL-terminate dst */
- while (*s++);
- }
-
- return (s - src - 1); /* count does not include NUL */
-}
-#endif
+++ /dev/null
-/*
- * Copyright 2006, Sine Nomine Associates and others.
- * All Rights Reserved.
- *
- * This software has been released under the terms of the IBM Public
- * License. For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
-/* strnlen.c - fixed length string length */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include <sys/types.h>
-#include <stdarg.h>
-#include <ctype.h>
-
-
-size_t
-afs_strnlen(char * buf, size_t len)
-{
- size_t i;
-
- for (i = 0; i < len; i++) {
- if (buf[i] == '\0')
- break;
- }
-
- return i;
-}
-
#include <stdlib.h>
#endif
+#include <roken.h>
+
#include "afsutil.h"
/* maximum number of partitions - must match vol/voldefs.h */
* ) \
$(AFS_LDRULE) fstrace.o ${TOP_LIBDIR}/libsys.a \
${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a \
- ${XLIBS} ;; \
+ ${XLIBS} $(LIB_roken);; \
esac
cmdebug.o: cmdebug.c ${INCLS} AFS_component_version_number.c
dedebug: dedebug.o ${CMLIBS}
$(AFS_LDRULE) dedebug.o ${CMLIBS} $(LIB_roken) ${XLIBS}
-
-
#
# Kernel info dumper - these are done with submakes so that
# the build process does not attempt to rebuild them every time it runs.
#include <afsconfig.h>
#include <afs/param.h>
+#include <roken.h>
#include <afs/afs_consts.h>
#include <afs/afs_args.h>
#include <afsconfig.h>
#include <afs/param.h>
-
-/* missing type from C language */
+#include <roken.h>
#include <errno.h>
#ifdef AFS_AIX32_ENV
{
size_t s_len;
- s_len = afs_strnlen(buf, len);
+ s_len = strnlen(buf, len);
return (s_len == len) ? 1 : 0;
}
#include <afsconfig.h>
#include <afs/param.h>
+#include <roken.h>
#include <stdlib.h>
#include <stdio.h>
printf("\tvop = {\n");
printf("\t\tvolume = %u\n", vop.vop.volume);
- if (afs_strnlen(vop.vop.partName, sizeof(vop.vop.partName)) <
+ if (strnlen(vop.vop.partName, sizeof(vop.vop.partName)) <
sizeof(vop.vop.partName)) {
printf("\t\tpartName = '%s'\n", vop.vop.partName);
} else {
#include <afsconfig.h>
#include <afs/param.h>
+#include <roken.h>
#ifdef AFS_NAMEI_ENV
-#include <roken.h>
#include <stdio.h>
#include <stdlib.h>
#ifndef AFS_NT40_ENV
#include <afsconfig.h>
#include <afs/param.h>
+#include <roken.h>
#include <stdlib.h>
#include <stdio.h>
#include <afsconfig.h>
#include <afs/param.h>
+#include <roken.h>
#include <sys/types.h>
#include <stdio.h>
VScheduleSalvage_r(Volume * vp)
{
int ret=0;
- int code;
+ int code = 0;
VolState state_save;
VThreadOptions_t * thread_opts;
char partName[16];