aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2021-06-14 13:07:25 -0700
committerElliott Hughes <enh@google.com>2021-06-14 13:07:25 -0700
commit792621ac6fd9dde71aab6c38f899974ca4a4affa (patch)
tree5e42a86279edd17662aee39e33efeaacf14626aa
parent035f69a2aa7b656638d611bb7c2216dd764fab40 (diff)
parentf509ccd339679937e80b385aae9515aa0a161adb (diff)
downloadtoybox-792621ac6fd9dde71aab6c38f899974ca4a4affa.tar.gz
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: I1701189381ef19beacdf4cae451df451a0784f61
-rw-r--r--main.c2
-rw-r--r--toys/lsb/dmesg.c2
-rw-r--r--toys/lsb/md5sum.c4
-rw-r--r--toys/net/netstat.c4
-rw-r--r--www/.htaccess1
5 files changed, 7 insertions, 6 deletions
diff --git a/main.c b/main.c
index d5abe6e6..ffaece07 100644
--- a/main.c
+++ b/main.c
@@ -30,7 +30,7 @@ struct toy_list *toy_find(char *name)
if (!CFG_TOYBOX || strchr(name, '/')) return 0;
// Multiplexer name works as prefix, else skip first entry (it's out of order)
- if (!toys.which && strstart(&name, "toybox")) return toy_list;
+ if (!toys.which && strstart(&name, toy_list->name)) return toy_list;
bottom = 1;
// Binary search to find this command.
diff --git a/toys/lsb/dmesg.c b/toys/lsb/dmesg.c
index 829fcd54..8736a8e5 100644
--- a/toys/lsb/dmesg.c
+++ b/toys/lsb/dmesg.c
@@ -141,7 +141,7 @@ void dmesg_main(void)
for (;;) {
// why does /dev/kmesg return EPIPE instead of EAGAIN if oldest message
// expires as we read it?
- if (-1==(len = read(fd, msg, sizeof(msg))) && errno==EPIPE) continue;
+ if (-1==(len = read(fd, msg, sizeof(msg)-1)) && errno==EPIPE) continue;
// read() from kmsg always fails on a pre-3.5 kernel.
if (len==-1 && errno==EINVAL) goto klogctl_mode;
if (len<1) break;
diff --git a/toys/lsb/md5sum.c b/toys/lsb/md5sum.c
index 4df53a5c..feb403f7 100644
--- a/toys/lsb/md5sum.c
+++ b/toys/lsb/md5sum.c
@@ -514,10 +514,10 @@ void md5sum_main(void)
TT.rconsttable32 = xmalloc(64*4);
for (i = 0; i<64; i++) TT.rconsttable32[i] = fabs(sin(i+1))*(1LL<<32);
} else TT.rconsttable32 = md5nofloat;
- } else if (strchr("25", toys.which->name[4])) { // 224, 256
+ } else if (toys.which->name[3] == '2') { // sha224, sha256
TT.rconsttable32 = xmalloc(64*4);
for (i=0; i<64; i++) TT.rconsttable32[i] = sha512nofloat[i] >> 32;
- } else if (toys.which->name[3] != '1') TT.rconsttable64 = sha512nofloat;
+ } else TT.rconsttable64 = sha512nofloat; // sha384, sha512
}
if (FLAG(c)) for (i = 0; toys.optargs[i]; i++) do_c_file(toys.optargs[i]);
diff --git a/toys/net/netstat.c b/toys/net/netstat.c
index 24a2ceed..7eed02da 100644
--- a/toys/net/netstat.c
+++ b/toys/net/netstat.c
@@ -182,8 +182,8 @@ static void show_unix_sockets(void)
if (state==1 && flags && !(FLAG(a) || FLAG(l))) continue;
if (type==10) type = 7; // move SOCK_PACKET into line
- if (type>ARRAY_LEN(types)) type = 0;
- if (state>ARRAY_LEN(states) || (state==1 && !flags)) state = 0;
+ if (type>=ARRAY_LEN(types)) type = 0;
+ if (state>=ARRAY_LEN(states) || (state==1 && !flags)) state = 0;
if (state!=1 && FLAG(l)) continue;
diff --git a/www/.htaccess b/www/.htaccess
new file mode 100644
index 00000000..d687228e
--- /dev/null
+++ b/www/.htaccess
@@ -0,0 +1 @@
+Xbithack on