diff options
Diffstat (limited to 'archivers/pax/files/gen_subs.c')
-rw-r--r-- | archivers/pax/files/gen_subs.c | 80 |
1 files changed, 70 insertions, 10 deletions
diff --git a/archivers/pax/files/gen_subs.c b/archivers/pax/files/gen_subs.c index 8f6b8a3fff5..c5e0e6c9a27 100644 --- a/archivers/pax/files/gen_subs.c +++ b/archivers/pax/files/gen_subs.c @@ -1,7 +1,6 @@ -/* $NetBSD: gen_subs.c,v 1.4 2003/09/05 05:48:56 grant Exp $ */ +/* $NetBSD: gen_subs.c,v 1.5 2003/09/05 18:40:51 jlam Exp $ */ /*- - * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * @@ -16,6 +15,37 @@ * 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 University 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 REGENTS 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 REGENTS 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. + */ + +/*- + * Copyright (c) 1992 Keith Muller. + * + * This code is derived from software contributed to Berkeley by + * Keith Muller of the University of California, San Diego. + * + * 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. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of @@ -37,34 +67,64 @@ * SUCH DAMAGE. */ -#include "nbcompat.h" -#include "pwcache.h" - -#ifdef HAVE_SYS_CDEFS_H +#if HAVE_CONFIG_H +#include "config.h" +#endif +#include <nbcompat.h> +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif - #if defined(__RCSID) && !defined(lint) #if 0 static char sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: gen_subs.c,v 1.4 2003/09/05 05:48:56 grant Exp $"); +__RCSID("$NetBSD: gen_subs.c,v 1.5 2003/09/05 18:40:51 jlam Exp $"); #endif #endif /* not lint */ +#if HAVE_SYS_TYPES_H #include <sys/types.h> +#endif +#if HAVE_SYS_TIME_H #include <sys/time.h> +#endif +#if HAVE_SYS_STAT_H #include <sys/stat.h> +#endif +#if HAVE_SYS_PARAM_H #include <sys/param.h> +#endif +#if HAVE_CTYPE_H #include <ctype.h> +#endif +#if HAVE_GRP_H #include <grp.h> +#endif +#if HAVE_PWD_H #include <pwd.h> +#endif +#if HAVE_VIS_H +#include <vis.h> +#endif +#if HAVE_STDIO_H #include <stdio.h> +#endif +#if HAVE_STDLIB_H #include <stdlib.h> +#endif +#if HAVE_STRING_H #include <string.h> +#endif +#if HAVE_TIME_H #include <time.h> +#endif +#if HAVE_TZFILE_H +#include <tzfile.h> +#endif +#if HAVE_UNISTD_H #include <unistd.h> +#endif #include "pax.h" #include "extern.h" @@ -127,8 +187,8 @@ ls_list(ARCHD *arcn, time_t now, FILE *fp) */ if (strftime(f_date,DATELEN,timefrmt,localtime(&(sbp->st_mtime))) == 0) f_date[0] = '\0'; - user = (char *)user_from_uid(sbp->st_uid, 0); - group = (char *)group_from_gid(sbp->st_gid, 0); + user = user_from_uid(sbp->st_uid, 0); + group = group_from_gid(sbp->st_gid, 0); (void)fprintf(fp, "%s%2lu %-*s %-*s ", f_mode, (unsigned long)sbp->st_nlink, UT_NAMESIZE, user ? user : "", UT_GRPSIZE, group ? group : ""); |