* to pick a random letter to add to out temporary file. */
typedef unsigned long int bb_uint64_t;
+#define tempFn bb_common_bufsiz1
+
/* if fn is NULL then input is stdin and output is stdout */
static int convert(char *fn, int ConvType)
{
int c, fd;
struct timeval tv;
- RESERVE_CONFIG_BUFFER(tempFn, BUFSIZ);
static bb_uint64_t value=0;
FILE *in, *out;
int retval = EXIT_SUCCESS;
#ifdef CONFIG_FEATURE_TEE_USE_BLOCK_IO
ssize_t c;
- RESERVE_CONFIG_BUFFER(buf, BUFSIZ);
+# define buf bb_common_bufsiz1
#else
int c;
#endif
retval = EXIT_FAILURE;
}
-#ifdef CONFIG_FEATURE_CLEAN_UP
- RELEASE_CONFIG_BUFFER(buf);
-#endif
-
#else
setvbuf(stdout, NULL, _IONBF, 0);
while ((c = getchar()) != EOF) {
static char com_fl, del_fl, sq_fl;
static short in_index, out_index;
/* these last are pointers to static buffers declared in tr_main */
-static unsigned char *poutput, *pinput;
+static unsigned char *poutput;
static unsigned char *pvector;
static char *pinvec, *poutvec;
+#define input bb_common_bufsiz1
static void convert(void)
{
for (;;) {
if (in_index == read_chars) {
- if ((read_chars = read(0, (char *) pinput, BUFSIZ)) <= 0) {
+ if ((read_chars = read(0, input, BUFSIZ)) <= 0) {
if (write(1, (char *) poutput, out_index) != out_index)
bb_error_msg(bb_msg_write_error);
exit(0);
}
in_index = 0;
}
- c = pinput[in_index++];
+ c = input[in_index++];
coded = pvector[c];
if (del_fl && pinvec[c])
continue;
int idx = 1;
int i;
RESERVE_CONFIG_BUFFER(output, BUFSIZ);
- RESERVE_CONFIG_BUFFER(input, BUFSIZ);
RESERVE_CONFIG_UBUFFER(vector, ASCII+1);
RESERVE_CONFIG_BUFFER(invec, ASCII+1);
RESERVE_CONFIG_BUFFER(outvec, ASCII+1);
/* ... but make them available globally */
poutput = output;
- pinput = input;
pvector = vector;
pinvec = invec;
poutvec = outvec;
return (FD_ISSET(0, &rfds));
}
-static Byte readbuffer[BUFSIZ];
+#define readbuffer bb_common_bufsiz1
+
static int readed_for_parse;
//----- IO Routines --------------------------------------------
extern const char * const bb_path_securetty_file;
extern const char * const bb_path_motd_file;
extern const char * const bb_dev_null;
+
+#ifndef BUFSIZ
+#define BUFSIZ 4096
+#endif
+extern char bb_common_bufsiz1[BUFSIZ+1];
+
/*
* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don`t use,
* use bb_default_login_shell and next defines,
can_not_create_raw_socket.o perm_denied_are_you_root.o \
shadow_file.o passwd_file.o group_file.o gshadow_file.o nologin_file.o \
securetty_file.o motd_file.o \
- msg_standard_input.o msg_standard_output.o shell_file.o bb_dev_null.o
+ msg_standard_input.o msg_standard_output.o shell_file.o \
+ bb_dev_null.o bb_common_bufsiz1.o
LIBBB_MSRC1:=$(srcdir)/xfuncs.c
LIBBB_MOBJ1:=xmalloc.o xrealloc.o xcalloc.o xstrdup.o xstrndup.o \
const char * const bb_dev_null = "/dev/null";
#endif
+#ifdef L_bb_common_bufsiz1
+char bb_common_bufsiz1[BUFSIZ+1];
+#endif
#define TCGETA TCGETS
#define TCSETA TCSETS
#define TCSETAW TCSETSW
-#endif
-
- /*
- * This program tries to not use the standard-i/o library. This keeps the
- * executable small on systems that do not have shared libraries (System V
- * Release <3).
- */
-#ifndef BUFSIZ
-#define BUFSIZ 1024
#endif
/*
/* return NULL on failure, logname on success */
static char *get_logname(struct options *op, struct chardata *cp, struct termio *tp)
{
- static char logname[BUFSIZ];
+#define logname bb_common_bufsiz1
char *bp;
- char c; /* input character, full eight bits */
- char ascval; /* low 7 bits of input character */
- int bits; /* # of "1" bits per character */
- int mask; /* mask with 1 bit up */
+ char c; /* input character, full eight bits */
+ char ascval; /* low 7 bits of input character */
+ int bits; /* # of "1" bits per character */
+ int mask; /* mask with 1 bit up */
static char *erase[] = { /* backspace-space-backspace */
"\010\040\010", /* space parity */
"\010\040\010", /* odd parity */
#define SULOGIN_PROMPT "\nGive root password for system maintenance\n" \
"(or type Control-D for normal startup):"
-static const char *forbid[] = {
+static const char * const forbid[] = {
"ENV",
"BASH_ENV",
"HOME",
char *device = (char *) 0;
const char *name = "root";
int timeout = 0;
- static char pass[BUFSIZ];
+
+#define pass bb_common_bufsiz1
+
struct passwd pwent;
struct passwd *pwd;
time_t start, now;
- const char **p;
+ const char * const *p;
#ifdef CONFIG_FEATURE_SHADOWPASSWDS
struct spwd *spwd = NULL;
#endif /* CONFIG_FEATURE_SHADOWPASSWDS */
int nc_main(int argc, char **argv)
{
int do_listen = 0, lport = 0, delay = 0, wsecs = 0, tmpfd, opt, sfd, x;
- char buf[BUFSIZ];
+
+#define buf bb_common_bufsiz1
+
#ifdef CONFIG_NC_GAPING_SECURITY_HOLE
char *pr00gie = NULL;
#endif
};
static struct parsefile basepf; /* top level input file */
-static char basebuf[IBUFSIZ]; /* buffer for top level input file */
+#define basebuf bb_common_bufsiz1 /* buffer for top level input file */
static struct parsefile *parsefile = &basepf; /* current input file */
*/
#define EOF_NLEFT -99 /* value of parsenleft when EOF pushed back */
-#define IBUFSIZ (BUFSIZ + 1)
static void pushfile(void);