mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 01:32:08 +00:00
Update how we detect if libc5 is in use.
-Erik
This commit is contained in:
parent
d3f97f1971
commit
b6b519b416
@ -49,6 +49,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
|
|||||||
switch (whichApp) {
|
switch (whichApp) {
|
||||||
case CHGRP_APP:
|
case CHGRP_APP:
|
||||||
case CHOWN_APP:
|
case CHOWN_APP:
|
||||||
|
/* Don't use lchown for libc5 or glibc older then 2.1.x */
|
||||||
#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1)
|
#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1)
|
||||||
if (lchown
|
if (lchown
|
||||||
(fileName, (whichApp == CHOWN_APP) ? uid : statbuf->st_uid,
|
(fileName, (whichApp == CHOWN_APP) ? uid : statbuf->st_uid,
|
||||||
|
9
dutmp.c
9
dutmp.c
@ -41,11 +41,9 @@ extern int dutmp_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Kludge around the fact that the binary format for utmp has changed, and the
|
/* Kludge around the fact that the binary format for utmp has changed. */
|
||||||
* fact the stupid libc doesn't have a reliable #define to announce that libc5
|
#if __GNU_LIBRARY__ < 5
|
||||||
* is being used. sigh.
|
/* Linux libc5 */
|
||||||
*/
|
|
||||||
#if ! defined __GLIBC__ || defined __UCLIBC__
|
|
||||||
while (read(file, (void*)&ut, sizeof(struct utmp))) {
|
while (read(file, (void*)&ut, sizeof(struct utmp))) {
|
||||||
printf("%d|%d|%s|%s|%s|%s|%s|%lx\n",
|
printf("%d|%d|%s|%s|%s|%s|%s|%lx\n",
|
||||||
ut.ut_type, ut.ut_pid, ut.ut_line,
|
ut.ut_type, ut.ut_pid, ut.ut_line,
|
||||||
@ -54,6 +52,7 @@ extern int dutmp_main(int argc, char **argv)
|
|||||||
(long)ut.ut_addr);
|
(long)ut.ut_addr);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
/* Glibc, uClibc, etc */
|
||||||
while (read(file, (void*)&ut, sizeof(struct utmp))) {
|
while (read(file, (void*)&ut, sizeof(struct utmp))) {
|
||||||
printf("%d|%d|%s|%s|%s|%s|%d|%d|%ld|%ld|%ld|%x\n",
|
printf("%d|%d|%s|%s|%s|%s|%d|%d|%ld|%ld|%ld|%x\n",
|
||||||
ut.ut_type, ut.ut_pid, ut.ut_line,
|
ut.ut_type, ut.ut_pid, ut.ut_line,
|
||||||
|
@ -34,9 +34,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <features.h>
|
#include <features.h>
|
||||||
/* Stupid libc doesn't have a reliable way for use to know
|
|
||||||
* that libc5 is being used. Assume this is good enough */
|
#if __GNU_LIBRARY__ < 5
|
||||||
#if ! defined __GLIBC__ && ! defined __UCLIBC__
|
|
||||||
/* libc5 doesn't define socklen_t */
|
/* libc5 doesn't define socklen_t */
|
||||||
typedef unsigned int socklen_t;
|
typedef unsigned int socklen_t;
|
||||||
/* libc5 doesn't implement BSD 4.4 daemon() */
|
/* libc5 doesn't implement BSD 4.4 daemon() */
|
||||||
|
14
init.c
14
init.c
@ -85,13 +85,13 @@ static const int RB_ENABLE_CAD = 0x89abcdef;
|
|||||||
static const int RB_DISABLE_CAD = 0;
|
static const int RB_DISABLE_CAD = 0;
|
||||||
#define RB_POWER_OFF 0x4321fedc
|
#define RB_POWER_OFF 0x4321fedc
|
||||||
static const int RB_AUTOBOOT = 0x01234567;
|
static const int RB_AUTOBOOT = 0x01234567;
|
||||||
#if defined(__GLIBC__) || defined (__UCLIBC__)
|
|
||||||
#include <sys/reboot.h>
|
#if __GNU_LIBRARY__ > 5
|
||||||
|
#include <sys/reboot.h>
|
||||||
#define init_reboot(magic) reboot(magic)
|
#define init_reboot(magic) reboot(magic)
|
||||||
#else
|
#else
|
||||||
#define init_reboot(magic) reboot(0xfee1dead, 672274793, magic)
|
#define init_reboot(magic) reboot(0xfee1dead, 672274793, magic)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _PATH_STDPATH
|
#ifndef _PATH_STDPATH
|
||||||
#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
|
#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
|
||||||
@ -112,11 +112,11 @@ static const int RB_AUTOBOOT = 0x01234567;
|
|||||||
|
|
||||||
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
|
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
|
||||||
|
|
||||||
#if defined(__GLIBC__)
|
#if __GNU_LIBRARY__ > 5
|
||||||
#include <sys/kdaemon.h>
|
#include <sys/kdaemon.h>
|
||||||
#else
|
#else
|
||||||
extern int bdflush (int func, long int data);
|
extern int bdflush (int func, long int data);
|
||||||
#endif /* __GLIBC__ */
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define VT_PRIMARY "/dev/tty1" /* Primary virtual console */
|
#define VT_PRIMARY "/dev/tty1" /* Primary virtual console */
|
||||||
|
14
init/init.c
14
init/init.c
@ -85,13 +85,13 @@ static const int RB_ENABLE_CAD = 0x89abcdef;
|
|||||||
static const int RB_DISABLE_CAD = 0;
|
static const int RB_DISABLE_CAD = 0;
|
||||||
#define RB_POWER_OFF 0x4321fedc
|
#define RB_POWER_OFF 0x4321fedc
|
||||||
static const int RB_AUTOBOOT = 0x01234567;
|
static const int RB_AUTOBOOT = 0x01234567;
|
||||||
#if defined(__GLIBC__) || defined (__UCLIBC__)
|
|
||||||
#include <sys/reboot.h>
|
#if __GNU_LIBRARY__ > 5
|
||||||
|
#include <sys/reboot.h>
|
||||||
#define init_reboot(magic) reboot(magic)
|
#define init_reboot(magic) reboot(magic)
|
||||||
#else
|
#else
|
||||||
#define init_reboot(magic) reboot(0xfee1dead, 672274793, magic)
|
#define init_reboot(magic) reboot(0xfee1dead, 672274793, magic)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _PATH_STDPATH
|
#ifndef _PATH_STDPATH
|
||||||
#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
|
#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
|
||||||
@ -112,11 +112,11 @@ static const int RB_AUTOBOOT = 0x01234567;
|
|||||||
|
|
||||||
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
|
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
|
||||||
|
|
||||||
#if defined(__GLIBC__)
|
#if __GNU_LIBRARY__ > 5
|
||||||
#include <sys/kdaemon.h>
|
#include <sys/kdaemon.h>
|
||||||
#else
|
#else
|
||||||
extern int bdflush (int func, long int data);
|
extern int bdflush (int func, long int data);
|
||||||
#endif /* __GLIBC__ */
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define VT_PRIMARY "/dev/tty1" /* Primary virtual console */
|
#define VT_PRIMARY "/dev/tty1" /* Primary virtual console */
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* that either displays or sets the characteristics of
|
* that either displays or sets the characteristics of
|
||||||
* one or more of the system's networking interfaces.
|
* one or more of the system's networking interfaces.
|
||||||
*
|
*
|
||||||
* Version: $Id: interface.c,v 1.5 2001/03/15 15:37:48 mjn3 Exp $
|
* Version: $Id: interface.c,v 1.6 2001/04/09 23:52:18 andersen Exp $
|
||||||
*
|
*
|
||||||
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
|
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
|
||||||
* and others. Copyright 1993 MicroWalt Corporation
|
* and others. Copyright 1993 MicroWalt Corporation
|
||||||
@ -115,7 +115,7 @@ struct in6_ifreq {
|
|||||||
#endif /* HAVE_AFINET6 */
|
#endif /* HAVE_AFINET6 */
|
||||||
|
|
||||||
#if HAVE_AFIPX
|
#if HAVE_AFIPX
|
||||||
#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
|
#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1)
|
||||||
#include <netipx/ipx.h>
|
#include <netipx/ipx.h>
|
||||||
#else
|
#else
|
||||||
#include "ipx.h"
|
#include "ipx.h"
|
||||||
|
@ -32,9 +32,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
/* Stupid libc doesn't have a reliable way for use to know
|
#if __GNU_LIBRARY__ < 5
|
||||||
* that libc5 is being used. Assume this is good enough */
|
|
||||||
#if ! defined __GLIBC__ && ! defined __UCLIBC__
|
|
||||||
|
|
||||||
int daemon( int nochdir, int noclose )
|
int daemon( int nochdir, int noclose )
|
||||||
{
|
{
|
||||||
|
@ -34,9 +34,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <features.h>
|
#include <features.h>
|
||||||
/* Stupid libc doesn't have a reliable way for use to know
|
|
||||||
* that libc5 is being used. Assume this is good enough */
|
#if __GNU_LIBRARY__ < 5
|
||||||
#if ! defined __GLIBC__ && ! defined __UCLIBC__
|
|
||||||
/* libc5 doesn't define socklen_t */
|
/* libc5 doesn't define socklen_t */
|
||||||
typedef unsigned int socklen_t;
|
typedef unsigned int socklen_t;
|
||||||
/* libc5 doesn't implement BSD 4.4 daemon() */
|
/* libc5 doesn't implement BSD 4.4 daemon() */
|
||||||
|
@ -35,9 +35,7 @@
|
|||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include "busybox.h"
|
#include "busybox.h"
|
||||||
|
|
||||||
/* Stupid libc doesn't have a reliable way for use to know
|
#if __GNU_LIBRARY__ < 5
|
||||||
* that libc5 is being used. Assume this is good enough */
|
|
||||||
#if ! defined __GLIBC__ && ! defined __UCLIBC__
|
|
||||||
#error Sorry. Looks like you are using libc5.
|
#error Sorry. Looks like you are using libc5.
|
||||||
#error libc5 shm support isnt good enough.
|
#error libc5 shm support isnt good enough.
|
||||||
#error Please disable BB_FEATURE_IPC_SYSLOG
|
#error Please disable BB_FEATURE_IPC_SYSLOG
|
||||||
|
@ -41,11 +41,9 @@ extern int dutmp_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Kludge around the fact that the binary format for utmp has changed, and the
|
/* Kludge around the fact that the binary format for utmp has changed. */
|
||||||
* fact the stupid libc doesn't have a reliable #define to announce that libc5
|
#if __GNU_LIBRARY__ < 5
|
||||||
* is being used. sigh.
|
/* Linux libc5 */
|
||||||
*/
|
|
||||||
#if ! defined __GLIBC__ || defined __UCLIBC__
|
|
||||||
while (read(file, (void*)&ut, sizeof(struct utmp))) {
|
while (read(file, (void*)&ut, sizeof(struct utmp))) {
|
||||||
printf("%d|%d|%s|%s|%s|%s|%s|%lx\n",
|
printf("%d|%d|%s|%s|%s|%s|%s|%lx\n",
|
||||||
ut.ut_type, ut.ut_pid, ut.ut_line,
|
ut.ut_type, ut.ut_pid, ut.ut_line,
|
||||||
@ -54,6 +52,7 @@ extern int dutmp_main(int argc, char **argv)
|
|||||||
(long)ut.ut_addr);
|
(long)ut.ut_addr);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
/* Glibc, uClibc, etc */
|
||||||
while (read(file, (void*)&ut, sizeof(struct utmp))) {
|
while (read(file, (void*)&ut, sizeof(struct utmp))) {
|
||||||
printf("%d|%d|%s|%s|%s|%s|%d|%d|%ld|%ld|%ld|%x\n",
|
printf("%d|%d|%s|%s|%s|%s|%d|%d|%ld|%ld|%ld|%x\n",
|
||||||
ut.ut_type, ut.ut_pid, ut.ut_line,
|
ut.ut_type, ut.ut_pid, ut.ut_line,
|
||||||
|
@ -33,11 +33,11 @@
|
|||||||
#include <unistd.h> /* for getopt() */
|
#include <unistd.h> /* for getopt() */
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#if defined(__GLIBC__)
|
#if __GNU_LIBRARY__ > 5
|
||||||
#include <sys/kdaemon.h>
|
#include <sys/kdaemon.h>
|
||||||
#else
|
#else
|
||||||
extern int bdflush (int func, long int data);
|
extern int bdflush (int func, long int data);
|
||||||
#endif /* __GLIBC__ */
|
#endif
|
||||||
|
|
||||||
#include "busybox.h"
|
#include "busybox.h"
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* vi: set sw=4 ts=4: */
|
/* vi: set sw=4 ts=4: */
|
||||||
/*
|
/*
|
||||||
* $Id: ping.c,v 1.39 2001/03/14 01:23:07 andersen Exp $
|
* $Id: ping.c,v 1.40 2001/04/09 23:52:18 andersen Exp $
|
||||||
* Mini ping implementation for busybox
|
* Mini ping implementation for busybox
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
||||||
@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
/* It turns out that libc5 doesn't have proper icmp support
|
/* It turns out that libc5 doesn't have proper icmp support
|
||||||
* built into it header files, so we have to supplement it */
|
* built into it header files, so we have to supplement it */
|
||||||
#if ! defined __GLIBC__ && ! defined __UCLIBC__
|
#if __GNU_LIBRARY__ < 5
|
||||||
static const int ICMP_MINLEN = 8; /* abs minimum */
|
static const int ICMP_MINLEN = 8; /* abs minimum */
|
||||||
|
|
||||||
struct icmp_ra_addr
|
struct icmp_ra_addr
|
||||||
|
4
ping.c
4
ping.c
@ -1,6 +1,6 @@
|
|||||||
/* vi: set sw=4 ts=4: */
|
/* vi: set sw=4 ts=4: */
|
||||||
/*
|
/*
|
||||||
* $Id: ping.c,v 1.39 2001/03/14 01:23:07 andersen Exp $
|
* $Id: ping.c,v 1.40 2001/04/09 23:52:18 andersen Exp $
|
||||||
* Mini ping implementation for busybox
|
* Mini ping implementation for busybox
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
||||||
@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
/* It turns out that libc5 doesn't have proper icmp support
|
/* It turns out that libc5 doesn't have proper icmp support
|
||||||
* built into it header files, so we have to supplement it */
|
* built into it header files, so we have to supplement it */
|
||||||
#if ! defined __GLIBC__ && ! defined __UCLIBC__
|
#if __GNU_LIBRARY__ < 5
|
||||||
static const int ICMP_MINLEN = 8; /* abs minimum */
|
static const int ICMP_MINLEN = 8; /* abs minimum */
|
||||||
|
|
||||||
struct icmp_ra_addr
|
struct icmp_ra_addr
|
||||||
|
@ -35,9 +35,7 @@
|
|||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include "busybox.h"
|
#include "busybox.h"
|
||||||
|
|
||||||
/* Stupid libc doesn't have a reliable way for use to know
|
#if __GNU_LIBRARY__ < 5
|
||||||
* that libc5 is being used. Assume this is good enough */
|
|
||||||
#if ! defined __GLIBC__ && ! defined __UCLIBC__
|
|
||||||
#error Sorry. Looks like you are using libc5.
|
#error Sorry. Looks like you are using libc5.
|
||||||
#error libc5 shm support isnt good enough.
|
#error libc5 shm support isnt good enough.
|
||||||
#error Please disable BB_FEATURE_IPC_SYSLOG
|
#error Please disable BB_FEATURE_IPC_SYSLOG
|
||||||
|
8
update.c
8
update.c
@ -33,11 +33,11 @@
|
|||||||
#include <unistd.h> /* for getopt() */
|
#include <unistd.h> /* for getopt() */
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#if defined(__GLIBC__)
|
#if __GNU_LIBRARY__ > 5
|
||||||
#include <sys/kdaemon.h>
|
#include <sys/kdaemon.h>
|
||||||
#else
|
#else
|
||||||
extern int bdflush (int func, long int data);
|
extern int bdflush (int func, long int data);
|
||||||
#endif /* __GLIBC__ */
|
#endif
|
||||||
|
|
||||||
#include "busybox.h"
|
#include "busybox.h"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user