mirror of
https://github.com/sheumann/hush.git
synced 2024-12-25 18:33:06 +00:00
message string changes, mostly for consistency, also -32 bytes in .rodata
This commit is contained in:
parent
dd2982882b
commit
e1a0d486e4
@ -135,7 +135,7 @@ static void parse_config_file(void)
|
|||||||
|| !S_ISREG(st.st_mode) /* Not a regular file? */
|
|| !S_ISREG(st.st_mode) /* Not a regular file? */
|
||||||
|| (st.st_uid != 0) /* Not owned by root? */
|
|| (st.st_uid != 0) /* Not owned by root? */
|
||||||
|| (st.st_mode & (S_IWGRP | S_IWOTH)) /* Writable by non-root? */
|
|| (st.st_mode & (S_IWGRP | S_IWOTH)) /* Writable by non-root? */
|
||||||
|| !(f = fopen(config_file, "r")) /* Can not open? */
|
|| !(f = fopen(config_file, "r")) /* Cannot open? */
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -338,7 +338,7 @@ static void check_suid(struct BB_applet *applet)
|
|||||||
m >>= 3;
|
m >>= 3;
|
||||||
|
|
||||||
if (!(m & S_IXOTH)) /* is x bit not set ? */
|
if (!(m & S_IXOTH)) /* is x bit not set ? */
|
||||||
bb_error_msg_and_die ("You have no permission to run this applet!");
|
bb_error_msg_and_die("you have no permission to run this applet!");
|
||||||
|
|
||||||
if ((sct->m_mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { /* *both* have to be set for sgid */
|
if ((sct->m_mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { /* *both* have to be set for sgid */
|
||||||
xsetgid(sct->m_gid);
|
xsetgid(sct->m_gid);
|
||||||
@ -365,7 +365,7 @@ static void check_suid(struct BB_applet *applet)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (applet->need_suid == _BB_SUID_ALWAYS) {
|
if (applet->need_suid == _BB_SUID_ALWAYS) {
|
||||||
if (geteuid()) bb_error_msg_and_die("Applet requires root privileges!");
|
if (geteuid()) bb_error_msg_and_die("applet requires root privileges!");
|
||||||
} else if (applet->need_suid == _BB_SUID_NEVER) {
|
} else if (applet->need_suid == _BB_SUID_NEVER) {
|
||||||
xsetgid(rgid); /* drop all privileges */
|
xsetgid(rgid); /* drop all privileges */
|
||||||
xsetuid(ruid);
|
xsetuid(ruid);
|
||||||
|
@ -83,7 +83,7 @@ int ar_main(int argc, char **argv)
|
|||||||
|
|
||||||
xread(archive_handle->src_fd, magic, 7);
|
xread(archive_handle->src_fd, magic, 7);
|
||||||
if (strncmp(magic, "!<arch>", 7) != 0) {
|
if (strncmp(magic, "!<arch>", 7) != 0) {
|
||||||
bb_error_msg_and_die("Invalid ar magic");
|
bb_error_msg_and_die("invalid ar magic");
|
||||||
}
|
}
|
||||||
archive_handle->offset += 7;
|
archive_handle->offset += 7;
|
||||||
|
|
||||||
|
@ -711,7 +711,7 @@ static unsigned int get_status(const unsigned int status_node, const int num)
|
|||||||
/* skip past the separating spaces */
|
/* skip past the separating spaces */
|
||||||
status_string += strspn(status_string, " ");
|
status_string += strspn(status_string, " ");
|
||||||
}
|
}
|
||||||
len = strcspn(status_string, " \n\0");
|
len = strcspn(status_string, " \n");
|
||||||
state_sub_string = xstrndup(status_string, len);
|
state_sub_string = xstrndup(status_string, len);
|
||||||
state_sub_num = search_name_hashtable(state_sub_string);
|
state_sub_num = search_name_hashtable(state_sub_string);
|
||||||
free(state_sub_string);
|
free(state_sub_string);
|
||||||
@ -796,7 +796,7 @@ static void index_status_file(const char *filename)
|
|||||||
if (status_line != NULL) {
|
if (status_line != NULL) {
|
||||||
status_line += 7;
|
status_line += 7;
|
||||||
status_line += strspn(status_line, " \n\t");
|
status_line += strspn(status_line, " \n\t");
|
||||||
status_line = xstrndup(status_line, strcspn(status_line, "\n\0"));
|
status_line = xstrndup(status_line, strcspn(status_line, "\n"));
|
||||||
status_node->status = search_name_hashtable(status_line);
|
status_node->status = search_name_hashtable(status_line);
|
||||||
free(status_line);
|
free(status_line);
|
||||||
}
|
}
|
||||||
@ -849,7 +849,7 @@ static void write_status_file(deb_file_t **deb_file)
|
|||||||
|
|
||||||
tmp_string += 8;
|
tmp_string += 8;
|
||||||
tmp_string += strspn(tmp_string, " \n\t");
|
tmp_string += strspn(tmp_string, " \n\t");
|
||||||
package_name = xstrndup(tmp_string, strcspn(tmp_string, "\n\0"));
|
package_name = xstrndup(tmp_string, strcspn(tmp_string, "\n"));
|
||||||
write_flag = FALSE;
|
write_flag = FALSE;
|
||||||
tmp_string = strstr(control_buffer, "Status:");
|
tmp_string = strstr(control_buffer, "Status:");
|
||||||
if (tmp_string != NULL) {
|
if (tmp_string != NULL) {
|
||||||
@ -1374,8 +1374,8 @@ static void remove_package(const unsigned int package_num, int noisy)
|
|||||||
sprintf(conffile_name, "/var/lib/dpkg/info/%s.conffiles", package_name);
|
sprintf(conffile_name, "/var/lib/dpkg/info/%s.conffiles", package_name);
|
||||||
exclude_files = create_list(conffile_name);
|
exclude_files = create_list(conffile_name);
|
||||||
|
|
||||||
/* Some directories cant be removed straight away, so do multiple passes */
|
/* Some directories can't be removed straight away, so do multiple passes */
|
||||||
while (remove_file_array(remove_files, exclude_files));
|
while (remove_file_array(remove_files, exclude_files)) /*repeat */;
|
||||||
free_array(exclude_files);
|
free_array(exclude_files);
|
||||||
free_array(remove_files);
|
free_array(remove_files);
|
||||||
|
|
||||||
@ -1421,7 +1421,7 @@ static void purge_package(const unsigned int package_num)
|
|||||||
exclude_files = xzalloc(sizeof(char*));
|
exclude_files = xzalloc(sizeof(char*));
|
||||||
|
|
||||||
/* Some directories cant be removed straight away, so do multiple passes */
|
/* Some directories cant be removed straight away, so do multiple passes */
|
||||||
while (remove_file_array(remove_files, exclude_files));
|
while (remove_file_array(remove_files, exclude_files)) /* repeat */;
|
||||||
free_array(remove_files);
|
free_array(remove_files);
|
||||||
|
|
||||||
/* Create a list of all /var/lib/dpkg/info/<package> files */
|
/* Create a list of all /var/lib/dpkg/info/<package> files */
|
||||||
|
@ -15,7 +15,7 @@ ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, unsigned char *b
|
|||||||
|
|
||||||
size = full_read(archive_handle->src_fd, buf, count);
|
size = full_read(archive_handle->src_fd, buf, count);
|
||||||
if ((size != 0) && (size != count)) {
|
if ((size != 0) && (size != count)) {
|
||||||
bb_perror_msg_and_die("Short read, read %ld of %ld", (long)size, (long)count);
|
bb_perror_msg_and_die("short read, read %ld of %ld", (long)size, (long)count);
|
||||||
}
|
}
|
||||||
return(size);
|
return(size);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ void check_header_gzip(int src_fd)
|
|||||||
|
|
||||||
/* Check the compression method */
|
/* Check the compression method */
|
||||||
if (header.formatted.method != 8) {
|
if (header.formatted.method != 8) {
|
||||||
bb_error_msg_and_die("Unknown compression method %d",
|
bb_error_msg_and_die("unknown compression method %d",
|
||||||
header.formatted.method);
|
header.formatted.method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -745,7 +745,7 @@ static int inflate_block(int *e)
|
|||||||
|
|
||||||
if ((i = huft_build(ll, nl, 257, cplens, cplext, &tl, &bl)) != 0) {
|
if ((i = huft_build(ll, nl, 257, cplens, cplext, &tl, &bl)) != 0) {
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
bb_error_msg_and_die("Incomplete literal tree");
|
bb_error_msg_and_die("incomplete literal tree");
|
||||||
huft_free(tl);
|
huft_free(tl);
|
||||||
}
|
}
|
||||||
return i; /* incomplete code set */
|
return i; /* incomplete code set */
|
||||||
|
@ -57,7 +57,7 @@ char get_header_cpio(archive_handle_t *archive_handle)
|
|||||||
archive_handle->offset += 110;
|
archive_handle->offset += 110;
|
||||||
|
|
||||||
if ((strncmp(&cpio_header[0], "07070", 5) != 0) || ((cpio_header[5] != '1') && (cpio_header[5] != '2'))) {
|
if ((strncmp(&cpio_header[0], "07070", 5) != 0) || ((cpio_header[5] != '1') && (cpio_header[5] != '2'))) {
|
||||||
bb_error_msg_and_die("Unsupported cpio format, use newc or crc");
|
bb_error_msg_and_die("unsupported cpio format, use newc or crc");
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
char get_header_tar_bz2(archive_handle_t *archive_handle)
|
char get_header_tar_bz2(archive_handle_t *archive_handle)
|
||||||
{
|
{
|
||||||
/* Cant lseek over pipe's */
|
/* Can't lseek over pipes */
|
||||||
archive_handle->seek = seek_by_read;
|
archive_handle->seek = seek_by_read;
|
||||||
|
|
||||||
archive_handle->src_fd = open_transformer(archive_handle->src_fd, uncompressStream);
|
archive_handle->src_fd = open_transformer(archive_handle->src_fd, uncompressStream);
|
||||||
|
@ -12,7 +12,7 @@ char get_header_tar_gz(archive_handle_t *archive_handle)
|
|||||||
{
|
{
|
||||||
unsigned char magic[2];
|
unsigned char magic[2];
|
||||||
|
|
||||||
/* Cant lseek over pipe's */
|
/* Can't lseek over pipes */
|
||||||
archive_handle->seek = seek_by_read;
|
archive_handle->seek = seek_by_read;
|
||||||
|
|
||||||
xread(archive_handle->src_fd, &magic, 2);
|
xread(archive_handle->src_fd, &magic, 2);
|
||||||
|
@ -19,6 +19,6 @@ void seek_by_jump(const archive_handle_t *archive_handle, const unsigned int amo
|
|||||||
seek_by_read(archive_handle, amount);
|
seek_by_read(archive_handle, amount);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
bb_perror_msg_and_die("Seek failure");
|
bb_perror_msg_and_die("seek failure");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "unarchive.h"
|
#include "unarchive.h"
|
||||||
#include "libbb.h"
|
#include "libbb.h"
|
||||||
|
|
||||||
/* If we are reading through a pipe(), or from stdin then we cant lseek,
|
/* If we are reading through a pipe(), or from stdin then we can't lseek,
|
||||||
* we must read and discard the data to skip over it.
|
* we must read and discard the data to skip over it.
|
||||||
*/
|
*/
|
||||||
void seek_by_read(const archive_handle_t *archive_handle, const unsigned int jump_size)
|
void seek_by_read(const archive_handle_t *archive_handle, const unsigned int jump_size)
|
||||||
|
@ -14,7 +14,7 @@ void unpack_ar_archive(archive_handle_t *ar_archive)
|
|||||||
|
|
||||||
xread(ar_archive->src_fd, magic, 7);
|
xread(ar_archive->src_fd, magic, 7);
|
||||||
if (strncmp(magic, "!<arch>", 7) != 0) {
|
if (strncmp(magic, "!<arch>", 7) != 0) {
|
||||||
bb_error_msg_and_die("Invalid ar magic");
|
bb_error_msg_and_die("invalid ar magic");
|
||||||
}
|
}
|
||||||
ar_archive->offset += 7;
|
ar_archive->offset += 7;
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ static void extract_cpio_gz(int fd) {
|
|||||||
|
|
||||||
xread(archive_handle->src_fd, &magic, 2);
|
xread(archive_handle->src_fd, &magic, 2);
|
||||||
if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
|
if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
|
||||||
bb_error_msg_and_die("Invalid gzip magic");
|
bb_error_msg_and_die("invalid gzip magic");
|
||||||
}
|
}
|
||||||
check_header_gzip(archive_handle->src_fd);
|
check_header_gzip(archive_handle->src_fd);
|
||||||
xchdir("/"); // Install RPM's to root
|
xchdir("/"); // Install RPM's to root
|
||||||
|
@ -37,10 +37,10 @@ static void skip_header(int rpm_fd)
|
|||||||
|
|
||||||
xread(rpm_fd, &header, sizeof(struct rpm_header));
|
xread(rpm_fd, &header, sizeof(struct rpm_header));
|
||||||
if (strncmp((char *) &header.magic, RPM_HEADER_MAGIC, 3) != 0) {
|
if (strncmp((char *) &header.magic, RPM_HEADER_MAGIC, 3) != 0) {
|
||||||
bb_error_msg_and_die("Invalid RPM header magic"); /* Invalid magic */
|
bb_error_msg_and_die("invalid RPM header magic"); /* Invalid magic */
|
||||||
}
|
}
|
||||||
if (header.version != 1) {
|
if (header.version != 1) {
|
||||||
bb_error_msg_and_die("Unsupported RPM header version"); /* This program only supports v1 headers */
|
bb_error_msg_and_die("unsupported RPM header version"); /* This program only supports v1 headers */
|
||||||
}
|
}
|
||||||
header.entries = ntohl(header.entries);
|
header.entries = ntohl(header.entries);
|
||||||
header.size = ntohl(header.size);
|
header.size = ntohl(header.size);
|
||||||
|
@ -496,7 +496,7 @@ static int writeTarFile(const int tar_fd, const int verboseFlag,
|
|||||||
freeHardLinkInfo(&tbInfo.hlInfoHead);
|
freeHardLinkInfo(&tbInfo.hlInfoHead);
|
||||||
|
|
||||||
if (errorFlag)
|
if (errorFlag)
|
||||||
bb_error_msg("Error exit delayed from previous errors");
|
bb_error_msg("error exit delayed from previous errors");
|
||||||
|
|
||||||
if (gzipPid && waitpid(gzipPid, NULL, 0)==-1)
|
if (gzipPid && waitpid(gzipPid, NULL, 0)==-1)
|
||||||
bb_error_msg("cannot wait");
|
bb_error_msg("cannot wait");
|
||||||
@ -540,7 +540,7 @@ static llist_t *append_file_list_to_list(llist_t *list)
|
|||||||
#ifdef CONFIG_FEATURE_TAR_COMPRESS
|
#ifdef CONFIG_FEATURE_TAR_COMPRESS
|
||||||
static char get_header_tar_Z(archive_handle_t *archive_handle)
|
static char get_header_tar_Z(archive_handle_t *archive_handle)
|
||||||
{
|
{
|
||||||
/* Cant lseek over pipe's */
|
/* Can't lseek over pipes */
|
||||||
archive_handle->seek = seek_by_read;
|
archive_handle->seek = seek_by_read;
|
||||||
|
|
||||||
/* do the decompression, and cleanup */
|
/* do the decompression, and cleanup */
|
||||||
@ -556,7 +556,7 @@ static char get_header_tar_Z(archive_handle_t *archive_handle)
|
|||||||
/* nothing */;
|
/* nothing */;
|
||||||
|
|
||||||
/* Can only do one file at a time */
|
/* Can only do one file at a time */
|
||||||
return(EXIT_FAILURE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define get_header_tar_Z 0
|
#define get_header_tar_Z 0
|
||||||
|
@ -49,7 +49,7 @@ int uncompress_main(int argc, char **argv)
|
|||||||
|
|
||||||
extension = strrchr(uncompressed_file, '.');
|
extension = strrchr(uncompressed_file, '.');
|
||||||
if (!extension || (strcmp(extension, ".Z") != 0)) {
|
if (!extension || (strcmp(extension, ".Z") != 0)) {
|
||||||
bb_error_msg_and_die("Invalid extension");
|
bb_error_msg_and_die("invalid extension");
|
||||||
}
|
}
|
||||||
*extension = '\0';
|
*extension = '\0';
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ int uncompress_main(int argc, char **argv)
|
|||||||
|
|
||||||
/* do the decompression, and cleanup */
|
/* do the decompression, and cleanup */
|
||||||
if ((xread_char(src_fd) != 0x1f) || (xread_char(src_fd) != 0x9d)) {
|
if ((xread_char(src_fd) != 0x1f) || (xread_char(src_fd) != 0x9d)) {
|
||||||
bb_error_msg_and_die("Invalid magic");
|
bb_error_msg_and_die("invalid magic");
|
||||||
}
|
}
|
||||||
|
|
||||||
status = uncompress(src_fd, dst_fd);
|
status = uncompress(src_fd, dst_fd);
|
||||||
|
@ -40,7 +40,7 @@ int loadkmap_main(int argc, char **argv)
|
|||||||
|
|
||||||
xread(0, buff, 7);
|
xread(0, buff, 7);
|
||||||
if (strncmp(buff, BINARY_KEYMAP_MAGIC, 7))
|
if (strncmp(buff, BINARY_KEYMAP_MAGIC, 7))
|
||||||
bb_error_msg_and_die("This is not a valid binary keymap.");
|
bb_error_msg_and_die("this is not a valid binary keymap");
|
||||||
|
|
||||||
xread(0, flags, MAX_NR_KEYMAPS);
|
xread(0, flags, MAX_NR_KEYMAPS);
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ static int fileAction(const char *fileName, struct stat *statbuf,
|
|||||||
(gid == (gid_t)-1) ? statbuf->st_gid : gid)) {
|
(gid == (gid_t)-1) ? statbuf->st_gid : gid)) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
bb_perror_msg("%s", fileName); /* A filename could have % in it... */
|
bb_perror_msg("%s", fileName); /* A filename can have % in it... */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ int du_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Note: SUSv3 specifies that -a and -s options can not be used together
|
/* Note: SUSv3 specifies that -a and -s options cannot be used together
|
||||||
* in strictly conforming applications. However, it also says that some
|
* in strictly conforming applications. However, it also says that some
|
||||||
* du implementations may produce output when -a and -s are used together.
|
* du implementations may produce output when -a and -s are used together.
|
||||||
* gnu du exits with an error code in this case. We choose to simply
|
* gnu du exits with an error code in this case. We choose to simply
|
||||||
|
@ -250,7 +250,7 @@ of a basic regular expression is not portable; it is being ignored", pv->u.s);
|
|||||||
memset(&re_buffer, 0, sizeof(re_buffer));
|
memset(&re_buffer, 0, sizeof(re_buffer));
|
||||||
memset(re_regs, 0, sizeof(*re_regs));
|
memset(re_regs, 0, sizeof(*re_regs));
|
||||||
if (regcomp(&re_buffer, pv->u.s, 0) != 0)
|
if (regcomp(&re_buffer, pv->u.s, 0) != 0)
|
||||||
bb_error_msg_and_die("Invalid regular expression");
|
bb_error_msg_and_die("invalid regular expression");
|
||||||
|
|
||||||
/* expr uses an anchored pattern match, so check that there was a
|
/* expr uses an anchored pattern match, so check that there was a
|
||||||
* match and that the match starts at offset 0. */
|
* match and that the match starts at offset 0. */
|
||||||
|
@ -61,7 +61,7 @@ int install_main(int argc, char **argv)
|
|||||||
umask(0);
|
umask(0);
|
||||||
|
|
||||||
/* Create directories
|
/* Create directories
|
||||||
* dont use bb_make_directory() as it cant change uid or gid
|
* don't use bb_make_directory() as it can't change uid or gid
|
||||||
* perhaps bb_make_directory() should be improved.
|
* perhaps bb_make_directory() should be improved.
|
||||||
*/
|
*/
|
||||||
if (flags & INSTALL_OPT_DIRECTORY) {
|
if (flags & INSTALL_OPT_DIRECTORY) {
|
||||||
@ -77,7 +77,7 @@ int install_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
if (mkdir(*argv, mode) == -1) {
|
if (mkdir(*argv, mode) == -1) {
|
||||||
if (errno != EEXIST) {
|
if (errno != EEXIST) {
|
||||||
bb_perror_msg("coulnt create %s", *argv);
|
bb_perror_msg("cannot create %s", *argv);
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -42,12 +42,12 @@ int nohup_main(int argc, char **argv)
|
|||||||
* Else redirect to /dev/null.
|
* Else redirect to /dev/null.
|
||||||
*/
|
*/
|
||||||
temp = isatty(STDERR_FILENO);
|
temp = isatty(STDERR_FILENO);
|
||||||
if (temp) bb_error_msg("Appending to %s", nohupout);
|
if (temp) bb_error_msg("appending to %s", nohupout);
|
||||||
dup2(temp ? STDOUT_FILENO : nullfd, STDERR_FILENO);
|
dup2(temp ? STDOUT_FILENO : nullfd, STDERR_FILENO);
|
||||||
close(nullfd);
|
close(nullfd);
|
||||||
signal (SIGHUP, SIG_IGN);
|
signal (SIGHUP, SIG_IGN);
|
||||||
|
|
||||||
execvp(argv[1],argv+1);
|
execvp(argv[1],argv+1);
|
||||||
if (00 && ENABLE_FEATURE_CLEAN_UP && home) free(nohupout);
|
if (00 && ENABLE_FEATURE_CLEAN_UP && home) free(nohupout);
|
||||||
bb_perror_msg_and_die("%s",argv[1]);
|
bb_perror_msg_and_die("%s", argv[1]);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
/* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org)
|
/* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org)
|
||||||
*
|
*
|
||||||
* Now does proper error checking on output and returns a failure exit code
|
* Now does proper error checking on output and returns a failure exit code
|
||||||
* if one or more paths can not be resolved.
|
* if one or more paths cannot be resolved.
|
||||||
*
|
*
|
||||||
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
||||||
*/
|
*/
|
||||||
|
@ -102,7 +102,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
blkid_debug_mask = DEBUG_ALL;
|
blkid_debug_mask = DEBUG_ALL;
|
||||||
if ((argc > 2)) {
|
if ((argc > 2)) {
|
||||||
fprintf(stderr, "Usage: %s [filename] \n", argv[0]);
|
fprintf(stderr, "Usage: %s [filename]\n", argv[0]);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ char *blkid_devno_to_devname(dev_t devno)
|
|||||||
|
|
||||||
if (!devname) {
|
if (!devname) {
|
||||||
DBG(DEBUG_DEVNO,
|
DBG(DEBUG_DEVNO,
|
||||||
printf("blkid: couldn't find devno 0x%04lx\n",
|
printf("blkid: cannot find devno 0x%04lx\n",
|
||||||
(unsigned long) devno));
|
(unsigned long) devno));
|
||||||
} else {
|
} else {
|
||||||
DBG(DEBUG_DEVNO,
|
DBG(DEBUG_DEVNO,
|
||||||
|
@ -408,7 +408,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
dev = blkid_get_dev(cache, devname, flags);
|
dev = blkid_get_dev(cache, devname, flags);
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
fprintf(stderr, "%s: Can not find device in blkid cache\n");
|
fprintf(stderr, "%s: cannot find device in blkid cache\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (search_type) {
|
if (search_type) {
|
||||||
|
@ -6721,7 +6721,7 @@ static int update_dir_block(ext2_filsys fs FSCK_ATTR((unused)),
|
|||||||
* Then, pass3 interates over all directory inodes; for each directory
|
* Then, pass3 interates over all directory inodes; for each directory
|
||||||
* it attempts to trace up the filesystem tree, using dirinfo.parent
|
* it attempts to trace up the filesystem tree, using dirinfo.parent
|
||||||
* until it reaches a directory which has been marked "done". If it
|
* until it reaches a directory which has been marked "done". If it
|
||||||
* can not do so, then the directory must be disconnected, and e2fsck
|
* cannot do so, then the directory must be disconnected, and e2fsck
|
||||||
* will offer to reconnect it to /lost+found. While it is chasing
|
* will offer to reconnect it to /lost+found. While it is chasing
|
||||||
* parent pointers up the filesystem tree, if pass3 sees a directory
|
* parent pointers up the filesystem tree, if pass3 sees a directory
|
||||||
* twice, then it has detected a filesystem loop, and it will again
|
* twice, then it has detected a filesystem loop, and it will again
|
||||||
@ -8587,7 +8587,7 @@ static const struct e2fsck_problem problem_table[] = {
|
|||||||
|
|
||||||
/* Bad primary block */
|
/* Bad primary block */
|
||||||
{ PR_1_BAD_PRIMARY_BLOCK,
|
{ PR_1_BAD_PRIMARY_BLOCK,
|
||||||
N_("\nIf the @b is really bad, the @f can not be fixed.\n"),
|
N_("\nIf the @b is really bad, the @f cannot be fixed.\n"),
|
||||||
PROMPT_NONE, PR_AFTER_CODE, PR_1_BAD_PRIMARY_BLOCK_PROMPT },
|
PROMPT_NONE, PR_AFTER_CODE, PR_1_BAD_PRIMARY_BLOCK_PROMPT },
|
||||||
|
|
||||||
/* Bad primary block prompt */
|
/* Bad primary block prompt */
|
||||||
@ -8952,7 +8952,7 @@ static const struct e2fsck_problem problem_table[] = {
|
|||||||
|
|
||||||
/* File has duplicate blocks */
|
/* File has duplicate blocks */
|
||||||
{ PR_1D_DUP_FILE,
|
{ PR_1D_DUP_FILE,
|
||||||
N_("File %Q (@i #%i, mod time %IM) \n"
|
N_("File %Q (@i #%i, mod time %IM)\n"
|
||||||
" has %B @m @b(s), shared with %N file(s):\n"),
|
" has %B @m @b(s), shared with %N file(s):\n"),
|
||||||
PROMPT_NONE, 0 },
|
PROMPT_NONE, 0 },
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ static void test_dump_block(io_channel channel,
|
|||||||
for (i=0, cp = buf; i < channel->block_size; i++, cp++) {
|
for (i=0, cp = buf; i < channel->block_size; i++, cp++) {
|
||||||
cksum += *cp;
|
cksum += *cp;
|
||||||
}
|
}
|
||||||
fprintf(f, "Contents of block %lu, checksum %08lu: \n", block, cksum);
|
fprintf(f, "Contents of block %lu, checksum %08lu:\n", block, cksum);
|
||||||
for (i=0, cp = buf; i < channel->block_size; i++, cp++) {
|
for (i=0, cp = buf; i < channel->block_size; i++, cp++) {
|
||||||
if ((i % 16) == 0)
|
if ((i % 16) == 0)
|
||||||
fprintf(f, "%04x: ", i);
|
fprintf(f, "%04x: ", i);
|
||||||
|
@ -102,7 +102,7 @@ struct fsck_instance {
|
|||||||
* Return the "base device" given a particular device; this is used to
|
* Return the "base device" given a particular device; this is used to
|
||||||
* assure that we only fsck one partition on a particular drive at any
|
* assure that we only fsck one partition on a particular drive at any
|
||||||
* one time. Otherwise, the disk heads will be seeking all over the
|
* one time. Otherwise, the disk heads will be seeking all over the
|
||||||
* place. If the base device can not be determined, return NULL.
|
* place. If the base device cannot be determined, return NULL.
|
||||||
*
|
*
|
||||||
* The base_device() function returns an allocated string which must
|
* The base_device() function returns an allocated string which must
|
||||||
* be freed.
|
* be freed.
|
||||||
|
@ -247,7 +247,7 @@ static void test_disk(ext2_filsys fs, badblocks_list *bb_list)
|
|||||||
mke2fs_verbose("Running command: %s\n", buf);
|
mke2fs_verbose("Running command: %s\n", buf);
|
||||||
f = popen(buf, "r");
|
f = popen(buf, "r");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
bb_perror_msg_and_die("Could not run '%s'", buf);
|
bb_perror_msg_and_die("cannot run '%s'", buf);
|
||||||
}
|
}
|
||||||
retval = ext2fs_read_bb_FILE(fs, f, bb_list, invalid_block);
|
retval = ext2fs_read_bb_FILE(fs, f, bb_list, invalid_block);
|
||||||
pclose(f);
|
pclose(f);
|
||||||
@ -1332,7 +1332,7 @@ int mke2fs_main (int argc, char *argv[])
|
|||||||
retval = zero_blocks(fs, start, blocks - start,
|
retval = zero_blocks(fs, start, blocks - start,
|
||||||
NULL, &ret_blk, NULL);
|
NULL, &ret_blk, NULL);
|
||||||
|
|
||||||
mke2fs_warning_msg(retval, "could not zero block %u at end of filesystem", ret_blk);
|
mke2fs_warning_msg(retval, "cannot zero block %u at end of filesystem", ret_blk);
|
||||||
write_inode_tables(fs);
|
write_inode_tables(fs);
|
||||||
create_root_dir(fs);
|
create_root_dir(fs);
|
||||||
create_lost_and_found(fs);
|
create_lost_and_found(fs);
|
||||||
|
@ -615,7 +615,7 @@ int tune2fs_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
retval = ext2fs_check_if_mounted(device_name, &mount_flags);
|
retval = ext2fs_check_if_mounted(device_name, &mount_flags);
|
||||||
if (retval)
|
if (retval)
|
||||||
bb_error_msg_and_die("Could not determine if %s is mounted", device_name);
|
bb_error_msg_and_die("cannot determine if %s is mounted", device_name);
|
||||||
/* Normally we only need to write out the superblock */
|
/* Normally we only need to write out the superblock */
|
||||||
fs->flags |= EXT2_FLAG_SUPER_ONLY;
|
fs->flags |= EXT2_FLAG_SUPER_ONLY;
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ void check_mount(const char *device, int force, const char *type)
|
|||||||
|
|
||||||
retval = ext2fs_check_if_mounted(device, &mount_flags);
|
retval = ext2fs_check_if_mounted(device, &mount_flags);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
bb_error_msg("Could not determine if %s is mounted", device);
|
bb_error_msg("cannot determine if %s is mounted", device);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mount_flags & EXT2_MF_MOUNTED) {
|
if (mount_flags & EXT2_MF_MOUNTED) {
|
||||||
@ -219,7 +219,7 @@ void make_journal_device(char *journal_device, ext2_filsys fs, int quiet, int fo
|
|||||||
EXT2_FLAG_JOURNAL_DEV_OK, 0,
|
EXT2_FLAG_JOURNAL_DEV_OK, 0,
|
||||||
fs->blocksize, io_ptr, &jfs);
|
fs->blocksize, io_ptr, &jfs);
|
||||||
if (retval)
|
if (retval)
|
||||||
bb_error_msg_and_die("Could not journal device %s", journal_device);
|
bb_error_msg_and_die("cannot journal device %s", journal_device);
|
||||||
if(!quiet)
|
if(!quiet)
|
||||||
printf("Adding journal to device %s: ", journal_device);
|
printf("Adding journal to device %s: ", journal_device);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
@ -248,7 +248,7 @@ void make_journal_blocks(ext2_filsys fs, int journal_size, int journal_flags, in
|
|||||||
retval = ext2fs_add_journal_inode(fs, journal_blocks,
|
retval = ext2fs_add_journal_inode(fs, journal_blocks,
|
||||||
journal_flags);
|
journal_flags);
|
||||||
if(retval)
|
if(retval)
|
||||||
bb_error_msg_and_die("Could not create journal");
|
bb_error_msg_and_die("cannot create journal");
|
||||||
if(!quiet)
|
if(!quiet)
|
||||||
puts("done");
|
puts("done");
|
||||||
}
|
}
|
||||||
|
@ -2716,7 +2716,7 @@ keep_going:
|
|||||||
free(s);
|
free(s);
|
||||||
}
|
}
|
||||||
if (opt & 0x8) // -W
|
if (opt & 0x8) // -W
|
||||||
bb_error_msg("Warning: unrecognized option '-W %s' ignored", opt_W);
|
bb_error_msg("warning: unrecognized option '-W %s' ignored", opt_W);
|
||||||
|
|
||||||
if (!from_file) {
|
if (!from_file) {
|
||||||
if (argc == optind)
|
if (argc == optind)
|
||||||
|
@ -37,7 +37,7 @@ static unsigned int copy_lines(FILE *src_stream, FILE *dest_stream, const unsign
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (fputs(line, dest_stream) == EOF) {
|
if (fputs(line, dest_stream) == EOF) {
|
||||||
bb_perror_msg_and_die("Error writing to new file");
|
bb_perror_msg_and_die("error writing to new file");
|
||||||
}
|
}
|
||||||
free(line);
|
free(line);
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ int patch_main(int argc, char **argv)
|
|||||||
patch_line = xmalloc_fgets(patch_file);
|
patch_line = xmalloc_fgets(patch_file);
|
||||||
if (strncmp(patch_line, "+++ ", 4) != 0) {
|
if (strncmp(patch_line, "+++ ", 4) != 0) {
|
||||||
ret = 2;
|
ret = 2;
|
||||||
bb_error_msg("Invalid patch");
|
bb_error_msg("invalid patch");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
new_filename = extract_filename(patch_line, patch_level);
|
new_filename = extract_filename(patch_line, patch_level);
|
||||||
@ -189,7 +189,7 @@ int patch_main(int argc, char **argv)
|
|||||||
/* src_beg_line will be 0 if its a new file */
|
/* src_beg_line will be 0 if its a new file */
|
||||||
count = src_beg_line - src_cur_line;
|
count = src_beg_line - src_cur_line;
|
||||||
if (copy_lines(src_stream, dst_stream, count) != count) {
|
if (copy_lines(src_stream, dst_stream, count) != count) {
|
||||||
bb_error_msg_and_die("Bad src file");
|
bb_error_msg_and_die("bad src file");
|
||||||
}
|
}
|
||||||
src_cur_line += count;
|
src_cur_line += count;
|
||||||
dest_cur_line += count;
|
dest_cur_line += count;
|
||||||
@ -209,7 +209,7 @@ int patch_main(int argc, char **argv)
|
|||||||
src_cur_line++;
|
src_cur_line++;
|
||||||
}
|
}
|
||||||
if (strcmp(src_line, patch_line + 1) != 0) {
|
if (strcmp(src_line, patch_line + 1) != 0) {
|
||||||
bb_error_msg("Hunk #%d FAILED at %d.", hunk_count, hunk_offset_start);
|
bb_error_msg("hunk #%d FAILED at %d", hunk_count, hunk_offset_start);
|
||||||
hunk_error++;
|
hunk_error++;
|
||||||
free(patch_line);
|
free(patch_line);
|
||||||
break;
|
break;
|
||||||
|
@ -1802,7 +1802,7 @@ static Byte *yank_delete(Byte * start, Byte * stop, int dist, int yf)
|
|||||||
stop = p;
|
stop = p;
|
||||||
}
|
}
|
||||||
if (dist <= 0) {
|
if (dist <= 0) {
|
||||||
// we can not cross NL boundaries
|
// we cannot cross NL boundaries
|
||||||
p = start;
|
p = start;
|
||||||
if (*p == '\n')
|
if (*p == '\n')
|
||||||
return (p);
|
return (p);
|
||||||
|
@ -431,7 +431,7 @@ int xargs_main(int argc, char **argv)
|
|||||||
n_chars += strlen(*argv) + 1;
|
n_chars += strlen(*argv) + 1;
|
||||||
}
|
}
|
||||||
if (n_max_chars < n_chars) {
|
if (n_max_chars < n_chars) {
|
||||||
bb_error_msg_and_die("can not fit single argument within argument list size limit");
|
bb_error_msg_and_die("cannot fit single argument within argument list size limit");
|
||||||
}
|
}
|
||||||
n_max_chars -= n_chars;
|
n_max_chars -= n_chars;
|
||||||
} else {
|
} else {
|
||||||
|
@ -762,8 +762,8 @@ USE_FEATURE_DATE_ISOFMT( \
|
|||||||
"\t( EXPRESSION ) value of EXPRESSION\n\n" \
|
"\t( EXPRESSION ) value of EXPRESSION\n\n" \
|
||||||
"Beware that many operators need to be escaped or quoted for shells.\n" \
|
"Beware that many operators need to be escaped or quoted for shells.\n" \
|
||||||
"Comparisons are arithmetic if both ARGs are numbers, else\n" \
|
"Comparisons are arithmetic if both ARGs are numbers, else\n" \
|
||||||
"lexicographical. Pattern matches return the string matched between \n" \
|
"lexicographical. Pattern matches return the string matched between\n" \
|
||||||
"\\( and \\) or null; if \\( and \\) are not used, they return the number \n" \
|
"\\( and \\) or null; if \\( and \\) are not used, they return the number\n" \
|
||||||
"of characters matched or 0."
|
"of characters matched or 0."
|
||||||
|
|
||||||
#define fakeidentd_trivial_usage \
|
#define fakeidentd_trivial_usage \
|
||||||
@ -1272,10 +1272,10 @@ USE_FEATURE_DATE_ISOFMT( \
|
|||||||
"This version of init is designed to be run only by the kernel.\n" \
|
"This version of init is designed to be run only by the kernel.\n" \
|
||||||
"\n" \
|
"\n" \
|
||||||
"BusyBox init doesn't support multiple runlevels. The runlevels field of\n" \
|
"BusyBox init doesn't support multiple runlevels. The runlevels field of\n" \
|
||||||
"the /etc/inittab file is completely ignored by BusyBox init. If you want \n" \
|
"the /etc/inittab file is completely ignored by BusyBox init. If you want\n" \
|
||||||
"runlevels, use sysvinit.\n" \
|
"runlevels, use sysvinit.\n" \
|
||||||
"\n" \
|
"\n" \
|
||||||
"BusyBox init works just fine without an inittab. If no inittab is found, \n" \
|
"BusyBox init works just fine without an inittab. If no inittab is found,\n" \
|
||||||
"it has the following default behavior:\n" \
|
"it has the following default behavior:\n" \
|
||||||
"\n" \
|
"\n" \
|
||||||
" ::sysinit:/etc/init.d/rcS\n" \
|
" ::sysinit:/etc/init.d/rcS\n" \
|
||||||
@ -2898,7 +2898,7 @@ USE_FEATURE_START_STOP_DAEMON_FANCY( \
|
|||||||
USE_FEATURE_FANCY_TAIL( "\n\t-q\t\tnever output headers giving file names\n" \
|
USE_FEATURE_FANCY_TAIL( "\n\t-q\t\tnever output headers giving file names\n" \
|
||||||
"\t-s SEC\t\twait SEC seconds between reads with -f\n" \
|
"\t-s SEC\t\twait SEC seconds between reads with -f\n" \
|
||||||
"\t-v\t\talways output headers giving file names\n\n" \
|
"\t-v\t\talways output headers giving file names\n\n" \
|
||||||
"If the first character of N (bytes or lines) is a '+', output begins with \n" \
|
"If the first character of N (bytes or lines) is a '+', output begins with\n" \
|
||||||
"the Nth item from the start of each file, otherwise, print the last N items\n" \
|
"the Nth item from the start of each file, otherwise, print the last N items\n" \
|
||||||
"in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2)." )
|
"in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2)." )
|
||||||
#define tail_example_usage \
|
#define tail_example_usage \
|
||||||
@ -3156,7 +3156,7 @@ USE_FEATURE_START_STOP_DAEMON_FANCY( \
|
|||||||
"\n\t-f\tForce umount (i.e., unreachable NFS server)" \
|
"\n\t-f\tForce umount (i.e., unreachable NFS server)" \
|
||||||
USE_FEATURE_MOUNT_LOOP("\n\t-D\tDo not free loop device (if a loop device has been used)")
|
USE_FEATURE_MOUNT_LOOP("\n\t-D\tDo not free loop device (if a loop device has been used)")
|
||||||
#define umount_example_usage \
|
#define umount_example_usage \
|
||||||
"$ umount /dev/hdc1 \n"
|
"$ umount /dev/hdc1\n"
|
||||||
|
|
||||||
#define uname_trivial_usage \
|
#define uname_trivial_usage \
|
||||||
"[OPTION]..."
|
"[OPTION]..."
|
||||||
|
@ -48,6 +48,6 @@ RB_AUTOBOOT
|
|||||||
if (rc) rc = kill(1,signals[which]);
|
if (rc) rc = kill(1,signals[which]);
|
||||||
} else rc = reboot(magic[which]);
|
} else rc = reboot(magic[which]);
|
||||||
|
|
||||||
if (rc) bb_error_msg("No.");
|
if (rc) bb_error_msg("no");
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,7 @@ static void message(int device, const char *fmt, ...)
|
|||||||
if (log_fd < 0) {
|
if (log_fd < 0) {
|
||||||
if ((log_fd = device_open(log_console, O_RDWR | O_NONBLOCK | O_NOCTTY)) < 0) {
|
if ((log_fd = device_open(log_console, O_RDWR | O_NONBLOCK | O_NOCTTY)) < 0) {
|
||||||
log_fd = -2;
|
log_fd = -2;
|
||||||
bb_error_msg("Bummer, can't write to log on %s!", log_console);
|
bb_error_msg("bummer, can't write to log on %s!", log_console);
|
||||||
device = CONSOLE;
|
device = CONSOLE;
|
||||||
} else {
|
} else {
|
||||||
fcntl(log_fd, F_SETFD, FD_CLOEXEC);
|
fcntl(log_fd, F_SETFD, FD_CLOEXEC);
|
||||||
@ -232,7 +232,7 @@ static void message(int device, const char *fmt, ...)
|
|||||||
#if ENABLE_DEBUG_INIT
|
#if ENABLE_DEBUG_INIT
|
||||||
/* all descriptors may be closed */
|
/* all descriptors may be closed */
|
||||||
} else {
|
} else {
|
||||||
bb_error_msg("Bummer, can't print: ");
|
bb_error_msg("bummer, can't print: ");
|
||||||
va_start(arguments, fmt);
|
va_start(arguments, fmt);
|
||||||
vfprintf(stderr, fmt, arguments);
|
vfprintf(stderr, fmt, arguments);
|
||||||
va_end(arguments);
|
va_end(arguments);
|
||||||
|
@ -65,7 +65,7 @@ long bb_xgetpwnam(const char *name)
|
|||||||
/* Hacked by Tito Ragusa (c) 2004 <farmatito@tiscali.it> to make it more
|
/* Hacked by Tito Ragusa (c) 2004 <farmatito@tiscali.it> to make it more
|
||||||
* flexible :
|
* flexible :
|
||||||
*
|
*
|
||||||
* if bufsize is > 0 char *name can not be set to NULL.
|
* if bufsize is > 0 char *name cannot be set to NULL.
|
||||||
* On success username is written on the static allocated
|
* On success username is written on the static allocated
|
||||||
* buffer name (and a pointer to it is returned).
|
* buffer name (and a pointer to it is returned).
|
||||||
* On failure uid as string is written to the static
|
* On failure uid as string is written to the static
|
||||||
@ -89,7 +89,7 @@ char * bb_getpwuid(char *name, long uid, int bufsize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if bufsize is > 0 char *buffer can not be set to NULL.
|
* if bufsize is > 0 char *buffer cannot be set to NULL.
|
||||||
* If idname is not NULL it is written on the static
|
* If idname is not NULL it is written on the static
|
||||||
* allocated buffer (and a pointer to it is returned).
|
* allocated buffer (and a pointer to it is returned).
|
||||||
* if idname is NULL, id as string is written to the static
|
* if idname is NULL, id as string is written to the static
|
||||||
|
@ -99,6 +99,6 @@ int bb_make_directory (char *path, long mode, int flags)
|
|||||||
|
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
bb_perror_msg ("Cannot %s directory `%s'", fail_msg, path);
|
bb_perror_msg ("cannot %s directory '%s'", fail_msg, path);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@ void xsetgid(gid_t gid)
|
|||||||
if (setgid(gid)) bb_error_msg_and_die("setgid");
|
if (setgid(gid)) bb_error_msg_and_die("setgid");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Die with an error message if we cant' set uid. (See xsetgid() for why.)
|
// Die with an error message if we can't set uid. (See xsetgid() for why.)
|
||||||
void xsetuid(uid_t uid)
|
void xsetuid(uid_t uid)
|
||||||
{
|
{
|
||||||
if (setuid(uid)) bb_error_msg_and_die("setuid");
|
if (setuid(uid)) bb_error_msg_and_die("setuid");
|
||||||
|
@ -81,7 +81,7 @@ static void passwd_wrapper(const char *login)
|
|||||||
{
|
{
|
||||||
static const char prog[] = "passwd";
|
static const char prog[] = "passwd";
|
||||||
execlp(prog, prog, login, NULL);
|
execlp(prog, prog, login, NULL);
|
||||||
bb_error_msg_and_die("Failed to execute '%s', you must set the password for '%s' manually", prog, login);
|
bb_error_msg_and_die("failed to execute '%s', you must set the password for '%s' manually", prog, login);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* putpwent(3) remix */
|
/* putpwent(3) remix */
|
||||||
|
@ -58,7 +58,7 @@ int vlock_main(int argc, char **argv)
|
|||||||
o_lock_all = getopt32(argc, argv, "a");
|
o_lock_all = getopt32(argc, argv, "a");
|
||||||
|
|
||||||
if((pw = getpwuid(getuid())) == NULL) {
|
if((pw = getpwuid(getuid())) == NULL) {
|
||||||
bb_error_msg_and_die("Unknown uid %d", getuid());
|
bb_error_msg_and_die("unknown uid %d", getuid());
|
||||||
}
|
}
|
||||||
|
|
||||||
vfd = xopen(CURRENT_TTY, O_RDWR);
|
vfd = xopen(CURRENT_TTY, O_RDWR);
|
||||||
|
@ -314,7 +314,7 @@ static void startlogger(void)
|
|||||||
if ((logfd = open(LogFile, O_WRONLY | O_CREAT | O_APPEND, 0600)) >= 0) {
|
if ((logfd = open(LogFile, O_WRONLY | O_CREAT | O_APPEND, 0600)) >= 0) {
|
||||||
close(logfd);
|
close(logfd);
|
||||||
} else {
|
} else {
|
||||||
bb_perror_msg("Failed to open log file '%s' reason", LogFile);
|
bb_perror_msg("failed to open log file '%s': ", LogFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -883,7 +883,7 @@ ForkJob(const char *user, CronLine * line, int mailFd,
|
|||||||
exit(0);
|
exit(0);
|
||||||
} else if (pid < 0) {
|
} else if (pid < 0) {
|
||||||
/* FORK FAILED */
|
/* FORK FAILED */
|
||||||
crondlog("\024couldn't fork, user %s\n", user);
|
crondlog("\024cannot fork, user %s\n", user);
|
||||||
line->cl_Pid = 0;
|
line->cl_Pid = 0;
|
||||||
if (mailf) {
|
if (mailf) {
|
||||||
remove(mailf);
|
remove(mailf);
|
||||||
@ -1008,7 +1008,7 @@ static void RunJob(const char *user, CronLine * line)
|
|||||||
exit(0);
|
exit(0);
|
||||||
} else if (pid < 0) {
|
} else if (pid < 0) {
|
||||||
/* FORK FAILED */
|
/* FORK FAILED */
|
||||||
crondlog("\024couldn't fork, user %s\n", user);
|
crondlog("\024cannot, user %s\n", user);
|
||||||
pid = 0;
|
pid = 0;
|
||||||
}
|
}
|
||||||
line->cl_Pid = pid;
|
line->cl_Pid = pid;
|
||||||
|
@ -595,7 +595,7 @@ static void identify(uint16_t *id_supplied)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
/*"Unknown device type:\n\tbits 15&14 of general configuration word 0 both set to 1.\n"*/
|
/*"Unknown device type:\n\tbits 15&14 of general configuration word 0 both set to 1.\n"*/
|
||||||
bb_error_msg_and_die("Unknown device type");
|
bb_error_msg_and_die("unknown device type");
|
||||||
|
|
||||||
printf("%sremovable media\n", !(val[GEN_CONFIG] & MEDIA_REMOVABLE) ? "non-" : "");
|
printf("%sremovable media\n", !(val[GEN_CONFIG] & MEDIA_REMOVABLE) ? "non-" : "");
|
||||||
/* Info from the specific configuration word says whether or not the
|
/* Info from the specific configuration word says whether or not the
|
||||||
|
@ -1113,7 +1113,7 @@ int less_main(int argc, char **argv) {
|
|||||||
if (ttyname(STDIN_FILENO) == NULL)
|
if (ttyname(STDIN_FILENO) == NULL)
|
||||||
inp_stdin = 1;
|
inp_stdin = 1;
|
||||||
else {
|
else {
|
||||||
bb_error_msg("Missing filename");
|
bb_error_msg("missing filename");
|
||||||
bb_show_usage();
|
bb_show_usage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ int makedevs_main(int argc, char **argv)
|
|||||||
/* if mode != S_IFCHR and != S_IFBLK third param in mknod() ignored */
|
/* if mode != S_IFCHR and != S_IFBLK third param in mknod() ignored */
|
||||||
|
|
||||||
if (mknod(nodname, mode, makedev(Smajor, Sminor)))
|
if (mknod(nodname, mode, makedev(Smajor, Sminor)))
|
||||||
bb_error_msg("Failed to create: %s", nodname);
|
bb_error_msg("failed to create: %s", nodname);
|
||||||
|
|
||||||
if (nodname == basedev) /* ex. /dev/hda - to /dev/hda1 ... */
|
if (nodname == basedev) /* ex. /dev/hda - to /dev/hda1 ... */
|
||||||
nodname = buf;
|
nodname = buf;
|
||||||
|
@ -4113,7 +4113,7 @@ int insmod_main( int argc, char **argv)
|
|||||||
|
|
||||||
if (strncmp(uts_info.release, m_strversion, STRVERSIONLEN) != 0) {
|
if (strncmp(uts_info.release, m_strversion, STRVERSIONLEN) != 0) {
|
||||||
if (flag_force_load) {
|
if (flag_force_load) {
|
||||||
bb_error_msg("Warning: kernel-module version mismatch\n"
|
bb_error_msg("warning: kernel-module version mismatch\n"
|
||||||
"\t%s was compiled for kernel version %s\n"
|
"\t%s was compiled for kernel version %s\n"
|
||||||
"\twhile this kernel is version %s",
|
"\twhile this kernel is version %s",
|
||||||
m_filename, m_strversion, uts_info.release);
|
m_filename, m_strversion, uts_info.release);
|
||||||
@ -4134,7 +4134,7 @@ int insmod_main( int argc, char **argv)
|
|||||||
goto out;
|
goto out;
|
||||||
k_crcs = new_is_kernel_checksummed();
|
k_crcs = new_is_kernel_checksummed();
|
||||||
} else {
|
} else {
|
||||||
bb_error_msg("Not configured to support old kernels");
|
bb_error_msg("not configured to support old kernels");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -758,7 +758,7 @@ static void check_dep ( char *mod, struct mod_list_t **head, struct mod_list_t *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bb_error_msg ("Bad alias %s", dt-> m_name);
|
bb_error_msg ("bad alias %s", dt-> m_name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -897,7 +897,7 @@ int modprobe_main(int argc, char** argv)
|
|||||||
} while ( ++optind < argc );
|
} while ( ++optind < argc );
|
||||||
} else {
|
} else {
|
||||||
if (optind >= argc)
|
if (optind >= argc)
|
||||||
bb_error_msg_and_die ( "No module or pattern provided" );
|
bb_error_msg_and_die ( "no module or pattern provided" );
|
||||||
|
|
||||||
if ( mod_insert ( argv [optind], argc - optind - 1, argv + optind + 1 ))
|
if ( mod_insert ( argv [optind], argc - optind - 1, argv + optind + 1 ))
|
||||||
bb_error_msg_and_die ( "failed to load module %s", argv [optind] );
|
bb_error_msg_and_die ( "failed to load module %s", argv [optind] );
|
||||||
|
@ -392,7 +392,7 @@ int arping_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (me.sll_halen == 0) {
|
if (me.sll_halen == 0) {
|
||||||
bb_error_msg("Interface \"%s\" is not ARPable (no ll address)", device);
|
bb_error_msg("interface \"%s\" is not ARPable (no ll address)", device);
|
||||||
exit(cfg&dad ? 0 : 2);
|
exit(cfg&dad ? 0 : 2);
|
||||||
}
|
}
|
||||||
he = me;
|
he = me;
|
||||||
|
@ -270,7 +270,7 @@ static inline int get_wol_pw(const char *ethoptarg, unsigned char *wol_passwd)
|
|||||||
byte_cnt = sscanf(ethoptarg, "%d.%d.%d.%d",
|
byte_cnt = sscanf(ethoptarg, "%d.%d.%d.%d",
|
||||||
&passwd[0], &passwd[1], &passwd[2], &passwd[3]);
|
&passwd[0], &passwd[1], &passwd[2], &passwd[3]);
|
||||||
if (byte_cnt < 4) {
|
if (byte_cnt < 4) {
|
||||||
bb_error_msg("Unable to read the Wake-On-LAN pass");
|
bb_error_msg("unable to read the Wake-On-LAN pass");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1317,7 +1317,7 @@ static int sendFile(const char *url)
|
|||||||
close(f);
|
close(f);
|
||||||
} else {
|
} else {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
bb_perror_msg("Unable to open '%s'", url);
|
bb_perror_msg("unable to open '%s'", url);
|
||||||
#endif
|
#endif
|
||||||
sendHeaders(HTTP_NOT_FOUND);
|
sendHeaders(HTTP_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
@ -325,7 +325,7 @@ static int sockets_open(int family)
|
|||||||
sfd = af->fd;
|
sfd = af->fd;
|
||||||
}
|
}
|
||||||
if (sfd < 0) {
|
if (sfd < 0) {
|
||||||
bb_error_msg("No usable address families found.");
|
bb_error_msg("no usable address families found");
|
||||||
}
|
}
|
||||||
return sfd;
|
return sfd;
|
||||||
}
|
}
|
||||||
@ -557,7 +557,7 @@ static int if_readlist_proc(char *target)
|
|||||||
|
|
||||||
fh = fopen(_PATH_PROCNET_DEV, "r");
|
fh = fopen(_PATH_PROCNET_DEV, "r");
|
||||||
if (!fh) {
|
if (!fh) {
|
||||||
bb_perror_msg("Warning: cannot open %s. Limited output.", _PATH_PROCNET_DEV);
|
bb_perror_msg("warning: cannot open %s, limiting output", _PATH_PROCNET_DEV);
|
||||||
return if_readconf();
|
return if_readconf();
|
||||||
}
|
}
|
||||||
fgets(buf, sizeof buf, fh); /* eat line */
|
fgets(buf, sizeof buf, fh); /* eat line */
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/* vi: set sw=4 ts=4: */
|
/* vi: set sw=4 ts=4: */
|
||||||
/*
|
/*
|
||||||
* iplink.c "ip link".
|
* iplink.c "ip link".
|
||||||
*
|
*
|
||||||
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
|
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
|
||||||
*
|
*
|
||||||
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
||||||
*/
|
*/
|
||||||
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
static int on_off(char *msg)
|
static int on_off(char *msg)
|
||||||
{
|
{
|
||||||
bb_error_msg("Error: argument of \"%s\" must be \"on\" or \"off\"", msg);
|
bb_error_msg("error: argument of \"%s\" must be \"on\" or \"off\"", msg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ static int parse_address(char *dev, int hatype, int halen, char *lla, struct ifr
|
|||||||
if (alen < 0)
|
if (alen < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (alen != halen) {
|
if (alen != halen) {
|
||||||
bb_error_msg("Wrong address (%s) length: expected %d bytes", lla, halen);
|
bb_error_msg("wrong address (%s) length: expected %d bytes", lla, halen);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -349,6 +349,6 @@ int do_iplink(int argc, char **argv)
|
|||||||
} else
|
} else
|
||||||
return ipaddr_list_link(0, NULL);
|
return ipaddr_list_link(0, NULL);
|
||||||
|
|
||||||
bb_error_msg("Command \"%s\" is unknown.", *argv);
|
bb_error_msg("command \"%s\" is unknown", *argv);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
@ -206,10 +206,10 @@ int get_prefix_1(inet_prefix * dst, char *arg, int family)
|
|||||||
int get_addr(inet_prefix * dst, char *arg, int family)
|
int get_addr(inet_prefix * dst, char *arg, int family)
|
||||||
{
|
{
|
||||||
if (family == AF_PACKET) {
|
if (family == AF_PACKET) {
|
||||||
bb_error_msg_and_die("\"%s\" may be inet address, but it is not allowed in this context.", arg);
|
bb_error_msg_and_die("\"%s\" may be inet address, but it is not allowed in this context", arg);
|
||||||
}
|
}
|
||||||
if (get_addr_1(dst, arg, family)) {
|
if (get_addr_1(dst, arg, family)) {
|
||||||
bb_error_msg_and_die("an inet address is expected rather than \"%s\".", arg);
|
bb_error_msg_and_die("an inet address is expected rather than \"%s\"", arg);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -217,10 +217,10 @@ int get_addr(inet_prefix * dst, char *arg, int family)
|
|||||||
int get_prefix(inet_prefix * dst, char *arg, int family)
|
int get_prefix(inet_prefix * dst, char *arg, int family)
|
||||||
{
|
{
|
||||||
if (family == AF_PACKET) {
|
if (family == AF_PACKET) {
|
||||||
bb_error_msg_and_die("\"%s\" may be inet address, but it is not allowed in this context.", arg);
|
bb_error_msg_and_die("\"%s\" may be inet address, but it is not allowed in this context", arg);
|
||||||
}
|
}
|
||||||
if (get_prefix_1(dst, arg, family)) {
|
if (get_prefix_1(dst, arg, family)) {
|
||||||
bb_error_msg_and_die("an inet address is expected rather than \"%s\".", arg);
|
bb_error_msg_and_die("an inet address is expected rather than \"%s\"", arg);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -237,7 +237,7 @@ __u32 get_addr32(char *name)
|
|||||||
|
|
||||||
void incomplete_command(void)
|
void incomplete_command(void)
|
||||||
{
|
{
|
||||||
bb_error_msg("Command line is not complete. Try option \"help\"");
|
bb_error_msg("command line is not complete, try option \"help\"");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,13 +249,13 @@ void invarg(const char * const arg, const char * const opt)
|
|||||||
|
|
||||||
void duparg(char *key, char *arg)
|
void duparg(char *key, char *arg)
|
||||||
{
|
{
|
||||||
bb_error_msg("duplicate \"%s\": \"%s\" is the second value.", key, arg);
|
bb_error_msg("duplicate \"%s\": \"%s\" is the second value", key, arg);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void duparg2(char *key, char *arg)
|
void duparg2(char *key, char *arg)
|
||||||
{
|
{
|
||||||
bb_error_msg("either \"%s\" is duplicate, or \"%s\" is a garbage.", key, arg);
|
bb_error_msg("either \"%s\" is duplicate, or \"%s\" is a garbage", key, arg);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -575,7 +575,7 @@ int netstat_main(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
printf("(w/o servers)");
|
printf("(w/o servers)");
|
||||||
}
|
}
|
||||||
printf("\nProto Recv-Q Send-Q Local Address Foreign Address State \n");
|
printf("\nProto Recv-Q Send-Q Local Address Foreign Address State\n");
|
||||||
}
|
}
|
||||||
if (inet && flags&NETSTAT_TCP)
|
if (inet && flags&NETSTAT_TCP)
|
||||||
do_info(_PATH_PROCNET_TCP,"AF INET (tcp)",tcp_do_one);
|
do_info(_PATH_PROCNET_TCP,"AF INET (tcp)",tcp_do_one);
|
||||||
|
@ -317,7 +317,7 @@ static void unpack(char *buf, int sz, struct sockaddr_in *from)
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
} else
|
} else
|
||||||
if (icmppkt->icmp_type != ICMP_ECHO)
|
if (icmppkt->icmp_type != ICMP_ECHO)
|
||||||
bb_error_msg("Warning: Got ICMP %d (%s)",
|
bb_error_msg("warning: got ICMP %d (%s)",
|
||||||
icmppkt->icmp_type, icmp_type_name(icmppkt->icmp_type));
|
icmppkt->icmp_type, icmp_type_name(icmppkt->icmp_type));
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
@ -308,7 +308,7 @@ static void unpack(char *packet, int sz, struct sockaddr_in6 *from, int hoplimit
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
} else
|
} else
|
||||||
if (icmppkt->icmp6_type != ICMP6_ECHO_REQUEST)
|
if (icmppkt->icmp6_type != ICMP6_ECHO_REQUEST)
|
||||||
bb_error_msg("Warning: Got ICMP %d (%s)",
|
bb_error_msg("warning: got ICMP %d (%s)",
|
||||||
icmppkt->icmp6_type, icmp6_type_name(icmppkt->icmp6_type));
|
icmppkt->icmp6_type, icmp6_type_name(icmppkt->icmp6_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *mac, char *interface)
|
|||||||
FD_SET(s, &fdset);
|
FD_SET(s, &fdset);
|
||||||
tm.tv_sec = timeout;
|
tm.tv_sec = timeout;
|
||||||
if (select(s + 1, &fdset, (fd_set *) NULL, (fd_set *) NULL, &tm) < 0) {
|
if (select(s + 1, &fdset, (fd_set *) NULL, (fd_set *) NULL, &tm) < 0) {
|
||||||
bb_perror_msg("Error on ARPING request");
|
bb_perror_msg("error on ARPING request");
|
||||||
if (errno != EINTR) rv = 0;
|
if (errno != EINTR) rv = 0;
|
||||||
} else if (FD_ISSET(s, &fdset)) {
|
} else if (FD_ISSET(s, &fdset)) {
|
||||||
if (recv(s, &arp, sizeof(arp), 0) < 0 ) rv = 0;
|
if (recv(s, &arp, sizeof(arp), 0) < 0 ) rv = 0;
|
||||||
|
@ -216,14 +216,14 @@ int get_raw_packet(struct dhcpMessage *payload, int fd)
|
|||||||
packet.ip.daddr = dest;
|
packet.ip.daddr = dest;
|
||||||
packet.ip.tot_len = packet.udp.len; /* cheat on the psuedo-header */
|
packet.ip.tot_len = packet.udp.len; /* cheat on the psuedo-header */
|
||||||
if (check && check != udhcp_checksum(&packet, bytes)) {
|
if (check && check != udhcp_checksum(&packet, bytes)) {
|
||||||
bb_error_msg("Packet with bad UDP checksum received, ignoring");
|
bb_error_msg("packet with bad UDP checksum received, ignoring");
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(payload, &(packet.data), bytes - (sizeof(packet.ip) + sizeof(packet.udp)));
|
memcpy(payload, &(packet.data), bytes - (sizeof(packet.ip) + sizeof(packet.udp)));
|
||||||
|
|
||||||
if (ntohl(payload->cookie) != DHCP_MAGIC) {
|
if (ntohl(payload->cookie) != DHCP_MAGIC) {
|
||||||
bb_error_msg("Received bogus message (bad magic) - ignoring");
|
bb_error_msg("received bogus message (bad magic) - ignoring");
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
DEBUG("oooooh!!! got some!");
|
DEBUG("oooooh!!! got some!");
|
||||||
|
@ -53,7 +53,7 @@ static inline void sanitize_fds(void)
|
|||||||
void udhcp_background(const char *pidfile)
|
void udhcp_background(const char *pidfile)
|
||||||
{
|
{
|
||||||
#ifdef __uClinux__
|
#ifdef __uClinux__
|
||||||
bb_error_msg("Cannot background in uclinux (yet)");
|
bb_error_msg("cannot background in uclinux (yet)");
|
||||||
#else /* __uClinux__ */
|
#else /* __uClinux__ */
|
||||||
int pid_fd;
|
int pid_fd;
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ int read_config(const char *file)
|
|||||||
keywords[i].handler(keywords[i].def, keywords[i].var);
|
keywords[i].handler(keywords[i].def, keywords[i].var);
|
||||||
|
|
||||||
if (!(in = fopen(file, "r"))) {
|
if (!(in = fopen(file, "r"))) {
|
||||||
bb_error_msg("Unable to open config file: %s", file);
|
bb_error_msg("unable to open config file: %s", file);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,7 +308,7 @@ int read_config(const char *file)
|
|||||||
for (i = 0; keywords[i].keyword[0]; i++)
|
for (i = 0; keywords[i].keyword[0]; i++)
|
||||||
if (!strcasecmp(token, keywords[i].keyword))
|
if (!strcasecmp(token, keywords[i].keyword))
|
||||||
if (!keywords[i].handler(line, keywords[i].var)) {
|
if (!keywords[i].handler(line, keywords[i].var)) {
|
||||||
bb_error_msg("Failure parsing line %d of %s", lm, file);
|
bb_error_msg("failure parsing line %d of %s", lm, file);
|
||||||
if (ENABLE_FEATURE_UDHCP_DEBUG)
|
if (ENABLE_FEATURE_UDHCP_DEBUG)
|
||||||
bb_error_msg("unable to parse '%s'", debug_orig);
|
bb_error_msg("unable to parse '%s'", debug_orig);
|
||||||
/* reset back to the default value */
|
/* reset back to the default value */
|
||||||
@ -329,7 +329,7 @@ void write_leases(void)
|
|||||||
unsigned long tmp_time;
|
unsigned long tmp_time;
|
||||||
|
|
||||||
if (!(fp = fopen(server_config.lease_file, "w"))) {
|
if (!(fp = fopen(server_config.lease_file, "w"))) {
|
||||||
bb_error_msg("Unable to open %s for writing", server_config.lease_file);
|
bb_error_msg("unable to open %s for writing", server_config.lease_file);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,7 +367,7 @@ void read_leases(const char *file)
|
|||||||
struct dhcpOfferedAddr lease;
|
struct dhcpOfferedAddr lease;
|
||||||
|
|
||||||
if (!(fp = fopen(file, "r"))) {
|
if (!(fp = fopen(file, "r"))) {
|
||||||
bb_error_msg("Unable to open %s for reading", file);
|
bb_error_msg("unable to open %s for reading", file);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,7 +377,7 @@ void read_leases(const char *file)
|
|||||||
lease.expires = ntohl(lease.expires);
|
lease.expires = ntohl(lease.expires);
|
||||||
if (!server_config.remaining) lease.expires -= time(0);
|
if (!server_config.remaining) lease.expires -= time(0);
|
||||||
if (!(add_lease(lease.chaddr, lease.yiaddr, lease.expires))) {
|
if (!(add_lease(lease.chaddr, lease.yiaddr, lease.expires))) {
|
||||||
bb_error_msg("Too many leases while loading %s", file);
|
bb_error_msg("too many leases while loading %s", file);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
@ -76,12 +76,12 @@ uint8_t *get_option(struct dhcpMessage *packet, int code)
|
|||||||
length = 308;
|
length = 308;
|
||||||
while (!done) {
|
while (!done) {
|
||||||
if (i >= length) {
|
if (i >= length) {
|
||||||
bb_error_msg("Bogus packet, option fields too long");
|
bb_error_msg("bogus packet, option fields too long");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (optionptr[i + OPT_CODE] == code) {
|
if (optionptr[i + OPT_CODE] == code) {
|
||||||
if (i + 1 + optionptr[i + OPT_LEN] >= length) {
|
if (i + 1 + optionptr[i + OPT_LEN] >= length) {
|
||||||
bb_error_msg("Bogus packet, option fields too long");
|
bb_error_msg("bogus packet, option fields too long");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return optionptr + i + 2;
|
return optionptr + i + 2;
|
||||||
@ -92,7 +92,7 @@ uint8_t *get_option(struct dhcpMessage *packet, int code)
|
|||||||
break;
|
break;
|
||||||
case DHCP_OPTION_OVER:
|
case DHCP_OPTION_OVER:
|
||||||
if (i + 1 + optionptr[i + OPT_LEN] >= length) {
|
if (i + 1 + optionptr[i + OPT_LEN] >= length) {
|
||||||
bb_error_msg("Bogus packet, option fields too long");
|
bb_error_msg("bogus packet, option fields too long");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
over = optionptr[i + 3];
|
over = optionptr[i + 3];
|
||||||
@ -140,7 +140,7 @@ int add_option_string(uint8_t *optionptr, uint8_t *string)
|
|||||||
|
|
||||||
/* end position + string length + option code/length + end option */
|
/* end position + string length + option code/length + end option */
|
||||||
if (end + string[OPT_LEN] + 2 + 1 >= 308) {
|
if (end + string[OPT_LEN] + 2 + 1 >= 308) {
|
||||||
bb_error_msg("Option 0x%02x did not fit into the packet",
|
bb_error_msg("option 0x%02x did not fit into the packet",
|
||||||
string[OPT_CODE]);
|
string[OPT_CODE]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -58,12 +58,12 @@ int udhcp_get_packet(struct dhcpMessage *packet, int fd)
|
|||||||
memset(packet, 0, sizeof(struct dhcpMessage));
|
memset(packet, 0, sizeof(struct dhcpMessage));
|
||||||
bytes = read(fd, packet, sizeof(struct dhcpMessage));
|
bytes = read(fd, packet, sizeof(struct dhcpMessage));
|
||||||
if (bytes < 0) {
|
if (bytes < 0) {
|
||||||
DEBUG("couldn't read on listening socket, ignoring");
|
DEBUG("cannot read on listening socket, ignoring");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ntohl(packet->cookie) != DHCP_MAGIC) {
|
if (ntohl(packet->cookie) != DHCP_MAGIC) {
|
||||||
bb_error_msg("Received bogus message, ignoring");
|
bb_error_msg("received bogus message, ignoring");
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
DEBUG("Received a packet");
|
DEBUG("Received a packet");
|
||||||
|
@ -45,7 +45,7 @@ int pidfile_acquire(const char *pidfile)
|
|||||||
|
|
||||||
pid_fd = open(pidfile, O_CREAT | O_WRONLY, 0644);
|
pid_fd = open(pidfile, O_CREAT | O_WRONLY, 0644);
|
||||||
if (pid_fd < 0) {
|
if (pid_fd < 0) {
|
||||||
bb_perror_msg("Unable to open pidfile %s", pidfile);
|
bb_perror_msg("unable to open pidfile %s", pidfile);
|
||||||
} else {
|
} else {
|
||||||
lockf(pid_fd, F_LOCK, 0);
|
lockf(pid_fd, F_LOCK, 0);
|
||||||
if (!saved_pidfile)
|
if (!saved_pidfile)
|
||||||
@ -63,14 +63,11 @@ void pidfile_write_release(int pid_fd)
|
|||||||
|
|
||||||
if (pid_fd < 0) return;
|
if (pid_fd < 0) return;
|
||||||
|
|
||||||
if ((out = fdopen(pid_fd, "w")) != NULL) {
|
out = fdopen(pid_fd, "w");
|
||||||
|
if (out) {
|
||||||
fprintf(out, "%d\n", getpid());
|
fprintf(out, "%d\n", getpid());
|
||||||
fclose(out);
|
fclose(out);
|
||||||
}
|
}
|
||||||
lockf(pid_fd, F_UNLCK, 0);
|
lockf(pid_fd, F_UNLCK, 0);
|
||||||
close(pid_fd);
|
close(pid_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -158,12 +158,12 @@ int sendOffer(struct dhcpMessage *oldpacket)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!packet.yiaddr) {
|
if(!packet.yiaddr) {
|
||||||
bb_error_msg("No IP addresses to give - OFFER abandoned");
|
bb_error_msg("no IP addresses to give - OFFER abandoned");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!add_lease(packet.chaddr, packet.yiaddr, server_config.offer_time)) {
|
if (!add_lease(packet.chaddr, packet.yiaddr, server_config.offer_time)) {
|
||||||
bb_error_msg("Lease pool is full - OFFER abandoned");
|
bb_error_msg("lease pool is full - OFFER abandoned");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -755,7 +755,7 @@ void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data)
|
|||||||
"are interested in, you can still view the help of a grayed-out\n"
|
"are interested in, you can still view the help of a grayed-out\n"
|
||||||
"option.\n"
|
"option.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Toggling Show Debug Info under the Options menu will show \n"
|
"Toggling Show Debug Info under the Options menu will show\n"
|
||||||
"the dependencies, which you can then match by examining other options.");
|
"the dependencies, which you can then match by examining other options.");
|
||||||
|
|
||||||
dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
|
dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
|
||||||
|
@ -399,7 +399,7 @@ static int set_local_var(const char *s, int flg_export);
|
|||||||
/* Table of built-in functions. They can be forked or not, depending on
|
/* Table of built-in functions. They can be forked or not, depending on
|
||||||
* context: within pipes, they fork. As simple commands, they do not.
|
* context: within pipes, they fork. As simple commands, they do not.
|
||||||
* When used in non-forking context, they can change global variables
|
* When used in non-forking context, they can change global variables
|
||||||
* in the parent shell process. If forked, of course they can not.
|
* in the parent shell process. If forked, of course they cannot.
|
||||||
* For example, 'unset foo | whatever' will parse and run, but foo will
|
* For example, 'unset foo | whatever' will parse and run, but foo will
|
||||||
* still be set at the end. */
|
* still be set at the end. */
|
||||||
static const struct built_in_command bltins[] = {
|
static const struct built_in_command bltins[] = {
|
||||||
|
@ -1371,7 +1371,7 @@ get_boot(enum action what)
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
bb_error_msg_and_die(_("Internal error"));
|
bb_error_msg_and_die(_("internal error"));
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_FEATURE_FDISK_WRITABLE */
|
#endif /* CONFIG_FEATURE_FDISK_WRITABLE */
|
||||||
}
|
}
|
||||||
|
@ -111,12 +111,12 @@ int switch_root_main(int argc, char *argv[])
|
|||||||
if (console) {
|
if (console) {
|
||||||
close(0);
|
close(0);
|
||||||
if(open(console, O_RDWR) < 0)
|
if(open(console, O_RDWR) < 0)
|
||||||
bb_error_msg_and_die("Bad console '%s'",console);
|
bb_error_msg_and_die("bad console '%s'",console);
|
||||||
dup2(0, 1);
|
dup2(0, 1);
|
||||||
dup2(0, 2);
|
dup2(0, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exec real init. (This is why we must be pid 1.)
|
// Exec real init. (This is why we must be pid 1.)
|
||||||
execv(argv[optind],argv+optind);
|
execv(argv[optind],argv+optind);
|
||||||
bb_error_msg_and_die("Bad init '%s'",argv[optind]);
|
bb_error_msg_and_die("bad init '%s'",argv[optind]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user