Compare commits
1
Commits
1_3_stable
..
1_3_0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b76233290 |
No files matched your search
@@ -1,6 +1,6 @@
|
||||
VERSION = 1
|
||||
PATCHLEVEL = 3
|
||||
SUBLEVEL = 2
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION =
|
||||
NAME = Unnamed
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
char get_header_ar(archive_handle_t *archive_handle)
|
||||
{
|
||||
int err;
|
||||
file_header_t *typed = archive_handle->file_header;
|
||||
union {
|
||||
char raw[60];
|
||||
@@ -46,23 +45,15 @@ char get_header_ar(archive_handle_t *archive_handle)
|
||||
archive_handle->offset += 60;
|
||||
|
||||
/* align the headers based on the header magic */
|
||||
if (ar.formatted.magic[0] != '`' || ar.formatted.magic[1] != '\n')
|
||||
if ((ar.formatted.magic[0] != '`') || (ar.formatted.magic[1] != '\n')) {
|
||||
bb_error_msg_and_die("invalid ar header");
|
||||
}
|
||||
|
||||
/* FIXME: more thorough routine would be in order here */
|
||||
/* (we have something like that in tar) */
|
||||
/* but for now we are lax. This code works because */
|
||||
/* on misformatted numbers bb_strtou returns all-ones */
|
||||
typed->mode = err = bb_strtou(ar.formatted.mode, NULL, 8);
|
||||
if (err == -1) bb_error_msg_and_die("invalid ar header");
|
||||
typed->mtime = err = bb_strtou(ar.formatted.date, NULL, 10);
|
||||
if (err == -1) bb_error_msg_and_die("invalid ar header");
|
||||
typed->uid = err = bb_strtou(ar.formatted.uid, NULL, 10);
|
||||
if (err == -1) bb_error_msg_and_die("invalid ar header");
|
||||
typed->gid = err = bb_strtou(ar.formatted.gid, NULL, 10);
|
||||
if (err == -1) bb_error_msg_and_die("invalid ar header");
|
||||
typed->size = err = bb_strtou(ar.formatted.size, NULL, 10);
|
||||
if (err == -1) bb_error_msg_and_die("invalid ar header");
|
||||
typed->mode = xstrtoul(ar.formatted.mode, 8);
|
||||
typed->mtime = xatou(ar.formatted.date);
|
||||
typed->uid = xatou(ar.formatted.uid);
|
||||
typed->gid = xatou(ar.formatted.gid);
|
||||
typed->size = xatoul(ar.formatted.size);
|
||||
|
||||
/* long filenames have '/' as the first character */
|
||||
if (ar.formatted.name[0] == '/') {
|
||||
|
||||
@@ -74,10 +74,8 @@ char get_header_tar(archive_handle_t *archive_handle)
|
||||
|
||||
if (sizeof(tar) != 512)
|
||||
BUG_tar_header_size();
|
||||
|
||||
#if ENABLE_FEATURE_TAR_GNU_EXTENSIONS
|
||||
again:
|
||||
#endif
|
||||
|
||||
/* Align header */
|
||||
data_align(archive_handle, 512);
|
||||
|
||||
|
||||
+1
-2
@@ -120,6 +120,7 @@ struct sed_globals {
|
||||
} bbg;
|
||||
|
||||
|
||||
void sed_free_and_close_stuff(void);
|
||||
#if ENABLE_FEATURE_CLEAN_UP
|
||||
static void sed_free_and_close_stuff(void)
|
||||
{
|
||||
@@ -155,8 +156,6 @@ static void sed_free_and_close_stuff(void)
|
||||
while (bbg.current_input_file < bbg.input_file_count)
|
||||
fclose(bbg.input_file_list[bbg.current_input_file++]);
|
||||
}
|
||||
#else
|
||||
void sed_free_and_close_stuff(void);
|
||||
#endif
|
||||
|
||||
/* If something bad happens during -i operation, delete temp file */
|
||||
|
||||
+1
-3
@@ -81,7 +81,6 @@ static inline int one_char(const char* str, char c)
|
||||
}
|
||||
|
||||
|
||||
#if ENABLE_FEATURE_FIND_EXEC
|
||||
static int count_subst(const char *str)
|
||||
{
|
||||
int count = 0;
|
||||
@@ -109,7 +108,6 @@ static char* subst(const char *src, int count, const char* filename)
|
||||
strcpy(dst, src);
|
||||
return buf;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static int exec_actions(action ***appp, const char *fileName, struct stat *statbuf)
|
||||
@@ -564,8 +562,8 @@ int find_main(int argc, char **argv)
|
||||
argp[0] = "-a";
|
||||
}
|
||||
argp++;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
actions = parse_params(&argv[firstopt]);
|
||||
|
||||
|
||||
+2
-6
@@ -46,22 +46,18 @@
|
||||
#ifdef CONFIG_LOCALE_SUPPORT
|
||||
#include <locale.h>
|
||||
#else
|
||||
#define setlocale(x,y) ((void)0)
|
||||
#define setlocale(x,y)
|
||||
#endif
|
||||
|
||||
#include "pwd_.h"
|
||||
#include "grp_.h"
|
||||
/* ifdef it out, because it may include <shadow.h> */
|
||||
/* and we may not even _have_ <shadow.h>! */
|
||||
#if ENABLE_FEATURE_SHADOWPASSWDS
|
||||
#include "shadow_.h"
|
||||
#endif
|
||||
|
||||
/* Try to pull in PATH_MAX */
|
||||
#include <limits.h>
|
||||
#include <sys/param.h>
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 256
|
||||
#define PATH_MAX 256
|
||||
#endif
|
||||
|
||||
/* Tested to work correctly (IIRC :]) */
|
||||
|
||||
+7
-7
@@ -115,7 +115,7 @@ extern inline
|
||||
unsigned long bb_strtoul(const char *arg, char **endp, int base)
|
||||
{ return bb_strtoull(arg, endp, base); }
|
||||
extern inline
|
||||
long bb_strtol(const char *arg, char **endp, int base)
|
||||
unsigned long bb_strtol(const char *arg, char **endp, int base)
|
||||
{ return bb_strtoll(arg, endp, base); }
|
||||
#else
|
||||
unsigned long bb_strtoul(const char *arg, char **endp, int base);
|
||||
@@ -124,21 +124,21 @@ long bb_strtol(const char *arg, char **endp, int base);
|
||||
|
||||
#if UINT_MAX == ULLONG_MAX
|
||||
extern inline
|
||||
unsigned bb_strtou(const char *arg, char **endp, int base)
|
||||
unsigned long bb_strtou(const char *arg, char **endp, int base)
|
||||
{ return bb_strtoull(arg, endp, base); }
|
||||
extern inline
|
||||
int bb_strtoi(const char *arg, char **endp, int base)
|
||||
unsigned long bb_strtoi(const char *arg, char **endp, int base)
|
||||
{ return bb_strtoll(arg, endp, base); }
|
||||
#elif UINT_MAX == ULONG_MAX
|
||||
extern inline
|
||||
unsigned bb_strtou(const char *arg, char **endp, int base)
|
||||
unsigned long bb_strtou(const char *arg, char **endp, int base)
|
||||
{ return bb_strtoul(arg, endp, base); }
|
||||
extern inline
|
||||
int bb_strtoi(const char *arg, char **endp, int base)
|
||||
unsigned long bb_strtoi(const char *arg, char **endp, int base)
|
||||
{ return bb_strtol(arg, endp, base); }
|
||||
#else
|
||||
unsigned bb_strtou(const char *arg, char **endp, int base);
|
||||
int bb_strtoi(const char *arg, char **endp, int base);
|
||||
unsigned long bb_strtou(const char *arg, char **endp, int base);
|
||||
long bb_strtoi(const char *arg, char **endp, int base);
|
||||
#endif
|
||||
|
||||
int BUG_bb_strtou32_unimplemented(void);
|
||||
|
||||
@@ -113,7 +113,5 @@ lib-$(CONFIG_EJECT) += find_mount_point.o
|
||||
|
||||
lib-$(CONFIG_AWK) += xregcomp.o
|
||||
lib-$(CONFIG_SED) += xregcomp.o
|
||||
lib-$(CONFIG_GREP) += xregcomp.o
|
||||
lib-$(CONFIG_LESS) += xregcomp.o
|
||||
lib-$(CONFIG_MDEV) += xregcomp.o
|
||||
lib-$(CONFIG_DEVFSD) += xregcomp.o
|
||||
@@ -17,7 +17,6 @@
|
||||
* errno = ERANGE if value had alphanumeric terminating char ("1234abcg").
|
||||
* errno = ERANGE if value is out of range, missing, etc.
|
||||
* errno = ERANGE if value had minus sign for strtouXX (even "-0" is not ok )
|
||||
* return value is all-ones in this case.
|
||||
*/
|
||||
|
||||
static unsigned long long ret_ERANGE(void)
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
||||
*/
|
||||
|
||||
/* gcc warns about a null format string, therefore we provide
|
||||
* modified definition without "attribute (format)"
|
||||
* instead of including libbb.h */
|
||||
//#include "libbb.h"
|
||||
extern void bb_perror_msg(const char *s, ...);
|
||||
#include "libbb.h"
|
||||
|
||||
void bb_perror_nomsg(void)
|
||||
{
|
||||
bb_perror_msg(0);
|
||||
/* Ignore the gcc warning about a null format string. */
|
||||
bb_perror_msg(NULL);
|
||||
}
|
||||
@@ -7,13 +7,11 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
||||
*/
|
||||
|
||||
/* gcc warns about a null format string, therefore we provide
|
||||
* modified definition without "attribute (format)"
|
||||
* instead of including libbb.h */
|
||||
//#include "libbb.h"
|
||||
extern void bb_perror_msg_and_die(const char *s, ...);
|
||||
#include <stddef.h>
|
||||
#include "libbb.h"
|
||||
|
||||
void bb_perror_nomsg_and_die(void)
|
||||
{
|
||||
bb_perror_msg_and_die(0);
|
||||
/* Ignore the gcc warning about a null format string. */
|
||||
bb_perror_msg_and_die(NULL);
|
||||
}
|
||||
@@ -52,9 +52,7 @@
|
||||
|
||||
extern int __parsepwent(void *pw, char *line);
|
||||
extern int __parsegrent(void *gr, char *line);
|
||||
#if ENABLE_USE_BB_SHADOW
|
||||
extern int __parsespent(void *sp, char *line);
|
||||
#endif
|
||||
|
||||
extern int __pgsreader(int (*__parserfunc)(void *d, char *line), void *data,
|
||||
char *__restrict line_buff, size_t buflen, FILE *f);
|
||||
@@ -105,7 +103,6 @@ int fgetgrent_r(FILE *__restrict stream, struct group *__restrict resultbuf,
|
||||
return rv;
|
||||
}
|
||||
|
||||
#if ENABLE_USE_BB_SHADOW
|
||||
int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
|
||||
char *__restrict buffer, size_t buflen,
|
||||
struct spwd **__restrict result)
|
||||
@@ -120,7 +117,6 @@ int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
|
||||
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**********************************************************************/
|
||||
/* For the various fget??ent funcs, return NULL on failure and a
|
||||
@@ -148,7 +144,6 @@ struct group *fgetgrent(FILE *stream)
|
||||
return result;
|
||||
}
|
||||
|
||||
#if ENABLE_USE_BB_SHADOW
|
||||
extern int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
|
||||
char *__restrict buffer, size_t buflen,
|
||||
struct spwd **__restrict result);
|
||||
@@ -189,7 +184,6 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
|
||||
DONE:
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**********************************************************************/
|
||||
|
||||
@@ -213,7 +207,6 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
|
||||
#define DO_GETXXKEY_R_PATHNAME _PATH_GROUP
|
||||
#include "pwd_grp_internal.c"
|
||||
|
||||
#if ENABLE_USE_BB_SHADOW
|
||||
#define GETXXKEY_R_FUNC getspnam_R
|
||||
#define GETXXKEY_R_PARSER __parsespent
|
||||
#define GETXXKEY_R_ENTTYPE struct spwd
|
||||
@@ -221,7 +214,6 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
|
||||
#define DO_GETXXKEY_R_KEYTYPE const char *__restrict
|
||||
#define DO_GETXXKEY_R_PATHNAME _PATH_SHADOW
|
||||
#include "pwd_grp_internal.c"
|
||||
#endif
|
||||
|
||||
#define GETXXKEY_R_FUNC getpwuid_R
|
||||
#define GETXXKEY_R_PARSER __parsepwent
|
||||
@@ -261,7 +253,6 @@ struct group *getgrgid(gid_t gid)
|
||||
return result;
|
||||
}
|
||||
|
||||
#if 0 //ENABLE_USE_BB_SHADOW
|
||||
/* This function is non-standard and is currently not built. It seems
|
||||
* to have been created as a reentrant version of the non-standard
|
||||
* functions getspuid. Why getspuid was added, I do not know. */
|
||||
@@ -295,7 +286,6 @@ struct spwd *getspuid(uid_t uid)
|
||||
getspuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
struct passwd *getpwnam(const char *name)
|
||||
{
|
||||
@@ -317,7 +307,6 @@ struct group *getgrnam(const char *name)
|
||||
return result;
|
||||
}
|
||||
|
||||
#if ENABLE_USE_BB_SHADOW
|
||||
struct spwd *getspnam(const char *name)
|
||||
{
|
||||
static char buffer[PWD_BUFFER_SIZE];
|
||||
@@ -327,7 +316,6 @@ struct spwd *getspnam(const char *name)
|
||||
getspnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
int getpw(uid_t uid, char *buf)
|
||||
{
|
||||
@@ -456,7 +444,6 @@ int getgrent_r(struct group *__restrict resultbuf,
|
||||
return rv;
|
||||
}
|
||||
|
||||
#if ENABLE_USE_BB_SHADOW
|
||||
static FILE *spf /*= NULL*/;
|
||||
void setspent(void)
|
||||
{
|
||||
@@ -501,7 +488,6 @@ int getspent_r(struct spwd *resultbuf, char *buffer,
|
||||
UNLOCK;
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
struct passwd *getpwent(void)
|
||||
{
|
||||
@@ -523,7 +509,6 @@ struct group *getgrent(void)
|
||||
return result;
|
||||
}
|
||||
|
||||
#if ENABLE_USE_BB_SHADOW
|
||||
struct spwd *getspent(void)
|
||||
{
|
||||
static char line_buff[PWD_BUFFER_SIZE];
|
||||
@@ -543,7 +528,6 @@ struct spwd *sgetspent(const char *string)
|
||||
sgetspent_r(string, &spwd, line_buff, sizeof(line_buff), &result);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
int initgroups(const char *user, gid_t gid)
|
||||
{
|
||||
@@ -659,7 +643,6 @@ int putgrent(const struct group *__restrict p, FILE *__restrict f)
|
||||
return rv;
|
||||
}
|
||||
|
||||
#if ENABLE_USE_BB_SHADOW
|
||||
static const unsigned char _sp_off[] = {
|
||||
offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */
|
||||
offsetof(struct spwd, sp_min), /* 3 - not a char ptr */
|
||||
@@ -705,7 +688,6 @@ int putspent(const struct spwd *p, FILE *stream)
|
||||
DO_UNLOCK:
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**********************************************************************/
|
||||
/* Internal uClibc functions. */
|
||||
@@ -864,7 +846,6 @@ int __parsegrent(void *data, char *line)
|
||||
|
||||
/**********************************************************************/
|
||||
|
||||
#if ENABLE_USE_BB_SHADOW
|
||||
static const unsigned char sp_off[] = {
|
||||
offsetof(struct spwd, sp_namp), /* 0 */
|
||||
offsetof(struct spwd, sp_pwdp), /* 1 */
|
||||
@@ -919,7 +900,6 @@ int __parsespent(void *data, char * line)
|
||||
|
||||
return EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
+1
-3
@@ -275,8 +275,7 @@ int passwd_main(int argc, char **argv)
|
||||
}
|
||||
|
||||
filename = bb_path_passwd_file;
|
||||
#if ENABLE_FEATURE_SHADOWPASSWDS
|
||||
{
|
||||
if (ENABLE_FEATURE_SHADOWPASSWDS) {
|
||||
struct spwd *sp = getspnam(name);
|
||||
if (!sp) {
|
||||
/* LOGMODE_BOTH */
|
||||
@@ -288,7 +287,6 @@ int passwd_main(int argc, char **argv)
|
||||
pw->pw_passwd = sp->sp_pwdp;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Decide what the new password will be */
|
||||
newp = NULL;
|
||||
|
||||
@@ -41,6 +41,7 @@ int sulogin_main(int argc, char **argv)
|
||||
char *timeout_arg;
|
||||
const char * const *p;
|
||||
struct passwd *pwd;
|
||||
struct spwd *spwd;
|
||||
const char *shell;
|
||||
|
||||
logmode = LOGMODE_BOTH;
|
||||
@@ -74,15 +75,13 @@ int sulogin_main(int argc, char **argv)
|
||||
goto auth_error;
|
||||
}
|
||||
|
||||
#if ENABLE_FEATURE_SHADOWPASSWDS
|
||||
{
|
||||
struct spwd *spwd = getspnam(pwd->pw_name);
|
||||
if (ENABLE_FEATURE_SHADOWPASSWDS) {
|
||||
spwd = getspnam(pwd->pw_name);
|
||||
if (!spwd) {
|
||||
goto auth_error;
|
||||
}
|
||||
pwd->pw_passwd = spwd->sp_pwdp;
|
||||
}
|
||||
#endif
|
||||
|
||||
while (1) {
|
||||
/* cp points to a static buffer that is zeroed every time */
|
||||
|
||||
+1
-2
@@ -217,10 +217,9 @@ static void sendping(int junk)
|
||||
pkt->icmp_type = ICMP_ECHO;
|
||||
pkt->icmp_code = 0;
|
||||
pkt->icmp_cksum = 0;
|
||||
pkt->icmp_seq = htons(ntransmitted);
|
||||
pkt->icmp_seq = htons(ntransmitted++);
|
||||
pkt->icmp_id = myid;
|
||||
CLR(ntohs(pkt->icmp_seq) % MAX_DUP_CHK);
|
||||
ntransmitted++;
|
||||
|
||||
gettimeofday((struct timeval *) &pkt->icmp_dun, NULL);
|
||||
pkt->icmp_cksum = in_cksum((unsigned short *) pkt, sizeof(packet));
|
||||
|
||||
+1
-2
@@ -205,10 +205,9 @@ static void sendping(int junk)
|
||||
pkt->icmp6_type = ICMP6_ECHO_REQUEST;
|
||||
pkt->icmp6_code = 0;
|
||||
pkt->icmp6_cksum = 0;
|
||||
pkt->icmp6_seq = htons(ntransmitted);
|
||||
pkt->icmp6_seq = htons(ntransmitted++);
|
||||
pkt->icmp6_id = myid;
|
||||
CLR(pkt->icmp6_seq % MAX_DUP_CHK);
|
||||
ntransmitted++;
|
||||
|
||||
gettimeofday((struct timeval *) &pkt->icmp6_data8[4], NULL);
|
||||
|
||||
|
||||
@@ -259,8 +259,7 @@ static void dhcprelay_loop(int *fds, int num_sockets, int max_socket, char **cli
|
||||
{
|
||||
struct dhcpMessage dhcp_msg;
|
||||
fd_set rfds;
|
||||
size_t packlen;
|
||||
socklen_t addr_size;
|
||||
size_t packlen, addr_size;
|
||||
struct sockaddr_in client_addr;
|
||||
struct timeval tv;
|
||||
int i;
|
||||
|
||||
+2
-2
@@ -85,7 +85,7 @@
|
||||
#ifdef CONFIG_ASH_JOB_CONTROL
|
||||
#define JOBS 1
|
||||
#else
|
||||
#define JOBS 0
|
||||
#undef JOBS
|
||||
#endif
|
||||
|
||||
#if JOBS || defined(CONFIG_ASH_READ_NCHARS)
|
||||
@@ -6647,7 +6647,7 @@ usage:
|
||||
}
|
||||
#endif /* JOBS */
|
||||
|
||||
#if JOBS || DEBUG
|
||||
#if defined(JOBS) || DEBUG
|
||||
static int
|
||||
jobno(const struct job *jp)
|
||||
{
|
||||
|
||||
@@ -1693,13 +1693,10 @@ int mount_main(int argc, char **argv)
|
||||
|
||||
// Mount this thing.
|
||||
|
||||
// NFS mounts want this to be xrealloc-able
|
||||
mtcur->mnt_opts = xstrdup(mtcur->mnt_opts);
|
||||
if (singlemount(mtcur, 1)) {
|
||||
/* Count number of failed mounts */
|
||||
rc++;
|
||||
}
|
||||
free(mtcur->mnt_opts);
|
||||
}
|
||||
}
|
||||
if (ENABLE_FEATURE_CLEAN_UP) endmntent(fstab);
|
||||
|
||||
Reference in new issue
Block a user