diff options
author | snowball <snowball@yandex-team.ru> | 2022-02-10 16:46:32 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:32 +0300 |
commit | 83a8efcf3af051e3dd59c00d1d5dafc96412ec1e (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util | |
parent | 4d57126b1bae3cfd0f4f95c32d1a85ca684ee92c (diff) | |
download | ydb-83a8efcf3af051e3dd59c00d1d5dafc96412ec1e.tar.gz |
Restoring authorship annotation for <snowball@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util')
23 files changed, 76 insertions, 76 deletions
diff --git a/util/charset/benchmark/to_lower/metrics/ya.make b/util/charset/benchmark/to_lower/metrics/ya.make index d5ef20a534..5bb3461a8d 100644 --- a/util/charset/benchmark/to_lower/metrics/ya.make +++ b/util/charset/benchmark/to_lower/metrics/ya.make @@ -9,7 +9,7 @@ PY2TEST() SIZE(LARGE) TAG( - ya:force_sandbox + ya:force_sandbox sb:intel_e5_2660v1 ya:fat ) diff --git a/util/charset/benchmark/utf8_to_wide/metrics/ya.make b/util/charset/benchmark/utf8_to_wide/metrics/ya.make index 561a9d7908..c406e25bee 100644 --- a/util/charset/benchmark/utf8_to_wide/metrics/ya.make +++ b/util/charset/benchmark/utf8_to_wide/metrics/ya.make @@ -9,7 +9,7 @@ PY2TEST() SIZE(LARGE) TAG( - ya:force_sandbox + ya:force_sandbox sb:intel_e5_2660v1 ya:fat ) diff --git a/util/charset/ya.make b/util/charset/ya.make index 466c045ce8..26d38cb10b 100644 --- a/util/charset/ya.make +++ b/util/charset/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(g:util) SUBSCRIBER(g:util-subscribers) -NO_UTIL() +NO_UTIL() IF (TSTRING_IS_STD_STRING) CFLAGS(GLOBAL -DTSTRING_IS_STD_STRING) diff --git a/util/draft/ya.make b/util/draft/ya.make index 95054f15c8..e00674b682 100644 --- a/util/draft/ya.make +++ b/util/draft/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(g:util) SUBSCRIBER(g:util-subscribers) -NO_UTIL() +NO_UTIL() IF (TSTRING_IS_STD_STRING) CFLAGS(GLOBAL -DTSTRING_IS_STD_STRING) diff --git a/util/folder/path.h b/util/folder/path.h index 1ddcacd55a..2fb4d6b4ef 100644 --- a/util/folder/path.h +++ b/util/folder/path.h @@ -56,9 +56,9 @@ public: return Path_ == that.Path_; } - inline bool operator!=(const TFsPath& that) const { - return Path_ != that.Path_; - } + inline bool operator!=(const TFsPath& that) const { + return Path_ != that.Path_; + } TFsPath& operator/=(const TFsPath& that); diff --git a/util/folder/path_ut.cpp b/util/folder/path_ut.cpp index f640a92365..e6a3451016 100644 --- a/util/folder/path_ut.cpp +++ b/util/folder/path_ut.cpp @@ -400,14 +400,14 @@ Y_UNIT_TEST_SUITE(TFsPathTests) { UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b\\..\\c", "d"), "a\\c\\d"); UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a", "b", "c", "d"), "a\\b\\c\\d"); UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b\\..\\c"), "a\\b\\..\\c"); - UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b", ""), "a\\b"); + UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b", ""), "a\\b"); #else UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b", "c/d"), "a/b/c/d"); UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b", "../c"), "a/b/../c"); UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b/../c", "d"), "a/c/d"); UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a", "b", "c", "d"), "a/b/c/d"); UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b/../c"), "a/b/../c"); - UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b", ""), "a/b"); + UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b", ""), "a/b"); #endif } diff --git a/util/generic/benchmark/fastclp2/metrics/ya.make b/util/generic/benchmark/fastclp2/metrics/ya.make index 63805b3322..b2d17ebad3 100644 --- a/util/generic/benchmark/fastclp2/metrics/ya.make +++ b/util/generic/benchmark/fastclp2/metrics/ya.make @@ -9,7 +9,7 @@ PY2TEST() SIZE(LARGE) TAG( - ya:force_sandbox + ya:force_sandbox sb:intel_e5_2660v1 ya:fat ) diff --git a/util/generic/benchmark/log2/metrics/ya.make b/util/generic/benchmark/log2/metrics/ya.make index 8882caa144..eb987e38d2 100644 --- a/util/generic/benchmark/log2/metrics/ya.make +++ b/util/generic/benchmark/log2/metrics/ya.make @@ -9,7 +9,7 @@ PY2TEST() SIZE(LARGE) TAG( - ya:force_sandbox + ya:force_sandbox sb:intel_e5_2660v1 ya:fat ) diff --git a/util/generic/benchmark/rotate_bits/metrics/ya.make b/util/generic/benchmark/rotate_bits/metrics/ya.make index 91155cca68..ac27d2f845 100644 --- a/util/generic/benchmark/rotate_bits/metrics/ya.make +++ b/util/generic/benchmark/rotate_bits/metrics/ya.make @@ -9,7 +9,7 @@ PY2TEST() SIZE(LARGE) TAG( - ya:force_sandbox + ya:force_sandbox sb:intel_e5_2660v1 ya:fat ) diff --git a/util/generic/benchmark/vector_count_ctor/metrics/ya.make b/util/generic/benchmark/vector_count_ctor/metrics/ya.make index f9e9ed60a0..c48f89b564 100644 --- a/util/generic/benchmark/vector_count_ctor/metrics/ya.make +++ b/util/generic/benchmark/vector_count_ctor/metrics/ya.make @@ -9,7 +9,7 @@ PY2TEST() SIZE(LARGE) TAG( - ya:force_sandbox + ya:force_sandbox sb:intel_e5_2660v1 ya:fat ) diff --git a/util/generic/hash.h b/util/generic/hash.h index 47bbf11544..e46db21fa9 100644 --- a/util/generic/hash.h +++ b/util/generic/hash.h @@ -48,10 +48,10 @@ template <class Value, class Key, class HashFcn, class ExtractKey, class EqualKey, class Alloc> class THashTable; -template <class Key, class T, class HashFcn, - class EqualKey, typename size_type_f> -class sthash; - +template <class Key, class T, class HashFcn, + class EqualKey, typename size_type_f> +class sthash; + template <class Value> struct __yhashtable_iterator; diff --git a/util/memory/benchmark/pool/metrics/ya.make b/util/memory/benchmark/pool/metrics/ya.make index dbc6f1cae3..c671bc5c1c 100644 --- a/util/memory/benchmark/pool/metrics/ya.make +++ b/util/memory/benchmark/pool/metrics/ya.make @@ -6,7 +6,7 @@ PY2TEST() SIZE(LARGE) TAG( - ya:force_sandbox + ya:force_sandbox sb:intel_e5_2660v1 ya:fat ) diff --git a/util/network/ut/ya.make b/util/network/ut/ya.make index 0814bc2b4f..1ba03e167c 100644 --- a/util/network/ut/ya.make +++ b/util/network/ut/ya.make @@ -1,7 +1,7 @@ UNITTEST_FOR(util) -REQUIREMENTS(network:full) - +REQUIREMENTS(network:full) + OWNER(g:util) SUBSCRIBER(g:util-subscribers) diff --git a/util/random/benchmark/prng/metrics/ya.make b/util/random/benchmark/prng/metrics/ya.make index 8ff7a53419..1f56aac0bd 100644 --- a/util/random/benchmark/prng/metrics/ya.make +++ b/util/random/benchmark/prng/metrics/ya.make @@ -9,7 +9,7 @@ PY2TEST() SIZE(LARGE) TAG( - ya:force_sandbox + ya:force_sandbox sb:intel_e5_2660v1 ya:fat ) diff --git a/util/string/benchmark/float_to_string/metrics/ya.make b/util/string/benchmark/float_to_string/metrics/ya.make index 46791a6b93..4b8c4cc07d 100644 --- a/util/string/benchmark/float_to_string/metrics/ya.make +++ b/util/string/benchmark/float_to_string/metrics/ya.make @@ -9,7 +9,7 @@ PY2TEST() SIZE(LARGE) TAG( - ya:force_sandbox + ya:force_sandbox sb:intel_e5_2660v1 ya:fat ) diff --git a/util/string/benchmark/join/metrics/ya.make b/util/string/benchmark/join/metrics/ya.make index c30e133e18..08ff3a149f 100644 --- a/util/string/benchmark/join/metrics/ya.make +++ b/util/string/benchmark/join/metrics/ya.make @@ -9,7 +9,7 @@ PY2TEST() SIZE(LARGE) TAG( - ya:force_sandbox + ya:force_sandbox sb:intel_e5_2660v1 ya:fat ) diff --git a/util/string/benchmark/subst_global/metrics/ya.make b/util/string/benchmark/subst_global/metrics/ya.make index 15e1edb7b8..d8c30ad460 100644 --- a/util/string/benchmark/subst_global/metrics/ya.make +++ b/util/string/benchmark/subst_global/metrics/ya.make @@ -9,7 +9,7 @@ PY2TEST() SIZE(LARGE) TAG( - ya:force_sandbox + ya:force_sandbox sb:intel_e5_2660v1 ya:fat ) diff --git a/util/system/benchmark/cpu_id/metrics/ya.make b/util/system/benchmark/cpu_id/metrics/ya.make index b15a3230a0..8c55def99b 100644 --- a/util/system/benchmark/cpu_id/metrics/ya.make +++ b/util/system/benchmark/cpu_id/metrics/ya.make @@ -9,7 +9,7 @@ PY2TEST() SIZE(LARGE) TAG( - ya:force_sandbox + ya:force_sandbox sb:intel_e5_2660v1 ya:fat ) diff --git a/util/system/benchmark/create_destroy_thread/metrics/ya.make b/util/system/benchmark/create_destroy_thread/metrics/ya.make index 92a8b5752f..d526487e1a 100644 --- a/util/system/benchmark/create_destroy_thread/metrics/ya.make +++ b/util/system/benchmark/create_destroy_thread/metrics/ya.make @@ -9,7 +9,7 @@ PY2TEST() SIZE(LARGE) TAG( - ya:force_sandbox + ya:force_sandbox sb:intel_e5_2660v1 ya:fat ) diff --git a/util/system/fstat.cpp b/util/system/fstat.cpp index ea87835fc7..81e98cbc6b 100644 --- a/util/system/fstat.cpp +++ b/util/system/fstat.cpp @@ -15,7 +15,7 @@ #endif #define _S_IFLNK 0x80000000 -ui32 GetFileMode(DWORD fileAttributes) { +ui32 GetFileMode(DWORD fileAttributes) { ui32 mode = 0; if (fileAttributes == 0xFFFFFFFF) return mode; @@ -23,14 +23,14 @@ ui32 GetFileMode(DWORD fileAttributes) { mode |= _S_IFCHR; if (fileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) mode |= _S_IFLNK; // todo: was undefined by the moment of writing this code - if (fileAttributes & FILE_ATTRIBUTE_DIRECTORY) + if (fileAttributes & FILE_ATTRIBUTE_DIRECTORY) mode |= _S_IFDIR; if (fileAttributes & (FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_ARCHIVE)) mode |= _S_IFREG; if ((fileAttributes & FILE_ATTRIBUTE_READONLY) == 0) mode |= _S_IWRITE; return mode; -} +} #define S_ISDIR(st_mode) (st_mode & _S_IFDIR) #define S_ISREG(st_mode) (st_mode & _S_IFREG) @@ -42,8 +42,8 @@ using TSystemFStat = BY_HANDLE_FILE_INFORMATION; using TSystemFStat = struct stat; -#endif - +#endif + static void MakeStat(TFileStat& st, const TSystemFStat& fs) { #ifdef _unix_ st.Mode = fs.st_mode; diff --git a/util/system/shellcommand.cpp b/util/system/shellcommand.cpp index d071d8a4b3..b1989b5c8c 100644 --- a/util/system/shellcommand.cpp +++ b/util/system/shellcommand.cpp @@ -28,11 +28,11 @@ using TPid = pid_t; using TWaitResult = pid_t; using TExitStatus = int; #define WAIT_PROCEED 0 - + #if defined(_darwin_) -using TGetGroupListGid = int; +using TGetGroupListGid = int; #else -using TGetGroupListGid = gid_t; +using TGetGroupListGid = gid_t; #endif #elif defined(_win_) #include <string> @@ -57,31 +57,31 @@ namespace { constexpr static size_t DATA_BUFFER_SIZE = 128 * 1024; #if defined(_unix_) - void SetUserGroups(const passwd* pw) { - int ngroups = 1; + void SetUserGroups(const passwd* pw) { + int ngroups = 1; THolder<gid_t, TFree> groups = THolder<gid_t, TFree>(static_cast<gid_t*>(malloc(ngroups * sizeof(gid_t)))); - if (getgrouplist(pw->pw_name, pw->pw_gid, reinterpret_cast<TGetGroupListGid*>(groups.Get()), &ngroups) == -1) { - groups.Reset(static_cast<gid_t*>(malloc(ngroups * sizeof(gid_t)))); - if (getgrouplist(pw->pw_name, pw->pw_gid, reinterpret_cast<TGetGroupListGid*>(groups.Get()), &ngroups) == -1) { - ythrow TSystemError() << "getgrouplist failed: user " << pw->pw_name << " (" << pw->pw_uid << ")"; - } - } - if (setgroups(ngroups, groups.Get()) == -1) { - ythrow TSystemError(errno) << "Unable to set groups for user " << pw->pw_name << Endl; - } - } - - void ImpersonateUser(const TShellCommandOptions::TUserOptions& userOpts) { - if (GetUsername() == userOpts.Name) { + if (getgrouplist(pw->pw_name, pw->pw_gid, reinterpret_cast<TGetGroupListGid*>(groups.Get()), &ngroups) == -1) { + groups.Reset(static_cast<gid_t*>(malloc(ngroups * sizeof(gid_t)))); + if (getgrouplist(pw->pw_name, pw->pw_gid, reinterpret_cast<TGetGroupListGid*>(groups.Get()), &ngroups) == -1) { + ythrow TSystemError() << "getgrouplist failed: user " << pw->pw_name << " (" << pw->pw_uid << ")"; + } + } + if (setgroups(ngroups, groups.Get()) == -1) { + ythrow TSystemError(errno) << "Unable to set groups for user " << pw->pw_name << Endl; + } + } + + void ImpersonateUser(const TShellCommandOptions::TUserOptions& userOpts) { + if (GetUsername() == userOpts.Name) { return; } - const passwd* newUser = getpwnam(userOpts.Name.c_str()); + const passwd* newUser = getpwnam(userOpts.Name.c_str()); if (!newUser) { ythrow TSystemError(errno) << "getpwnam failed"; } - if (userOpts.UseUserGroups) { - SetUserGroups(newUser); - } + if (userOpts.UseUserGroups) { + SetUserGroups(newUser); + } if (setuid(newUser->pw_uid)) { ythrow TSystemError(errno) << "setuid failed"; } @@ -727,7 +727,7 @@ void TShellCommand::TImpl::OnFork(TPipes& pipes, sigset_t oldmask, char* const* } if (!User.Name.empty()) { - ImpersonateUser(User); + ImpersonateUser(User); } if (Nice) { diff --git a/util/system/shellcommand.h b/util/system/shellcommand.h index 977fa538cb..8730627fe5 100644 --- a/util/system/shellcommand.h +++ b/util/system/shellcommand.h @@ -21,14 +21,14 @@ public: #if defined(_win_) TString Password; #endif -#if defined(_unix_) - /** - * Run child process with the user supplementary groups. - * If true, the user supplementary groups will be set in the child process upon exec(). - * If false, the supplementary groups of the parent process will be used. - */ - bool UseUserGroups = false; -#endif +#if defined(_unix_) + /** + * Run child process with the user supplementary groups. + * If true, the user supplementary groups will be set in the child process upon exec(). + * If false, the supplementary groups of the parent process will be used. + */ + bool UseUserGroups = false; +#endif }; enum EHandleMode { @@ -66,7 +66,7 @@ public: } /** - * @brief clear signal mask from parent process. If true, child process + * @brief clear signal mask from parent process. If true, child process * clears the signal mask inherited from the parent process; otherwise * child process retains the signal mask of the parent process. * @@ -80,7 +80,7 @@ public: } /** - * @brief set close-on-exec mode. If true, all file descriptors + * @brief set close-on-exec mode. If true, all file descriptors * from the parent process, except stdin, stdout, stderr, will be closed * in the child process upon exec(). * @@ -415,22 +415,22 @@ public: TProcessId GetPid() const; /** - * @brief return the file handle that provides input to the child process - * + * @brief return the file handle that provides input to the child process + * * @return input file handle */ TFileHandle& GetInputHandle(); /** - * @brief return the file handle that provides output from the child process - * + * @brief return the file handle that provides output from the child process + * * @return output file handle */ TFileHandle& GetOutputHandle(); /** - * @brief return the file handle that provides error output from the child process - * + * @brief return the file handle that provides error output from the child process + * * @return error file handle */ TFileHandle& GetErrorHandle(); diff --git a/util/ya.make b/util/ya.make index 058e1f772d..6ebe7e40cf 100644 --- a/util/ya.make +++ b/util/ya.make @@ -5,7 +5,7 @@ SUBSCRIBER(g:util-subscribers) NEED_CHECK() -NO_UTIL() +NO_UTIL() # stream # string @@ -36,7 +36,7 @@ SRCS( string/cast.cpp ) -IF (OS_WINDOWS) +IF (OS_WINDOWS) SRCS( datetime/strptime.cpp ) @@ -72,7 +72,7 @@ JOIN_SRCS( folder/tempdir.cpp ) -IF (OS_WINDOWS) +IF (OS_WINDOWS) SRCS( folder/lstat_win.c folder/dirent_win.c @@ -327,7 +327,7 @@ JOIN_SRCS( SRC(system/compiler.cpp -fno-lto) -IF (OS_WINDOWS) +IF (OS_WINDOWS) SRCS( system/fs_win.cpp system/winint.cpp @@ -347,7 +347,7 @@ ELSE() ENDIF() ENDIF() -IF (OS_LINUX) +IF (OS_LINUX) SRCS( system/valgrind.cpp ) @@ -362,7 +362,7 @@ IF (MUSL) contrib/libs/linuxvdso ) ELSE() - IF (OS_LINUX OR SUN OR CYGWIN OR OS_WINDOWS) + IF (OS_LINUX OR SUN OR CYGWIN OR OS_WINDOWS) SRCS( system/mktemp_system.cpp ) |