Commit 72c90a3a authored by Piotr Roszatycki's avatar Piotr Roszatycki

Imported Upstream version 2.17.2

parent 30b43d4c
......@@ -5,7 +5,10 @@ SUBDIRS = man src scripts test
EXTRA_DIST = COPYING LICENSE NEWS.md README.md THANKS autogen.sh makedist.sh
prove: all
cd test && $(MAKE) $(AM_MAKEFLAGS) prove
test: all
( cd test && $(MAKE) $(AM_MAKEFLAGS) test )
cd test && $(MAKE) $(AM_MAKEFLAGS) test
.PHONY: test
.PHONY: prove test
......@@ -102,7 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/check_c_alignof.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/no_cross_compiling.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/prog_prove_opt.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
......@@ -279,6 +279,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POD2MAN = @POD2MAN@
PROVE = @PROVE@
PROVEFLAGS = @PROVEFLAGS@
PROVE_HAVE_OPT___EXEC__BIN_SH = @PROVE_HAVE_OPT___EXEC__BIN_SH@
PROVE_HAVE_OPT___FAILURES = @PROVE_HAVE_OPT___FAILURES@
RANLIB = @RANLIB@
SED = @SED@
SEQ = @SEQ@
......@@ -824,10 +827,13 @@ uninstall-am:
uninstall-am
prove: all
cd test && $(MAKE) $(AM_MAKEFLAGS) prove
test: all
( cd test && $(MAKE) $(AM_MAKEFLAGS) test )
cd test && $(MAKE) $(AM_MAKEFLAGS) test
.PHONY: test
.PHONY: prove test
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
......
## Version 2.17.2
24 Dec 2013
* Fixes were made for `fakechroot`(1) command with `-h` option.
* The path for function `chroot`(2) is sanitized so it works correctly when
path is ended with `/`.
* The `make -n test` was fixed and doesn't call any command.
## Version 2.17.1
5 Dec 2013
......
......@@ -1197,3 +1197,4 @@ m4_include([m4/ltsugar.m4])
m4_include([m4/ltversion.m4])
m4_include([m4/lt~obsolete.m4])
m4_include([m4/no_cross_compiling.m4])
m4_include([m4/prog_prove_opt.m4])
......@@ -216,6 +216,12 @@
/* Define to 1 if you have the `freopen64' function. */
#undef HAVE_FREOPEN64
/* Define to 1 if you have the `fstat' function. */
#undef HAVE_FSTAT
/* Define to 1 if you have the `fstat64' function. */
#undef HAVE_FSTAT64
/* Define to 1 if you have the `fts_children' function. */
#undef HAVE_FTS_CHILDREN
......
This diff is collapsed.
AC_PREREQ(2.64)
AC_INIT([fakechroot], [2.17.1], [dexter@debian.org], [fakechroot], [http://fakechroot.alioth.debian.org/])
AC_INIT([fakechroot], [2.17.2], [dexter@debian.org], [fakechroot], [http://fakechroot.alioth.debian.org/])
AC_CONFIG_SRCDIR([src/libfakechroot.c])
AC_CONFIG_AUX_DIR([build-aux])
......@@ -173,6 +173,8 @@ AC_CHECK_FUNCS(m4_normalize([
fopen64
freopen
freopen64
fstat
fstat64
fts_children
fts_open
fts_read
......@@ -355,5 +357,9 @@ AC_CONFIG_FILES(m4_normalize([
test/src/Makefile
]))
# prove --failures --exec /bin/sh
ACX_PROG_PROVE_OPT([--failures])
ACX_PROG_PROVE_OPT([--exec /bin/sh])
# Generate output
AC_OUTPUT
# prog_prove_opt.m4 - check if prove accepts command line option
#
# Copyright (c) 2013 Piotr Roszatycki <dexter@debian.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# ACX_PROG_PROVE_OPT([OPTS], [BODY], [ON-FALSE])
# ----------------------------------------------
AC_DEFUN([ACX_PROG_PROVE_OPT],
[m4_define([myname], [PROVE_HAVE_OPT_$1])
AC_CHECK_PROGS([PROVE], [prove])
AS_VAR_PUSHDEF([acx_var], [acx_cv_prog_prove_opt_$1])
AC_CACHE_CHECK([whether $PROVE accepts $1],
acx_var,
[_ACX_PROG_PROVE_TRY([$1], [$2],
[AS_VAR_SET(acx_var, [yes])], [AS_VAR_SET(acx_var, [no])])])
AS_VAR_IF(acx_var, [yes],
[AS_VAR_APPEND([PROVEFLAGS], [" $1"])
AC_SUBST([PROVEFLAGS])
AC_SUBST(AS_TR_CPP(myname), [true])
AS_VAR_SET(acx_var, [yes])],
[$3])
AS_VAR_POPDEF([acx_var])
m4_undefine([myname])])
# _ACX_LANG_CONFTEST_PL([BODY])
# -----------------------------
m4_define([_ACX_LANG_CONFTEST_PL],
[cat <<_ACEOF >conftest.pl
$1
_ACEOF])
# _ACX_PROG_PROVE_TRY([OPTS], [BODY], [IF-WORKS], [IF-NOT])
# ---------------------------------------------------------
m4_define([_ACX_PROG_PROVE_TRY],
[_ACX_LANG_CONFTEST_PL(m4_default([$2], [
printf "1..1\n";
printf "ok 1\n";
exit 0;
]))
ac_try='$PROVE $1 conftest.pl >&AS_MESSAGE_LOG_FD'
AS_IF([_AC_DO_VAR(ac_try)], [$3], [$4])])
......@@ -92,7 +92,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/check_c_alignof.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/no_cross_compiling.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/prog_prove_opt.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
......@@ -220,6 +220,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POD2MAN = @POD2MAN@
PROVE = @PROVE@
PROVEFLAGS = @PROVEFLAGS@
PROVE_HAVE_OPT___EXEC__BIN_SH = @PROVE_HAVE_OPT___EXEC__BIN_SH@
PROVE_HAVE_OPT___FAILURES = @PROVE_HAVE_OPT___FAILURES@
RANLIB = @RANLIB@
SED = @SED@
SEQ = @SEQ@
......
......@@ -94,7 +94,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/check_c_alignof.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/no_cross_compiling.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/prog_prove_opt.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
......@@ -222,6 +222,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POD2MAN = @POD2MAN@
PROVE = @PROVE@
PROVEFLAGS = @PROVEFLAGS@
PROVE_HAVE_OPT___EXEC__BIN_SH = @PROVE_HAVE_OPT___EXEC__BIN_SH@
PROVE_HAVE_OPT___FAILURES = @PROVE_HAVE_OPT___FAILURES@
RANLIB = @RANLIB@
SED = @SED@
SEQ = @SEQ@
......
......@@ -17,7 +17,7 @@ fakechroot_die () {
fakechroot_usage () {
die "Usage:
fakechroot_die "Usage:
fakechroot [-l|--lib fakechrootlib] [-d|--elfloader ldso]
[-s|--use-system-libs]
[-e|--environment type] [-c|--config-dir directory]
......@@ -60,7 +60,7 @@ fakechroot_next_cmd () {
if [ "$FAKECHROOT" = "true" ]; then
die "fakechroot: nested operation is not supported"
fakechroot_die "fakechroot: nested operation is not supported"
fi
......
......@@ -94,7 +94,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/check_c_alignof.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/no_cross_compiling.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/prog_prove_opt.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
......@@ -302,6 +302,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POD2MAN = @POD2MAN@
PROVE = @PROVE@
PROVEFLAGS = @PROVEFLAGS@
PROVE_HAVE_OPT___EXEC__BIN_SH = @PROVE_HAVE_OPT___EXEC__BIN_SH@
PROVE_HAVE_OPT___FAILURES = @PROVE_HAVE_OPT___FAILURES@
RANLIB = @RANLIB@
SED = @SED@
SEQ = @SEQ@
......
......@@ -25,8 +25,12 @@
#ifdef HAVE___LXSTAT64
#define _LARGEFILE64_SOURCE
#define _XOPEN_SOURCE
#ifndef _LARGEFILE64_SOURCE
# define _LARGEFILE64_SOURCE
#endif
#ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE
#endif
#include <sys/stat.h>
#include "libfakechroot.h"
......
......@@ -30,7 +30,10 @@
#include <sys/un.h>
#include <errno.h>
#include <stdio.h>
#include "libfakechroot.h"
#include "strlcpy.h"
#ifdef HAVE_BIND_TYPE_ARG2___CONST_SOCKADDR_ARG__
# define SOCKADDR_UN(addr) ((addr).__sockaddr_un__)
......@@ -56,8 +59,7 @@ wrapper(bind, int, (int sockfd, BIND_TYPE_ARG2(addr), socklen_t addrlen))
if (af_unix_path != NULL) {
char tmp[FAKECHROOT_PATH_MAX];
tmp[af_unix_path_max] = '\0';
strncpy(tmp, af_unix_path, af_unix_path_max - 1);
strcat(tmp, path);
snprintf(tmp, af_unix_path_max, "%s/%s", af_unix_path, path);
path = tmp;
}
else {
......@@ -70,7 +72,7 @@ wrapper(bind, int, (int sockfd, BIND_TYPE_ARG2(addr), socklen_t addrlen))
}
memset(&newaddr_un, 0, sizeof(struct sockaddr_un));
newaddr_un.sun_family = addr_un->sun_family;
strncpy(newaddr_un.sun_path, path, sizeof(newaddr_un.sun_path) - 1);
strlcpy(newaddr_un.sun_path, path, sizeof(newaddr_un.sun_path));
newaddrlen = SUN_LEN(&newaddr_un);
return nextcall(bind)(sockfd, (struct sockaddr *)&newaddr_un, newaddrlen);
}
......
......@@ -34,8 +34,12 @@
#ifdef HAVE___XSTAT64
# include "__xstat64.h"
# define STAT_T stat64
# define STAT(path, sb) nextcall(__xstat64)(_STAT_VER, path, sb)
#else
# include "stat.h"
# define STAT_T stat
# define STAT(path, sb) nextcall(stat)(path, sb)
#endif
#include "getcwd_real.h"
......@@ -48,11 +52,7 @@ wrapper(chroot, int, (const char * path))
size_t len;
char cwd[FAKECHROOT_PATH_MAX];
char tmp[FAKECHROOT_PATH_MAX], *tmpptr = tmp;
#ifdef HAVE___XSTAT64
struct stat64 sb;
#else
struct stat sb;
#endif
struct STAT_T sb;
debug("chroot(\"%s\")", path);
......@@ -76,6 +76,9 @@ wrapper(chroot, int, (const char * path))
else {
if (*path == '/') {
expand_chroot_rel_path(path);
strlcpy(tmp, path, FAKECHROOT_PATH_MAX);
dedotdot(tmpptr);
path = tmpptr;
}
else {
snprintf(tmp, FAKECHROOT_PATH_MAX, "%s/%s", cwd, path);
......@@ -84,15 +87,9 @@ wrapper(chroot, int, (const char * path))
}
}
#ifdef HAVE___XSTAT64
if ((status = nextcall(__xstat64)(_STAT_VER, path, &sb)) != 0) {
if ((status = STAT(path, &sb)) != 0) {
return status;
}
#else
if ((status = nextcall(stat)(path, &sb)) != 0) {
return status;
}
#endif
if ((sb.st_mode & S_IFMT) != S_IFDIR) {
__set_errno(ENOTDIR);
......
......@@ -30,7 +30,10 @@
#include <sys/un.h>
#include <errno.h>
#include <stdio.h>
#include "libfakechroot.h"
#include "strlcpy.h"
#ifdef HAVE_CONNECT_TYPE_ARG2___CONST_SOCKADDR_ARG__
# define SOCKADDR_UN(addr) ((addr).__sockaddr_un__)
......@@ -56,8 +59,7 @@ wrapper(connect, int, (int sockfd, CONNECT_TYPE_ARG2(addr), socklen_t addrlen))
if (af_unix_path != NULL) {
char tmp[FAKECHROOT_PATH_MAX];
tmp[af_unix_path_max] = 0;
strncpy(tmp, af_unix_path, af_unix_path_max - 1);
strcat(tmp, path);
snprintf(tmp, af_unix_path_max, "%s/%s", af_unix_path, path);
path = tmp;
}
else {
......@@ -70,7 +72,7 @@ wrapper(connect, int, (int sockfd, CONNECT_TYPE_ARG2(addr), socklen_t addrlen))
}
memset(&newaddr_un, 0, sizeof(struct sockaddr_un));
newaddr_un.sun_family = addr_un->sun_family;
strncpy(newaddr_un.sun_path, path, sizeof(newaddr_un.sun_path) - 1);
strlcpy(newaddr_un.sun_path, path, sizeof(newaddr_un.sun_path));
newaddrlen = SUN_LEN(&newaddr_un);
return nextcall(connect)(sockfd, (struct sockaddr *)&newaddr_un, newaddrlen);
}
......
......@@ -117,6 +117,12 @@ LOCAL char * getcwd_real(char *buf, size_t size)
#include <errno.h>
#ifdef HAVE___LXSTAT64
# ifndef _LARGEFILE64_SOURCE
# define _LARGEFILE64_SOURCE
# endif
#endif
#include <sys/param.h>
#include <sys/stat.h>
......@@ -126,14 +132,29 @@ LOCAL char * getcwd_real(char *buf, size_t size)
#include <string.h>
#include <unistd.h>
#include "libfakechroot.h"
#ifdef HAVE___LXSTAT64
# include "__lxstat64.h"
# define STAT_T stat64
# define FSTAT fstat64
# define LSTAT(path, buf) nextcall(__lxstat64)(_STAT_VER, path, buf)
#else
# include "lstat.h"
# define STAT_T stat
# define FSTAT fstat
# define LSTAT(path, buf) nextcall(lstat)(path, buf)
#endif
#include "opendir.h"
#if !defined(OPENDIR_CALLS___OPEN) && !defined(OPENDIR_CALLS___OPENDIR2)
# include "opendir.h"
# define OPENDIR(path) nextcall(opendir)(path)
#else
# define OPENDIR(path) opendir(path)
#endif
#undef MAXPATHLEN
#define MAXPATHLEN FAKECHROOT_PATH_MAX
#ifdef HAVE_STRUCT_DIRENT_D_NAMLEN
# define NAMLEN(d) ((d)->d_namlen)
......@@ -153,20 +174,16 @@ LOCAL char * getcwd_real(char *pt, size_t size)
ino_t ino;
int first;
char *bpt, *bup;
#ifdef HAVE___LXSTAT64
struct stat64 s;
#else
struct stat s;
#endif
struct STAT_T s;
dev_t root_dev;
ino_t root_ino;
size_t ptsize, upsize;
int save_errno;
char *ept, *eup, *up;
debug("getcwd_real(&pt, %d)", size);
debug("getcwd_real(&pt, %d)", size);
/*
/*
* If no buffer specified by the user, allocate one as necessary.
* If a buffer is specified, the size has to be non-zero. The path
* is built from the end of the buffer backwards.
......@@ -248,13 +265,8 @@ LOCAL char * getcwd_real(char *pt, size_t size)
*bup = '\0';
/* Open and stat parent directory. */
#ifdef HAVE___FXSTAT64
if (!(dir = nextcall(opendir)(up)) || __fxstat64(_STAT_VER, dirfd(dir), &s))
if (!(dir = OPENDIR(up)) || FSTAT(dirfd(dir), &s))
goto err;
#else
if (!(dir = opendir(up)) || fstat(dirfd(dir), &s))
goto err;
#endif
/* Add trailing slash for next directory. */
*bup++ = '/';
......
......@@ -28,7 +28,9 @@
#ifdef AF_UNIX
#include <sys/un.h>
#include "libfakechroot.h"
#include "strlcpy.h"
#ifdef HAVE_GETPEERNAME_TYPE_ARG2___SOCKADDR_ARG__
# define SOCKADDR(addr) ((addr).__sockaddr__)
......@@ -59,9 +61,9 @@ wrapper(getpeername, int, (int s, GETPEERNAME_TYPE_ARG2(addr), socklen_t * addrl
}
if (newaddr.sun_family == AF_UNIX && newaddr.sun_path && *(newaddr.sun_path)) {
char tmp[FAKECHROOT_PATH_MAX];
strncpy(tmp, newaddr.sun_path, FAKECHROOT_PATH_MAX);
strlcpy(tmp, newaddr.sun_path, FAKECHROOT_PATH_MAX);
narrow_chroot_path(tmp);
strncpy(newaddr.sun_path, tmp, UNIX_PATH_MAX);
strlcpy(newaddr.sun_path, tmp, UNIX_PATH_MAX);
}
memcpy((struct sockaddr_un *)SOCKADDR_UN(addr), &newaddr, *addrlen < sizeof(struct sockaddr_un) ? *addrlen : sizeof(struct sockaddr_un));
......
......@@ -28,7 +28,9 @@
#ifdef AF_UNIX
#include <sys/un.h>
#include "libfakechroot.h"
#include "strlcpy.h"
#ifdef HAVE_GETSOCKNAME_TYPE_ARG2___SOCKADDR_ARG__
# define SOCKADDR(addr) ((addr).__sockaddr__)
......@@ -59,9 +61,9 @@ wrapper(getsockname, int, (int s, GETSOCKNAME_TYPE_ARG2(addr), socklen_t * addrl
}
if (newaddr.sun_family == AF_UNIX && newaddr.sun_path && *(newaddr.sun_path)) {
char tmp[FAKECHROOT_PATH_MAX];
strncpy(tmp, newaddr.sun_path, FAKECHROOT_PATH_MAX);
strlcpy(tmp, newaddr.sun_path, FAKECHROOT_PATH_MAX);
narrow_chroot_path(tmp);
strncpy(newaddr.sun_path, tmp, UNIX_PATH_MAX);
strlcpy(newaddr.sun_path, tmp, UNIX_PATH_MAX);
}
memcpy((struct sockaddr_un *)SOCKADDR_UN(addr), &newaddr, *addrlen < sizeof(struct sockaddr_un) ? *addrlen : sizeof(struct sockaddr_un));
......
......@@ -18,6 +18,9 @@
*/
#ifndef __LSTAT_H
#define __LSTAT_H
#include <config.h>
#include "libfakechroot.h"
......@@ -28,3 +31,5 @@ wrapper_proto(lstat, int, (int, const char *, struct stat *));
int lstat_rel(const char *, struct stat *);
#endif
#endif
......@@ -18,11 +18,11 @@
*/
#include "libfakechroot.h"
#ifndef __OPEN_H
#define __OPEN_H
#include "libfakechroot.h"
wrapper_proto(open, int, (const char *, int, ...));
#endif
......@@ -18,6 +18,9 @@
*/
#ifndef __OPENDIR_H
#define __OPENDIR_H
#include <config.h>
#if !defined(OPENDIR_CALLS___OPEN) && !defined(OPENDIR_CALLS___OPENDIR2)
......@@ -28,3 +31,5 @@
wrapper_proto(opendir, DIR *, (const char *));
#endif
#endif
......@@ -39,8 +39,12 @@
#ifdef HAVE___LXSTAT64
# define _LARGEFILE64_SOURCE
# include "__lxstat64.h"
# define STAT_T stat64
# define LSTAT_REL(rpath, st) __lxstat64_rel(_STAT_VER, rpath, st)
#else
# include "lstat.h"
# define STAT_T stat
# define LSTAT_REL(rpath, st) lstat_rel(rpath, st)
#endif
......@@ -113,11 +117,7 @@ wrapper(realpath, char *, (const char * name, char * resolved))
}
for (start = end = name; *start; start = end) {
#ifdef HAVE___LXSTAT64
struct stat64 st;
#else
struct stat st;
#endif
struct STAT_T st;
int n;
/* Skip sequence of multiple path-separators. */
......@@ -178,13 +178,8 @@ wrapper(realpath, char *, (const char * name, char * resolved))
dest += end - start;
*dest = '\0';
#ifdef HAVE___LXSTAT64
if (__lxstat64_rel (_STAT_VER, rpath, &st) < 0)
if (LSTAT_REL (rpath, &st) < 0)
goto error;
#else
if (lstat_rel (rpath, &st) < 0)
goto error;
#endif
if (S_ISLNK (st.st_mode)) {
char *buf;
......
......@@ -18,8 +18,8 @@
*/
#ifndef __FREL2ABS_H
#define __FREL2ABS_H
#ifndef __FREL2ABSAT_H
#define __FREL2ABSAT_H
char * rel2absat(int, const char *, char *);
......
......@@ -39,7 +39,6 @@ suffix =
CLEANFILES = .proverc
EXTRA_DIST = $(TESTS) \
proverc \
archlinux.sh \
chroot.sh \
common.inc.sh \
......@@ -53,11 +52,17 @@ EXTRA_DIST = $(TESTS) \
t/cmd-subst-pwd.sh \
#
test:
( cd src && $(MAKE) $(AM_MAKEFLAGS) check )
if [ -n "$(PROVE)" ]; then \
cp -f $(srcdir)/proverc .proverc; \
srcdir=$(srcdir) SEQ=$(seq) $(PROVE) $(srcdir)/t; \
check-src:
cd src && $(MAKE) $(AM_MAKEFLAGS) check
prove: check-src
srcdir=$(srcdir) SEQ=$(seq) $(PROVE) $(PROVEFLAGS) $(srcdir)/t
test: check-src
if [ -n "$(PROVE)" ] && [ "$(PROVE_HAVE_OPT___EXEC__BIN_SH)" = true ]; then \
$(MAKE) $(AM_MAKEFLAGS) prove; \
else \
$(MAKE) $(AM_MAKEFLAGS) check-TESTS; \
fi
.PHONY: check-src prove test
......@@ -93,7 +93,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/check_c_alignof.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/no_cross_compiling.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/prog_prove_opt.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
......@@ -453,6 +453,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POD2MAN = @POD2MAN@
PROVE = @PROVE@
PROVEFLAGS = @PROVEFLAGS@
PROVE_HAVE_OPT___EXEC__BIN_SH = @PROVE_HAVE_OPT___EXEC__BIN_SH@
PROVE_HAVE_OPT___FAILURES = @PROVE_HAVE_OPT___FAILURES@
RANLIB = @RANLIB@
SED = @SED@
SEQ = @SEQ@
......@@ -551,7 +554,6 @@ TESTS = \
suffix =
CLEANFILES = .proverc
EXTRA_DIST = $(TESTS) \
proverc \
archlinux.sh \
chroot.sh \
common.inc.sh \
......@@ -1256,15 +1258,21 @@ uninstall-am:
uninstall uninstall-am
test:
( cd src && $(MAKE) $(AM_MAKEFLAGS) check )
if [ -n "$(PROVE)" ]; then \
cp -f $(srcdir)/proverc .proverc; \
srcdir=$(srcdir) SEQ=$(seq) $(PROVE) $(srcdir)/t; \
check-src:
cd src && $(MAKE) $(AM_MAKEFLAGS) check
prove: check-src
srcdir=$(srcdir) SEQ=$(seq) $(PROVE) $(PROVEFLAGS) $(srcdir)/t
test: check-src
if [ -n "$(PROVE)" ] && [ "$(PROVE_HAVE_OPT___EXEC__BIN_SH)" = true ]; then \
$(MAKE) $(AM_MAKEFLAGS) prove; \
else \
$(MAKE) $(AM_MAKEFLAGS) check-TESTS; \
fi
.PHONY: check-src prove test
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
TRUE=0
FALSE=1
testtree=testtree-`basename $0 .t`
is_root () {
if [ `id -u` = 0 ] && [ -z "$FAKEROOTKEY" ]; then
return $TRUE
......@@ -10,7 +12,7 @@ is_root () {
}
cleanup () {
test -n "$TEST_NO_CLEANUP" && ! test "$TEST_NO_CLEANUP" = 0 || rm -rf testtree
test -n "$TEST_NO_CLEANUP" && ! test "$TEST_NO_CLEANUP" = 0 || rm -rf $testtree
end
}
......@@ -18,9 +20,9 @@ cleanup () {
prepare () {
plan $1
rm -rf testtree
"$srcdir/testtree.sh" testtree
test "`cat testtree/CHROOT 2>&1`" = "testtree" || bail_out "cannot create testtree"
rm -rf $testtree
"$srcdir/testtree.sh" $testtree
test "`cat $testtree/CHROOT 2>&1`" = "$testtree" || bail_out "cannot create $testtree"
unset FAKECHROOT_CMD_SUBST FAKECHROOT_DEBUG FAKECHROOT_EXCLUDE_PATH
}
......
--failures
--exec '/bin/sh'
......@@ -104,7 +104,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/check_c_alignof.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/no_cross_compiling.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/prog_prove_opt.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
......@@ -326,6 +326,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POD2MAN = @POD2MAN@
PROVE = @PROVE@
PROVEFLAGS = @PROVEFLAGS@
PROVE_HAVE_OPT___EXEC__BIN_SH = @PROVE_HAVE_OPT___EXEC__BIN_SH@
PROVE_HAVE_OPT___FAILURES = @PROVE_HAVE_OPT___FAILURES@
RANLIB = @RANLIB@
SED = @SED@
SEQ = @SEQ@
......
......@@ -3,7 +3,9 @@
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#include <sys/statvfs.h>
#ifdef HAVE_SYS_STATVFS_H
# include <sys/statvfs.h>
#endif
#include <unistd.h>
#include <stdlib.h>
......@@ -22,7 +24,7 @@ int main (int argc, char *argv[]) {
exit(1);
}
printf("%ld\n", statvfsb.f_bsize);
printf((sizeof(statvfsb.f_bsize) == 8 ? "%ld\n" : "%d\n"), statvfsb.f_bsize);
return 0;
}
......@@ -27,7 +27,7 @@ for chroot in chroot fakechroot; do
else
# echo something
t=`$srcdir/$chroot.sh testtree $echo something 2>&1`
t=`$srcdir/$chroot.sh $testtree $echo something 2>&1`
# check if it is ok or print "not"
test "$t" = "something" || not
# print "ok" message with unquoted test output
......
......@@ -12,35 +12,35 @@ for chroot in chroot fakechroot; do
else
for path in / . ..; do
t=`$srcdir/$chroot.sh testtree /bin/test-canonicalize_file_name $path 2>&1`