Compare commits

..
4 Commits
Author SHA1 Message Date
Denis Vlasenko 8b7f6928c6 releasing busybox 1.3.2 2007-01-20 20:20:32 +00:00
Denis Vlasenko a2af67a8c5 busybox 1.3.1 'Christmas Tree' 2006-12-27 04:58:43 +00:00
Denis Vlasenko d0119d15f9 Simple fixes accumulated after 1.3.0.
busybox-1.3.0.ash.patch
busybox-1.3.0.bb_strtou.patch
busybox-1.3.0.CONFIG_FEATURE_TAR_GNU_EXTENSIONS.patch
busybox-1.3.0.dhcprelay.patch
busybox-1.3.0.dpkg_ar.patch
busybox-1.3.0.find.patch
busybox-1.3.0.mount.patch
busybox-1.3.0.perror.patch
busybox-1.3.0.sed.patch
busybox-1.3.0.shadow.patch
busybox-1.3.0.xregcomp.patch
2006-12-27 04:44:51 +00:00
Denis Vlasenko 8d42f86b14 Correcting branch name to be like previous ones 2006-12-27 04:35:04 +00:00
17 changed files with 87 additions and 34 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
VERSION = 1
PATCHLEVEL = 3
SUBLEVEL = 0
SUBLEVEL = 2
EXTRAVERSION =
NAME = Unnamed
+16 -7
View File
@@ -9,6 +9,7 @@
char get_header_ar(archive_handle_t *archive_handle)
{
int err;
file_header_t *typed = archive_handle->file_header;
union {
char raw[60];
@@ -45,15 +46,23 @@ 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");
}
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);
/* 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");
/* long filenames have '/' as the first character */
if (ar.formatted.name[0] == '/') {
+3 -1
View File
@@ -74,8 +74,10 @@ char get_header_tar(archive_handle_t *archive_handle)
if (sizeof(tar) != 512)
BUG_tar_header_size();
again:
#if ENABLE_FEATURE_TAR_GNU_EXTENSIONS
again:
#endif
/* Align header */
data_align(archive_handle, 512);
+2 -1
View File
@@ -120,7 +120,6 @@ struct sed_globals {
} bbg;
void sed_free_and_close_stuff(void);
#if ENABLE_FEATURE_CLEAN_UP
static void sed_free_and_close_stuff(void)
{
@@ -156,6 +155,8 @@ 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 */
+3 -1
View File
@@ -81,6 +81,7 @@ 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;
@@ -108,6 +109,7 @@ 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)
@@ -562,8 +564,8 @@ int find_main(int argc, char **argv)
argp[0] = "-a";
}
argp++;
}
#endif
}
actions = parse_params(&argv[firstopt]);
+6 -2
View File
@@ -46,18 +46,22 @@
#ifdef CONFIG_LOCALE_SUPPORT
#include <locale.h>
#else
#define setlocale(x,y)
#define setlocale(x,y) ((void)0)
#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
View File
@@ -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
unsigned long bb_strtol(const char *arg, char **endp, int base)
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 long bb_strtou(const char *arg, char **endp, int base)
unsigned bb_strtou(const char *arg, char **endp, int base)
{ return bb_strtoull(arg, endp, base); }
extern inline
unsigned long bb_strtoi(const char *arg, char **endp, int base)
int bb_strtoi(const char *arg, char **endp, int base)
{ return bb_strtoll(arg, endp, base); }
#elif UINT_MAX == ULONG_MAX
extern inline
unsigned long bb_strtou(const char *arg, char **endp, int base)
unsigned bb_strtou(const char *arg, char **endp, int base)
{ return bb_strtoul(arg, endp, base); }
extern inline
unsigned long bb_strtoi(const char *arg, char **endp, int base)
int bb_strtoi(const char *arg, char **endp, int base)
{ return bb_strtol(arg, endp, base); }
#else
unsigned long bb_strtou(const char *arg, char **endp, int base);
long bb_strtoi(const char *arg, char **endp, int base);
unsigned bb_strtou(const char *arg, char **endp, int base);
int bb_strtoi(const char *arg, char **endp, int base);
#endif
int BUG_bb_strtou32_unimplemented(void);
+2
View File
@@ -113,5 +113,7 @@ 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
+1
View File
@@ -17,6 +17,7 @@
* 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)
+6 -3
View File
@@ -7,10 +7,13 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "libbb.h"
/* 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, ...);
void bb_perror_nomsg(void)
{
/* Ignore the gcc warning about a null format string. */
bb_perror_msg(NULL);
bb_perror_msg(0);
}
+6 -4
View File
@@ -7,11 +7,13 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <stddef.h>
#include "libbb.h"
/* 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, ...);
void bb_perror_nomsg_and_die(void)
{
/* Ignore the gcc warning about a null format string. */
bb_perror_msg_and_die(NULL);
bb_perror_msg_and_die(0);
}
+20
View File
@@ -52,7 +52,9 @@
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);
@@ -103,6 +105,7 @@ 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)
@@ -117,6 +120,7 @@ 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
@@ -144,6 +148,7 @@ 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);
@@ -184,6 +189,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
DONE:
return rv;
}
#endif
/**********************************************************************/
@@ -207,6 +213,7 @@ 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
@@ -214,6 +221,7 @@ 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
@@ -253,6 +261,7 @@ 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. */
@@ -286,6 +295,7 @@ struct spwd *getspuid(uid_t uid)
getspuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result);
return result;
}
#endif
struct passwd *getpwnam(const char *name)
{
@@ -307,6 +317,7 @@ 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];
@@ -316,6 +327,7 @@ struct spwd *getspnam(const char *name)
getspnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
return result;
}
#endif
int getpw(uid_t uid, char *buf)
{
@@ -444,6 +456,7 @@ int getgrent_r(struct group *__restrict resultbuf,
return rv;
}
#if ENABLE_USE_BB_SHADOW
static FILE *spf /*= NULL*/;
void setspent(void)
{
@@ -488,6 +501,7 @@ int getspent_r(struct spwd *resultbuf, char *buffer,
UNLOCK;
return rv;
}
#endif
struct passwd *getpwent(void)
{
@@ -509,6 +523,7 @@ struct group *getgrent(void)
return result;
}
#if ENABLE_USE_BB_SHADOW
struct spwd *getspent(void)
{
static char line_buff[PWD_BUFFER_SIZE];
@@ -528,6 +543,7 @@ 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)
{
@@ -643,6 +659,7 @@ 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 */
@@ -688,6 +705,7 @@ int putspent(const struct spwd *p, FILE *stream)
DO_UNLOCK:
return rv;
}
#endif
/**********************************************************************/
/* Internal uClibc functions. */
@@ -846,6 +864,7 @@ 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 */
@@ -900,6 +919,7 @@ int __parsespent(void *data, char * line)
return EINVAL;
}
#endif
/**********************************************************************/
+3 -1
View File
@@ -275,7 +275,8 @@ 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 */
@@ -287,6 +288,7 @@ int passwd_main(int argc, char **argv)
pw->pw_passwd = sp->sp_pwdp;
}
}
#endif
/* Decide what the new password will be */
newp = NULL;
+4 -3
View File
@@ -41,7 +41,6 @@ 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;
@@ -75,13 +74,15 @@ int sulogin_main(int argc, char **argv)
goto auth_error;
}
if (ENABLE_FEATURE_SHADOWPASSWDS) {
spwd = getspnam(pwd->pw_name);
#if ENABLE_FEATURE_SHADOWPASSWDS
{
struct spwd *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 */
+2 -1
View File
@@ -259,7 +259,8 @@ static void dhcprelay_loop(int *fds, int num_sockets, int max_socket, char **cli
{
struct dhcpMessage dhcp_msg;
fd_set rfds;
size_t packlen, addr_size;
size_t packlen;
socklen_t addr_size;
struct sockaddr_in client_addr;
struct timeval tv;
int i;
+2 -2
View File
@@ -85,7 +85,7 @@
#ifdef CONFIG_ASH_JOB_CONTROL
#define JOBS 1
#else
#undef JOBS
#define JOBS 0
#endif
#if JOBS || defined(CONFIG_ASH_READ_NCHARS)
@@ -6647,7 +6647,7 @@ usage:
}
#endif /* JOBS */
#if defined(JOBS) || DEBUG
#if JOBS || DEBUG
static int
jobno(const struct job *jp)
{
+3
View File
@@ -1693,10 +1693,13 @@ 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);