Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Apache
: 172.26.7.228 | : 3.129.195.82
Cant Read [ /etc/named.conf ]
5.6.40-24+ubuntu18.04.1+deb.sury.org+1
www-data
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
home /
ubuntu /
s3fs-fuse /
src /
[ HOME SHELL ]
Name
Size
Permission
Action
.deps
[ DIR ]
drwxrwxr-x
Makefile
32.69
KB
-rw-rw-r--
Makefile.am
1.57
KB
-rw-rw-r--
Makefile.in
33.49
KB
-rw-rw-r--
addhead.cpp
7.13
KB
-rw-rw-r--
addhead.h
1.96
KB
-rw-rw-r--
addhead.o
574.42
KB
-rw-rw-r--
cache.cpp
20.22
KB
-rw-rw-r--
cache.h
5.72
KB
-rw-rw-r--
cache.o
1.12
MB
-rw-rw-r--
common.h
6.94
KB
-rw-rw-r--
common_auth.cpp
2.37
KB
-rw-rw-r--
common_auth.o
157.23
KB
-rw-rw-r--
curl.cpp
143.81
KB
-rw-rw-r--
curl.h
24.85
KB
-rw-rw-r--
curl.o
4.23
MB
-rw-rw-r--
fdcache.cpp
79.11
KB
-rw-rw-r--
fdcache.h
10.04
KB
-rw-rw-r--
fdcache.o
1.91
MB
-rw-rw-r--
gnutls_auth.cpp
10.44
KB
-rw-rw-r--
nss_auth.cpp
7.46
KB
-rw-rw-r--
openssl_auth.cpp
9.59
KB
-rw-rw-r--
openssl_auth.o
106.31
KB
-rw-rw-r--
psemaphore.h
2.01
KB
-rw-rw-r--
s3fs
5.94
MB
-rwxrwxr-x
s3fs.cpp
163.04
KB
-rw-rw-r--
s3fs.h
2.73
KB
-rw-rw-r--
s3fs.o
4.31
MB
-rw-rw-r--
s3fs_auth.h
2.21
KB
-rw-rw-r--
s3fs_util.cpp
49.47
KB
-rw-rw-r--
s3fs_util.h
4.78
KB
-rw-rw-r--
s3fs_util.o
1.14
MB
-rw-rw-r--
string_util.cpp
14.98
KB
-rw-rw-r--
string_util.h
2.77
KB
-rw-rw-r--
string_util.o
655.09
KB
-rw-rw-r--
test_string_util
461.34
KB
-rwxrwxr-x
test_string_util.cpp
5.06
KB
-rw-rw-r--
test_string_util.o
394.03
KB
-rw-rw-r--
test_util.h
2.85
KB
-rw-rw-r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : test_string_util.cpp
/* * s3fs - FUSE-based file system backed by Amazon S3 * * Copyright(C) 2014 Andrew Gaul <andrew@gaul.org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <limits> #include <stdint.h> #include <string> #include "string_util.h" #include "test_util.h" void test_trim() { ASSERT_EQUALS(std::string("1234"), trim(" 1234 ")); ASSERT_EQUALS(std::string("1234"), trim("1234 ")); ASSERT_EQUALS(std::string("1234"), trim(" 1234")); ASSERT_EQUALS(std::string("1234"), trim("1234")); ASSERT_EQUALS(std::string("1234 "), trim_left(" 1234 ")); ASSERT_EQUALS(std::string("1234 "), trim_left("1234 ")); ASSERT_EQUALS(std::string("1234"), trim_left(" 1234")); ASSERT_EQUALS(std::string("1234"), trim_left("1234")); ASSERT_EQUALS(std::string(" 1234"), trim_right(" 1234 ")); ASSERT_EQUALS(std::string("1234"), trim_right("1234 ")); ASSERT_EQUALS(std::string(" 1234"), trim_right(" 1234")); ASSERT_EQUALS(std::string("1234"), trim_right("1234")); ASSERT_EQUALS(std::string("0"), str(0)); ASSERT_EQUALS(std::string("1"), str(1)); ASSERT_EQUALS(std::string("-1"), str(-1)); ASSERT_EQUALS(std::string("9223372036854775807"), str(std::numeric_limits<int64_t>::max())); ASSERT_EQUALS(std::string("-9223372036854775808"), str(std::numeric_limits<int64_t>::min())); ASSERT_EQUALS(std::string("0"), str(std::numeric_limits<uint64_t>::min())); ASSERT_EQUALS(std::string("18446744073709551615"), str(std::numeric_limits<uint64_t>::max())); } void test_base64() { size_t len; ASSERT_STREQUALS(s3fs_base64(NULL, 0), NULL); ASSERT_STREQUALS(reinterpret_cast<const char *>(s3fs_decode64(NULL, &len)), NULL); ASSERT_STREQUALS(s3fs_base64(reinterpret_cast<const unsigned char *>(""), 0), NULL); ASSERT_STREQUALS(reinterpret_cast<const char *>(s3fs_decode64("", &len)), NULL); ASSERT_STREQUALS(s3fs_base64(reinterpret_cast<const unsigned char *>("1"), 1), "MQ=="); ASSERT_STREQUALS(reinterpret_cast<const char *>(s3fs_decode64("MQ==", &len)), "1"); ASSERT_EQUALS(len, static_cast<size_t>(1)); ASSERT_STREQUALS(s3fs_base64(reinterpret_cast<const unsigned char *>("12"), 2), "MTI="); ASSERT_STREQUALS(reinterpret_cast<const char *>(s3fs_decode64("MTI=", &len)), "12"); ASSERT_EQUALS(len, static_cast<size_t>(2)); ASSERT_STREQUALS(s3fs_base64(reinterpret_cast<const unsigned char *>("123"), 3), "MTIz"); ASSERT_STREQUALS(reinterpret_cast<const char *>(s3fs_decode64("MTIz", &len)), "123"); ASSERT_EQUALS(len, static_cast<size_t>(3)); ASSERT_STREQUALS(s3fs_base64(reinterpret_cast<const unsigned char *>("1234"), 4), "MTIzNA=="); ASSERT_STREQUALS(reinterpret_cast<const char *>(s3fs_decode64("MTIzNA==", &len)), "1234"); ASSERT_EQUALS(len, static_cast<size_t>(4)); // TODO: invalid input } void test_strtoofft() { ASSERT_EQUALS(s3fs_strtoofft("0"), static_cast<off_t>(0L)); ASSERT_EQUALS(s3fs_strtoofft("9"), static_cast<off_t>(9L)); try{ s3fs_strtoofft("A"); abort(); }catch(std::exception &e){ // expected } ASSERT_EQUALS(s3fs_strtoofft("A", /*base=*/ 16), static_cast<off_t>(10L)); ASSERT_EQUALS(s3fs_strtoofft("F", /*base=*/ 16), static_cast<off_t>(15L)); ASSERT_EQUALS(s3fs_strtoofft("a", /*base=*/ 16), static_cast<off_t>(10L)); ASSERT_EQUALS(s3fs_strtoofft("f", /*base=*/ 16), static_cast<off_t>(15L)); ASSERT_EQUALS(s3fs_strtoofft("deadbeef", /*base=*/ 16), static_cast<off_t>(3735928559L)); } void test_wtf8_encoding() { std::string ascii("normal string"); std::string utf8("Hyld\xc3\xbdpi \xc3\xbej\xc3\xb3\xc3\xb0""f\xc3\xa9lagsins vex \xc3\xbar k\xc3\xa6rkomnu b\xc3\xb6li \xc3\xad \xc3\xa1st"); std::string cp1252("Hyld\xfdpi \xfej\xf3\xf0""f\xe9lagsins vex \xfar k\xe6rkomnu b\xf6li \xed \xe1st"); std::string broken = utf8; broken[14] = 0x97; std::string mixed = ascii + utf8 + cp1252; ASSERT_EQUALS(s3fs_wtf8_encode(ascii), ascii); ASSERT_EQUALS(s3fs_wtf8_decode(ascii), ascii); ASSERT_EQUALS(s3fs_wtf8_encode(utf8), utf8); ASSERT_EQUALS(s3fs_wtf8_decode(utf8), utf8); ASSERT_NEQUALS(s3fs_wtf8_encode(cp1252), cp1252); ASSERT_EQUALS(s3fs_wtf8_decode(s3fs_wtf8_encode(cp1252)), cp1252); ASSERT_NEQUALS(s3fs_wtf8_encode(broken), broken); ASSERT_EQUALS(s3fs_wtf8_decode(s3fs_wtf8_encode(broken)), broken); ASSERT_NEQUALS(s3fs_wtf8_encode(mixed), mixed); ASSERT_EQUALS(s3fs_wtf8_decode(s3fs_wtf8_encode(mixed)), mixed); } int main(int argc, char *argv[]) { test_trim(); test_base64(); test_strtoofft(); test_wtf8_encoding(); return 0; }
Close