| 1 |
# Russian translation of manpages |
| 2 |
# This file is distributed under the same license as the manpages-l10n package. |
| 3 |
# Copyright © of this file: |
| 4 |
# Azamat Hackimov <[email protected]>, 2013-2014, 2017. |
| 5 |
# Dmitriy S. Seregin <[email protected]>, 2013. |
| 6 |
# Yuri Kozlov <[email protected]>, 2011-2019. |
| 7 |
# Иван Павлов <[email protected]>, 2017, 2019. |
| 8 |
msgid "" |
| 9 |
msgstr "" |
| 10 |
"Project-Id-Version: manpages-l10n\n" |
| 11 |
"POT-Creation-Date: 2025-08-10 07:53+0200\n" |
| 12 |
"PO-Revision-Date: 2024-12-21 19:49+0300\n" |
| 13 |
"Last-Translator: Yuri Kozlov <[email protected]>\n" |
| 14 |
"Language-Team: Russian <[email protected]>\n" |
| 15 |
"Language: ru\n" |
| 16 |
"MIME-Version: 1.0\n" |
| 17 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 18 |
"Content-Transfer-Encoding: 8bit\n" |
| 19 |
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " |
| 20 |
"n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || " |
| 21 |
"(n%100>=11 && n%100<=14)? 2 : 3);\n" |
| 22 |
"X-Generator: Lokalize 2.0\n" |
| 23 |
|
| 24 |
#. type: TH |
| 25 |
#: mageia-cauldron |
| 26 |
#, no-wrap |
| 27 |
msgid "ioctl_ns" |
| 28 |
msgstr "ioctl_ns" |
| 29 |
|
| 30 |
#. type: TH |
| 31 |
#: mageia-cauldron |
| 32 |
#, no-wrap |
| 33 |
msgid "2023-10-31" |
| 34 |
msgstr "31 октября 2023 г." |
| 35 |
|
| 36 |
#. type: TH |
| 37 |
#: mageia-cauldron |
| 38 |
#, no-wrap |
| 39 |
msgid "Linux man-pages 6.06" |
| 40 |
msgstr "Справочные страницы Linux 6.06" |
| 41 |
|
| 42 |
#. type: SH |
| 43 |
#: mageia-cauldron |
| 44 |
#, no-wrap |
| 45 |
msgid "NAME" |
| 46 |
msgstr "НАИМЕНОВАНИЕ" |
| 47 |
|
| 48 |
#. type: Plain text |
| 49 |
#: mageia-cauldron |
| 50 |
msgid "ioctl_ns - ioctl() operations for Linux namespaces" |
| 51 |
msgstr "ioctl_ns - операции ioctl() для пространств имён Linux" |
| 52 |
|
| 53 |
#. type: SH |
| 54 |
#: mageia-cauldron |
| 55 |
#, no-wrap |
| 56 |
msgid "DESCRIPTION" |
| 57 |
msgstr "ОПИСАНИЕ" |
| 58 |
|
| 59 |
#. ============================================================ |
| 60 |
#. type: SS |
| 61 |
#: mageia-cauldron |
| 62 |
#, no-wrap |
| 63 |
msgid "Discovering namespace relationships" |
| 64 |
msgstr "Определение отношений между пространствами имён" |
| 65 |
|
| 66 |
#. type: Plain text |
| 67 |
#: mageia-cauldron |
| 68 |
msgid "" |
| 69 |
"The following B<ioctl>(2) operations are provided to allow discovery of " |
| 70 |
"namespace relationships (see B<user_namespaces>(7) and " |
| 71 |
"B<pid_namespaces>(7)). The form of the calls is:" |
| 72 |
msgstr "" |
| 73 |
"Следующие операции B<ioctl>(2) позволяют определить порядок отношений между " |
| 74 |
"пространствами имён (смотрите B<user_namespaces>(7) и B<pid_namespaces>(7)). " |
| 75 |
"Форма вызовов:" |
| 76 |
|
| 77 |
#. type: Plain text |
| 78 |
#: mageia-cauldron |
| 79 |
#, no-wrap |
| 80 |
msgid "new_fd = ioctl(fd, request);\n" |
| 81 |
msgstr "new_fd = ioctl(fd, request);\n" |
| 82 |
|
| 83 |
#. type: Plain text |
| 84 |
#: mageia-cauldron |
| 85 |
msgid "" |
| 86 |
"In each case, I<fd> refers to a I</proc/>pidI</ns/*> file. Both operations " |
| 87 |
"return a new file descriptor on success." |
| 88 |
msgstr "" |
| 89 |
"Здесь в каждом случае I<fd> ссылается на файл I</proc/>pidI</ns/*>. При " |
| 90 |
"успешном выполнении обе операции возвращают новый файловый дескриптор." |
| 91 |
|
| 92 |
#. type: TP |
| 93 |
#: mageia-cauldron |
| 94 |
#, no-wrap |
| 95 |
msgid "B<NS_GET_USERNS> (since Linux 4.9)" |
| 96 |
msgstr "B<NS_GET_USERNS> (начиная с Linux 4.9)" |
| 97 |
|
| 98 |
#. commit bcac25a58bfc6bd79191ac5d7afb49bea96da8c9 |
| 99 |
#. commit 6786741dbf99e44fb0c0ed85a37582b8a26f1c3b |
| 100 |
#. type: Plain text |
| 101 |
#: mageia-cauldron |
| 102 |
msgid "" |
| 103 |
"Returns a file descriptor that refers to the owning user namespace for the " |
| 104 |
"namespace referred to by I<fd>." |
| 105 |
msgstr "" |
| 106 |
"Возвращает файловый дескриптор, ссылающийся на пространство имён " |
| 107 |
"пользователя, которое владеет пространством имён, на которое ссылается I<fd>." |
| 108 |
|
| 109 |
#. type: TP |
| 110 |
#: mageia-cauldron |
| 111 |
#, no-wrap |
| 112 |
msgid "B<NS_GET_PARENT> (since Linux 4.9)" |
| 113 |
msgstr "B<NS_GET_PARENT> (начиная с Linux 4.9)" |
| 114 |
|
| 115 |
#. commit a7306ed8d94af729ecef8b6e37506a1c6fc14788 |
| 116 |
#. type: Plain text |
| 117 |
#: mageia-cauldron |
| 118 |
msgid "" |
| 119 |
"Returns a file descriptor that refers to the parent namespace of the " |
| 120 |
"namespace referred to by I<fd>. This operation is valid only for " |
| 121 |
"hierarchical namespaces (i.e., PID and user namespaces). For user " |
| 122 |
"namespaces, B<NS_GET_PARENT> is synonymous with B<NS_GET_USERNS>." |
| 123 |
msgstr "" |
| 124 |
"Возвращает файловый дескриптор, который ссылается на родительское " |
| 125 |
"пространство имён для пространства имён, на которое ссылается I<fd>. Эта " |
| 126 |
"операция допускается только, для иерархических пространств имён (т. е., PID " |
| 127 |
"и пространства имён пользователя). Для пространств имён пользователя " |
| 128 |
"B<NS_GET_PARENT> является синонимом B<NS_GET_USERNS>." |
| 129 |
|
| 130 |
#. type: Plain text |
| 131 |
#: mageia-cauldron |
| 132 |
msgid "" |
| 133 |
"The new file descriptor returned by these operations is opened with the " |
| 134 |
"B<O_RDONLY> and B<O_CLOEXEC> (close-on-exec; see B<fcntl>(2)) flags." |
| 135 |
msgstr "" |
| 136 |
"Новый файловый дескриптор, возвращаемый этими операциями, открывается с " |
| 137 |
"флагами B<O_RDONLY> и B<O_CLOEXEC> (close-on-exec; смотрите B<fcntl>(2))." |
| 138 |
|
| 139 |
#. type: Plain text |
| 140 |
#: mageia-cauldron |
| 141 |
msgid "" |
| 142 |
"By applying B<fstat>(2) to the returned file descriptor, one obtains a " |
| 143 |
"I<stat> structure whose I<st_dev> (resident device) and I<st_ino> (inode " |
| 144 |
"number) fields together identify the owning/parent namespace. This inode " |
| 145 |
"number can be matched with the inode number of another I</proc/>pidI</ns/" |
| 146 |
">{I<pid>,I<user>} file to determine whether that is the owning/parent " |
| 147 |
"namespace." |
| 148 |
msgstr "" |
| 149 |
"Применив B<fstat>(2) к возвращаемому файловому дескриптору, можно получить " |
| 150 |
"структуру I<stat>, в которой поля I<st_dev> (подлежащее устройство) и " |
| 151 |
"I<st_ino> (номер иноды) вместе отождествляют владельческое/родительское " |
| 152 |
"пространство имён. Этот номер иноды можно сравнить с номером иноды другого " |
| 153 |
"файла I</proc/>pidI</ns>/{I<pid>,I<user>}, чтобы определить то же ли это " |
| 154 |
"владельческое/родительское пространство имён. " |
| 155 |
|
| 156 |
#. type: Plain text |
| 157 |
#: mageia-cauldron |
| 158 |
msgid "" |
| 159 |
"Either of these B<ioctl>(2) operations can fail with the following errors:" |
| 160 |
msgstr "Эти операции B<ioctl>(2) могут завершаться со следующими ошибками:" |
| 161 |
|
| 162 |
#. type: TP |
| 163 |
#: mageia-cauldron |
| 164 |
#, no-wrap |
| 165 |
msgid "B<EPERM>" |
| 166 |
msgstr "B<EPERM>" |
| 167 |
|
| 168 |
#. type: Plain text |
| 169 |
#: mageia-cauldron |
| 170 |
msgid "" |
| 171 |
"The requested namespace is outside of the caller's namespace scope. This " |
| 172 |
"error can occur if, for example, the owning user namespace is an ancestor of " |
| 173 |
"the caller's current user namespace. It can also occur on attempts to " |
| 174 |
"obtain the parent of the initial user or PID namespace." |
| 175 |
msgstr "" |
| 176 |
"Запрошенное пространство имён лежит вне области пространств имён " |
| 177 |
"вызывающего. Эта ошибка может случиться, если, например, владельческое " |
| 178 |
"пространство имён является предком текущего пространства имён пользователя " |
| 179 |
"вызывающего. Также она может возникнуть при попытке получить родителя " |
| 180 |
"первоначального пространства имён пользователя или PID." |
| 181 |
|
| 182 |
#. type: TP |
| 183 |
#: mageia-cauldron |
| 184 |
#, no-wrap |
| 185 |
msgid "B<ENOTTY>" |
| 186 |
msgstr "B<ENOTTY>" |
| 187 |
|
| 188 |
#. type: Plain text |
| 189 |
#: mageia-cauldron |
| 190 |
msgid "The operation is not supported by this kernel version." |
| 191 |
msgstr "Операция не поддерживается в этой версии ядра." |
| 192 |
|
| 193 |
#. type: Plain text |
| 194 |
#: mageia-cauldron |
| 195 |
msgid "" |
| 196 |
"Additionally, the B<NS_GET_PARENT> operation can fail with the following " |
| 197 |
"error:" |
| 198 |
msgstr "" |
| 199 |
"Также, операция B<NS_GET_PARENT> может завершиться со следующей ошибкой:" |
| 200 |
|
| 201 |
#. type: TP |
| 202 |
#: mageia-cauldron |
| 203 |
#, no-wrap |
| 204 |
msgid "B<EINVAL>" |
| 205 |
msgstr "B<EINVAL>" |
| 206 |
|
| 207 |
#. type: Plain text |
| 208 |
#: mageia-cauldron |
| 209 |
msgid "I<fd> refers to a nonhierarchical namespace." |
| 210 |
msgstr "Значение I<fd> ссылается на не иерархическое пространство имён." |
| 211 |
|
| 212 |
#. ============================================================ |
| 213 |
#. type: Plain text |
| 214 |
#: mageia-cauldron |
| 215 |
msgid "See the EXAMPLES section for an example of the use of these operations." |
| 216 |
msgstr "Использование этих операций смотрите в разделе ПРИМЕРЫ." |
| 217 |
|
| 218 |
#. type: SS |
| 219 |
#: mageia-cauldron |
| 220 |
#, no-wrap |
| 221 |
msgid "Discovering the namespace type" |
| 222 |
msgstr "Определение типа пространства имён" |
| 223 |
|
| 224 |
#. commit e5ff5ce6e20ee22511398bb31fb912466cf82a36 |
| 225 |
#. type: Plain text |
| 226 |
#: mageia-cauldron |
| 227 |
msgid "" |
| 228 |
"The B<NS_GET_NSTYPE> operation (available since Linux 4.11) can be used to " |
| 229 |
"discover the type of namespace referred to by the file descriptor I<fd>:" |
| 230 |
msgstr "" |
| 231 |
"Операция B<NS_GET_NSTYPE> (доступна, начиная с Linux 4.11) позволяет " |
| 232 |
"определять тип пространства имён, на которое ссылается файловый дескриптор " |
| 233 |
"I<fd>:" |
| 234 |
|
| 235 |
#. type: Plain text |
| 236 |
#: mageia-cauldron |
| 237 |
#, no-wrap |
| 238 |
msgid "nstype = ioctl(fd, NS_GET_NSTYPE);\n" |
| 239 |
msgstr "nstype = ioctl(fd, NS_GET_NSTYPE);\n" |
| 240 |
|
| 241 |
#. type: Plain text |
| 242 |
#: mageia-cauldron |
| 243 |
msgid "I<fd> refers to a I</proc/>pidI</ns/*> file." |
| 244 |
msgstr "Значение I<fd> ссылается на файл I</proc/>pidI</ns/*>." |
| 245 |
|
| 246 |
#. ============================================================ |
| 247 |
#. type: Plain text |
| 248 |
#: mageia-cauldron |
| 249 |
msgid "" |
| 250 |
"The return value is one of the B<CLONE_NEW*> values that can be specified to " |
| 251 |
"B<clone>(2) or B<unshare>(2) in order to create a namespace." |
| 252 |
msgstr "" |
| 253 |
"Возвращаемым значением является одно из B<CLONE_NEW*>, которое может " |
| 254 |
"указываться B<clone>(2) или B<unshare>(2) для создания пространства имён." |
| 255 |
|
| 256 |
#. type: SS |
| 257 |
#: mageia-cauldron |
| 258 |
#, no-wrap |
| 259 |
msgid "Discovering the owner of a user namespace" |
| 260 |
msgstr "Определение владельца пространства имён пользователя" |
| 261 |
|
| 262 |
#. commit 015bb305b8ebe8d601a238ab70ebdc394c7a19ba |
| 263 |
#. type: Plain text |
| 264 |
#: mageia-cauldron |
| 265 |
msgid "" |
| 266 |
"The B<NS_GET_OWNER_UID> operation (available since Linux 4.11) can be used " |
| 267 |
"to discover the owner user ID of a user namespace (i.e., the effective user " |
| 268 |
"ID of the process that created the user namespace). The form of the call is:" |
| 269 |
msgstr "" |
| 270 |
"Операция B<NS_GET_OWNER_UID> (доступна, начиная с Linux 4.11) позволяет " |
| 271 |
"определять пользовательский ID владельца пространства имён пользователя (т. " |
| 272 |
"е., эффективный пользовательский ID процесса, который создал пространство " |
| 273 |
"имён пользователя). Формат вызова:" |
| 274 |
|
| 275 |
#. type: Plain text |
| 276 |
#: mageia-cauldron |
| 277 |
#, no-wrap |
| 278 |
msgid "" |
| 279 |
"uid_t uid;\n" |
| 280 |
"ioctl(fd, NS_GET_OWNER_UID, &uid);\n" |
| 281 |
msgstr "" |
| 282 |
"uid_t uid;\n" |
| 283 |
"ioctl(fd, NS_GET_OWNER_UID, &uid);\n" |
| 284 |
|
| 285 |
#. type: Plain text |
| 286 |
#: mageia-cauldron |
| 287 |
msgid "I<fd> refers to a I</proc/>pidI</ns/user> file." |
| 288 |
msgstr "Значение I<fd> ссылается на файл I</proc/>pidI</ns/user>." |
| 289 |
|
| 290 |
#. type: Plain text |
| 291 |
#: mageia-cauldron |
| 292 |
msgid "" |
| 293 |
"The owner user ID is returned in the I<uid_t> pointed to by the third " |
| 294 |
"argument." |
| 295 |
msgstr "" |
| 296 |
"Возвращаемый пользовательский ID владельца находится в третьем аргументе с " |
| 297 |
"типом I<uid_t>." |
| 298 |
|
| 299 |
#. type: Plain text |
| 300 |
#: mageia-cauldron |
| 301 |
msgid "This operation can fail with the following error:" |
| 302 |
msgstr "Данная операция может завершиться со следующей ошибкой:" |
| 303 |
|
| 304 |
#. type: Plain text |
| 305 |
#: mageia-cauldron |
| 306 |
msgid "I<fd> does not refer to a user namespace." |
| 307 |
msgstr "Значение I<fd> не ссылается на пространство имён пользователя." |
| 308 |
|
| 309 |
#. type: SH |
| 310 |
#: mageia-cauldron |
| 311 |
#, no-wrap |
| 312 |
msgid "ERRORS" |
| 313 |
msgstr "ОШИБКИ" |
| 314 |
|
| 315 |
#. type: Plain text |
| 316 |
#: mageia-cauldron |
| 317 |
msgid "" |
| 318 |
"Any of the above B<ioctl>() operations can return the following errors:" |
| 319 |
msgstr "" |
| 320 |
"Любая из этих операций B<ioctl>() может завершаться со следующими ошибками:" |
| 321 |
|
| 322 |
#. type: Plain text |
| 323 |
#: mageia-cauldron |
| 324 |
msgid "I<fd> does not refer to a I</proc/>pidI</ns/>* file." |
| 325 |
msgstr "I<fd> не ссылается на файл I</proc/>pidI</ns/>*." |
| 326 |
|
| 327 |
#. type: SH |
| 328 |
#: mageia-cauldron |
| 329 |
#, no-wrap |
| 330 |
msgid "STANDARDS" |
| 331 |
msgstr "СТАНДАРТЫ" |
| 332 |
|
| 333 |
#. type: Plain text |
| 334 |
#: mageia-cauldron |
| 335 |
msgid "Linux." |
| 336 |
msgstr "Linux." |
| 337 |
|
| 338 |
#. type: SH |
| 339 |
#: mageia-cauldron |
| 340 |
#, no-wrap |
| 341 |
msgid "EXAMPLES" |
| 342 |
msgstr "ПРИМЕРЫ" |
| 343 |
|
| 344 |
#. type: Plain text |
| 345 |
#: mageia-cauldron |
| 346 |
msgid "" |
| 347 |
"The example shown below uses the B<ioctl>(2) operations described above to " |
| 348 |
"perform simple discovery of namespace relationships. The following shell " |
| 349 |
"sessions show various examples of the use of this program." |
| 350 |
msgstr "" |
| 351 |
"В примере, показанном ниже, используются описанные выше операции " |
| 352 |
"B<ioctl>(2), с помощью которых определяются отношения между пространствами " |
| 353 |
"имён. Далее показаны сценарии запуска этой программы." |
| 354 |
|
| 355 |
#. type: Plain text |
| 356 |
#: mageia-cauldron |
| 357 |
msgid "" |
| 358 |
"Trying to get the parent of the initial user namespace fails, since it has " |
| 359 |
"no parent:" |
| 360 |
msgstr "" |
| 361 |
"Попытка определить родителя изначального пространства имён пользователя " |
| 362 |
"завершается ошибкой, так как родителя нет:" |
| 363 |
|
| 364 |
#. type: Plain text |
| 365 |
#: mageia-cauldron |
| 366 |
#, no-wrap |
| 367 |
msgid "" |
| 368 |
"$ B<./ns_show /proc/self/ns/user p>\n" |
| 369 |
"The parent namespace is outside your namespace scope\n" |
| 370 |
msgstr "" |
| 371 |
"$ B<./ns_show /proc/self/ns/user p>\n" |
| 372 |
"Родительское пространство имён находится вне области вашего пространства имён\n" |
| 373 |
|
| 374 |
#. type: Plain text |
| 375 |
#: mageia-cauldron |
| 376 |
msgid "" |
| 377 |
"Create a process running B<sleep>(1) that resides in new user and UTS " |
| 378 |
"namespaces, and show that the new UTS namespace is associated with the new " |
| 379 |
"user namespace:" |
| 380 |
msgstr "" |
| 381 |
"Создаётся процесс, выполняющий B<sleep>(1), который располагается в новом " |
| 382 |
"пространстве имён пользователя и UTS, и показывается, что новое пространство " |
| 383 |
"имён UTS связано с новым пространством имён пользователя:" |
| 384 |
|
| 385 |
#. type: Plain text |
| 386 |
#: mageia-cauldron |
| 387 |
#, no-wrap |
| 388 |
msgid "" |
| 389 |
"$ B<unshare -Uu sleep 1000 &>\n" |
| 390 |
"[1] 23235\n" |
| 391 |
"$ B<./ns_show /proc/23235/ns/uts u>\n" |
| 392 |
"Device/Inode of owning user namespace is: [0,3] / 4026532448\n" |
| 393 |
"$ B<readlink /proc/23235/ns/user>\n" |
| 394 |
"user:[4026532448]\n" |
| 395 |
msgstr "" |
| 396 |
"$ B<unshare -Uu sleep 1000 &>\n" |
| 397 |
"[1] 23235\n" |
| 398 |
"$ B<./ns_show /proc/23235/ns/uts u>\n" |
| 399 |
"Устройство/инода, владеющая пространством имён пользователя: [0,3] / 4026532448\n" |
| 400 |
"$ B<readlink /proc/23235/ns/user>\n" |
| 401 |
"user:[4026532448]\n" |
| 402 |
|
| 403 |
#. type: Plain text |
| 404 |
#: mageia-cauldron |
| 405 |
msgid "" |
| 406 |
"Then show that the parent of the new user namespace in the preceding example " |
| 407 |
"is the initial user namespace:" |
| 408 |
msgstr "" |
| 409 |
"Теперь покажем, что родителем нового пространства имён пользователя из " |
| 410 |
"предыдущего примера является начальное пространство имён пользователя:" |
| 411 |
|
| 412 |
#. type: Plain text |
| 413 |
#: mageia-cauldron |
| 414 |
#, no-wrap |
| 415 |
msgid "" |
| 416 |
"$ B<readlink /proc/self/ns/user>\n" |
| 417 |
"user:[4026531837]\n" |
| 418 |
"$ B<./ns_show /proc/23235/ns/user p>\n" |
| 419 |
"Device/Inode of parent namespace is: [0,3] / 4026531837\n" |
| 420 |
msgstr "" |
| 421 |
"$ B<readlink /proc/self/ns/user>\n" |
| 422 |
"user:[4026531837]\n" |
| 423 |
"$ B<./ns_show /proc/23235/ns/user p>\n" |
| 424 |
"Устройство/инода родительского пространства имён: [0,3] / 4026531837\n" |
| 425 |
|
| 426 |
#. type: Plain text |
| 427 |
#: mageia-cauldron |
| 428 |
msgid "" |
| 429 |
"Start a shell in a new user namespace, and show that from within this shell, " |
| 430 |
"the parent user namespace can't be discovered. Similarly, the UTS namespace " |
| 431 |
"(which is associated with the initial user namespace) can't be discovered." |
| 432 |
msgstr "" |
| 433 |
"Запустим оболочку в новом пространстве имён пользователя и покажем, что " |
| 434 |
"внутри оболочки родительское пространство имён пользователя невозможно " |
| 435 |
"определить. Также невозможно определить пространство имён UTS (которое " |
| 436 |
"связано с изначальным пространством имён пользователя)." |
| 437 |
|
| 438 |
#. type: Plain text |
| 439 |
#: mageia-cauldron |
| 440 |
#, no-wrap |
| 441 |
msgid "" |
| 442 |
"$ B<PS1=\"sh2$ \" unshare -U bash>\n" |
| 443 |
"sh2$ B<./ns_show /proc/self/ns/user p>\n" |
| 444 |
"The parent namespace is outside your namespace scope\n" |
| 445 |
"sh2$ B<./ns_show /proc/self/ns/uts u>\n" |
| 446 |
"The owning user namespace is outside your namespace scope\n" |
| 447 |
msgstr "" |
| 448 |
"$ B<PS1=\"sh2$ \" unshare -U bash>\n" |
| 449 |
"sh2$ B<./ns_show /proc/self/ns/user p>\n" |
| 450 |
"Родительское пространство имён находится вне области вашего пространства имён\n" |
| 451 |
"sh2$ B<./ns_show /proc/self/ns/uts u>\n" |
| 452 |
"Владеющее пространство имён пользователя находится вне области вашего пространства имён\n" |
| 453 |
|
| 454 |
#. type: SS |
| 455 |
#: mageia-cauldron |
| 456 |
#, no-wrap |
| 457 |
msgid "Program source" |
| 458 |
msgstr "Исходный код программы" |
| 459 |
|
| 460 |
#. type: Plain text |
| 461 |
#: mageia-cauldron |
| 462 |
#, no-wrap |
| 463 |
msgid "" |
| 464 |
"/* ns_show.c\n" |
| 465 |
"\\&\n" |
| 466 |
" Licensed under the GNU General Public License v2 or later.\n" |
| 467 |
"*/\n" |
| 468 |
"#include E<lt>errno.hE<gt>\n" |
| 469 |
"#include E<lt>fcntl.hE<gt>\n" |
| 470 |
"#include E<lt>linux/nsfs.hE<gt>\n" |
| 471 |
"#include E<lt>stdint.hE<gt>\n" |
| 472 |
"#include E<lt>stdio.hE<gt>\n" |
| 473 |
"#include E<lt>stdlib.hE<gt>\n" |
| 474 |
"#include E<lt>string.hE<gt>\n" |
| 475 |
"#include E<lt>sys/ioctl.hE<gt>\n" |
| 476 |
"#include E<lt>sys/stat.hE<gt>\n" |
| 477 |
"#include E<lt>sys/sysmacros.hE<gt>\n" |
| 478 |
"#include E<lt>unistd.hE<gt>\n" |
| 479 |
"\\&\n" |
| 480 |
"int\n" |
| 481 |
"main(int argc, char *argv[])\n" |
| 482 |
"{\n" |
| 483 |
" int fd, userns_fd, parent_fd;\n" |
| 484 |
" struct stat sb;\n" |
| 485 |
"\\&\n" |
| 486 |
" if (argc E<lt> 2) {\n" |
| 487 |
" fprintf(stderr, \"Usage: %s /proc/[pid]/ns/[file] [p|u]\\en\",\n" |
| 488 |
" argv[0]);\n" |
| 489 |
" fprintf(stderr, \"\\enDisplay the result of one or both \"\n" |
| 490 |
" \"of NS_GET_USERNS (u) or NS_GET_PARENT (p)\\en\"\n" |
| 491 |
" \"for the specified /proc/[pid]/ns/[file]. If neither \"\n" |
| 492 |
" \"\\[aq]p\\[aq] nor \\[aq]u\\[aq] is specified,\\en\"\n" |
| 493 |
" \"NS_GET_USERNS is the default.\\en\");\n" |
| 494 |
" exit(EXIT_FAILURE);\n" |
| 495 |
" }\n" |
| 496 |
"\\&\n" |
| 497 |
" /* Obtain a file descriptor for the \\[aq]ns\\[aq] file specified\n" |
| 498 |
" in argv[1]. */\n" |
| 499 |
"\\&\n" |
| 500 |
" fd = open(argv[1], O_RDONLY);\n" |
| 501 |
" if (fd == -1) {\n" |
| 502 |
" perror(\"open\");\n" |
| 503 |
" exit(EXIT_FAILURE);\n" |
| 504 |
" }\n" |
| 505 |
"\\&\n" |
| 506 |
" /* Obtain a file descriptor for the owning user namespace and\n" |
| 507 |
" then obtain and display the inode number of that namespace. */\n" |
| 508 |
"\\&\n" |
| 509 |
" if (argc E<lt> 3 || strchr(argv[2], \\[aq]u\\[aq])) {\n" |
| 510 |
" userns_fd = ioctl(fd, NS_GET_USERNS);\n" |
| 511 |
"\\&\n" |
| 512 |
" if (userns_fd == -1) {\n" |
| 513 |
" if (errno == EPERM)\n" |
| 514 |
" printf(\"The owning user namespace is outside \"\n" |
| 515 |
" \"your namespace scope\\en\");\n" |
| 516 |
" else\n" |
| 517 |
" perror(\"ioctl-NS_GET_USERNS\");\n" |
| 518 |
" exit(EXIT_FAILURE);\n" |
| 519 |
" }\n" |
| 520 |
"\\&\n" |
| 521 |
" if (fstat(userns_fd, &sb) == -1) {\n" |
| 522 |
" perror(\"fstat-userns\");\n" |
| 523 |
" exit(EXIT_FAILURE);\n" |
| 524 |
" }\n" |
| 525 |
" printf(\"Device/Inode of owning user namespace is: \"\n" |
| 526 |
" \"[%x,%x] / %ju\\en\",\n" |
| 527 |
" major(sb.st_dev),\n" |
| 528 |
" minor(sb.st_dev),\n" |
| 529 |
" (uintmax_t) sb.st_ino);\n" |
| 530 |
"\\&\n" |
| 531 |
" close(userns_fd);\n" |
| 532 |
" }\n" |
| 533 |
"\\&\n" |
| 534 |
" /* Obtain a file descriptor for the parent namespace and\n" |
| 535 |
" then obtain and display the inode number of that namespace. */\n" |
| 536 |
"\\&\n" |
| 537 |
" if (argc E<gt> 2 && strchr(argv[2], \\[aq]p\\[aq])) {\n" |
| 538 |
" parent_fd = ioctl(fd, NS_GET_PARENT);\n" |
| 539 |
"\\&\n" |
| 540 |
" if (parent_fd == -1) {\n" |
| 541 |
" if (errno == EINVAL)\n" |
| 542 |
" printf(\"Can\\[aq] get parent namespace of a \"\n" |
| 543 |
" \"nonhierarchical namespace\\en\");\n" |
| 544 |
" else if (errno == EPERM)\n" |
| 545 |
" printf(\"The parent namespace is outside \"\n" |
| 546 |
" \"your namespace scope\\en\");\n" |
| 547 |
" else\n" |
| 548 |
" perror(\"ioctl-NS_GET_PARENT\");\n" |
| 549 |
" exit(EXIT_FAILURE);\n" |
| 550 |
" }\n" |
| 551 |
"\\&\n" |
| 552 |
" if (fstat(parent_fd, &sb) == -1) {\n" |
| 553 |
" perror(\"fstat-parentns\");\n" |
| 554 |
" exit(EXIT_FAILURE);\n" |
| 555 |
" }\n" |
| 556 |
" printf(\"Device/Inode of parent namespace is: [%x,%x] / %ju\\en\",\n" |
| 557 |
" major(sb.st_dev),\n" |
| 558 |
" minor(sb.st_dev),\n" |
| 559 |
" (uintmax_t) sb.st_ino);\n" |
| 560 |
"\\&\n" |
| 561 |
" close(parent_fd);\n" |
| 562 |
" }\n" |
| 563 |
"\\&\n" |
| 564 |
" exit(EXIT_SUCCESS);\n" |
| 565 |
"}\n" |
| 566 |
msgstr "" |
| 567 |
|
| 568 |
#. SRC END |
| 569 |
#. type: SH |
| 570 |
#: mageia-cauldron |
| 571 |
#, no-wrap |
| 572 |
msgid "SEE ALSO" |
| 573 |
msgstr "СМОТРИТЕ ТАКЖЕ" |
| 574 |
|
| 575 |
#. type: Plain text |
| 576 |
#: mageia-cauldron |
| 577 |
msgid "B<fstat>(2), B<ioctl>(2), B<proc>(5), B<namespaces>(7)" |
| 578 |
msgstr "B<fstat>(2), B<ioctl>(2), B<proc>(5), B<namespaces>(7)" |