Units
Translation components API.
See the Weblate's Web API documentation for detailed description of the API.
GET /api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/units/?format=api&page=9
https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/units/?format=api&page=10", "previous": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/units/?format=api&page=8", "results": [ { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Other complete examples:" ], "previous_source": "", "target": [ "其它完整的例子:" ], "id_hash": -6622678238524672837, "content_hash": -6622678238524672837, "location": "book.translate.xml:3195", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 412, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/102554/?format=api", "priority": 100, "id": 34432, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=2417853b0306f4bb", "url": "https://translate-dev.freebsd.org/api/units/34432/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.624502Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "src/sys/kern/bus_if.m\nsrc/sys/kern/device_if.m" ], "previous_source": "", "target": [ "src/sys/kern/bus_if.m\nsrc/sys/kern/device_if.m" ], "id_hash": 3793159847201672144, "content_hash": 3793159847201672144, "location": "book.translate.xml:3197", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 413, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/102555/?format=api", "priority": 100, "id": 34434, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=b4a402c8b4bb0bd0", "url": "https://translate-dev.freebsd.org/api/units/34434/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.641093Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Creating a Class" ], "previous_source": "", "target": [ "创建类" ], "id_hash": -5455273803332987329, "content_hash": -5455273803332987329, "location": "book.translate.xml:3203", "context": "", "note": "(itstool) path: sect2/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 414, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/102556/?format=api", "priority": 100, "id": 34435, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=344af9610fd7d63f", "url": "https://translate-dev.freebsd.org/api/units/34435/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.668771Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>Kernel Objects</primary> <secondary>class</secondary>" ], "previous_source": "", "target": [ "<primary>Kernel Objects(内核对象)</primary><secondary>class(类)</secondary>" ], "id_hash": 4130176317312210352, "content_hash": 4130176317312210352, "location": "book.translate.xml:3205", "context": "", "note": "(itstool) path: sect2/indexterm", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 415, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/102557/?format=api", "priority": 100, "id": 34437, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=b951557a5d2015b0", "url": "https://translate-dev.freebsd.org/api/units/34437/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.679950Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The second step in using Kobj is to create a class. A class consists of a name, a table of methods, and the size of objects if Kobj's object handling facilities are used. To create the class use the macro <function>DEFINE_CLASS()</function>. To create the method table create an array of kobj_method_t terminated by a NULL entry. Each non-NULL entry may be created using the macro <function>KOBJMETHOD()</function>." ], "previous_source": "", "target": [ "使用Kobj的第二步是建立一个类。一个类的组有名字、方法表;假如使用了Kobj的“对象管理工具”(Object Handling Facilities),类中还包含对象的大小。建立类时使用宏<function>DEFINE_CLASS()</function>。建立方法表时,须建立一个 kobj_method_t 数组,用NULL项结尾。每个非 NULL 项可用宏<function>KOBJMETHOD()</function>建立。" ], "id_hash": 3058091914307000771, "content_hash": 3058091914307000771, "location": "book.translate.xml:3208", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 416, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 66, "source_unit": "https://translate-dev.freebsd.org/api/units/102558/?format=api", "priority": 100, "id": 34438, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=aa708664c2c359c3", "url": "https://translate-dev.freebsd.org/api/units/34438/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.689730Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "DEFINE_CLASS(fooclass, foomethods, sizeof(struct foodata));\n\nkobj_method_t foomethods[] = {\n\tKOBJMETHOD(bar_doo, foo_doo),\n\tKOBJMETHOD(bar_foo, foo_foo),\n\t{ NULL, NULL}\n};" ], "previous_source": "", "target": [ "DEFINE_CLASS(fooclass, foomethods, sizeof(struct foodata));\n\nkobj_method_t foomethods[] = {\n\tKOBJMETHOD(bar_doo, foo_doo),\n\tKOBJMETHOD(bar_foo, foo_foo),\n\t{ NULL, NULL}\n};" ], "id_hash": -3940042235749537554, "content_hash": -3940042235749537554, "location": "book.translate.xml:3219", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 417, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 16, "source_unit": "https://translate-dev.freebsd.org/api/units/102559/?format=api", "priority": 100, "id": 34440, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=495228763a1ce8ee", "url": "https://translate-dev.freebsd.org/api/units/34440/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.700761Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The class must be <quote>compiled</quote>. Depending on the state of the system at the time that the class is to be initialized a statically allocated cache, <quote>ops table</quote> have to be used. This can be accomplished by declaring a <varname remap=\"structname\">struct kobj_ops</varname> and using <function>kobj_class_compile_static();</function> otherwise, <function>kobj_class_compile()</function> should be used." ], "previous_source": "", "target": [ "类须被<quote>编译</quote>。根据该类被初始化时系统的状态,将要用到一个静态分配的缓存和<quote>操作数表</quote>(ops table,译者注:即<quote>参数表</quote>)。这些操作可通过声明一个结构体<varname remap=\"structname\">struct kobj_ops</varname>并使用<function>kobj_class_compile_static()</function>,或是只使用<function>kobj_class_compile()</function>来完成。" ], "id_hash": 7880355975909726741, "content_hash": 7880355975909726741, "location": "book.translate.xml:3227", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 418, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 50, "source_unit": "https://translate-dev.freebsd.org/api/units/102560/?format=api", "priority": 100, "id": 34441, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=ed5ca60217b9da15", "url": "https://translate-dev.freebsd.org/api/units/34441/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.712182Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Creating an Object" ], "previous_source": "", "target": [ "建立一个对象" ], "id_hash": -4717214818264919336, "content_hash": -4717214818264919336, "location": "book.translate.xml:3237", "context": "", "note": "(itstool) path: sect2/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 419, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/102561/?format=api", "priority": 100, "id": 34443, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=3e89161d9c1c52d8", "url": "https://translate-dev.freebsd.org/api/units/34443/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.720757Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>Kernel Objects</primary> <secondary>object</secondary>" ], "previous_source": "", "target": [ "<primary>Kernel Objects(内核对象)</primary><secondary>object(对象)</secondary>" ], "id_hash": 4270129562200699310, "content_hash": 4270129562200699310, "location": "book.translate.xml:3239", "context": "", "note": "(itstool) path: sect2/indexterm", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 420, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/102562/?format=api", "priority": 100, "id": 34444, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=bb428c3673ddf1ae", "url": "https://translate-dev.freebsd.org/api/units/34444/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.739617Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The third step in using Kobj involves how to define the object. Kobj object creation routines assume that Kobj data is at the head of an object. If this in not appropriate you will have to allocate the object yourself and then use <function>kobj_init()</function> on the Kobj portion of it; otherwise, you may use <function>kobj_create()</function> to allocate and initialize the Kobj portion of the object automatically. <function>kobj_init()</function> may also be used to change the class that an object uses." ], "previous_source": "", "target": [ "使用Kobj的第三步是定义对象。Kobj对象建立程序假定Kobj专有数据在一个对象的头部。如果不是如此,应当先自行分配对象,再使用<function>kobj_init()</function>初始化对象中的Kobj专有数据;其实可以使用<function>kobj_create()</function>分配对象,并自动初始化对象中的Kobj专有内容。<function>kobj_init()</function>也可以用来改变一个对象所使用的类。" ], "id_hash": -359920337783909428, "content_hash": -359920337783909428, "location": "book.translate.xml:3242", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 421, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 79, "source_unit": "https://translate-dev.freebsd.org/api/units/102563/?format=api", "priority": 100, "id": 34446, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=7b014e5c16f393cc", "url": "https://translate-dev.freebsd.org/api/units/34446/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.751688Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "To integrate Kobj into the object you should use the macro KOBJ_FIELDS." ], "previous_source": "", "target": [ "将Kobj的数据集成到对象中要使用宏KOBJ_FIELDS。" ], "id_hash": 7402991996235972289, "content_hash": 7402991996235972289, "location": "book.translate.xml:3252", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 422, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 12, "source_unit": "https://translate-dev.freebsd.org/api/units/102564/?format=api", "priority": 100, "id": 34447, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=e6bcb5ff72b47ec1", "url": "https://translate-dev.freebsd.org/api/units/34447/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.764376Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "For example" ], "previous_source": "", "target": [ "例如" ], "id_hash": 1643455197748221666, "content_hash": 1643455197748221666, "location": "book.translate.xml:3255", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 423, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/102565/?format=api", "priority": 100, "id": 34451, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=96ceb9cb820d56e2", "url": "https://translate-dev.freebsd.org/api/units/34451/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.777272Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "struct foo_data {\n\tKOBJ_FIELDS;\n\tfoo_foo;\n\tfoo_bar;\n};" ], "previous_source": "", "target": [ "struct foo_data {\n\tKOBJ_FIELDS;\n\tfoo_foo;\n\tfoo_bar;\n};" ], "id_hash": 5219871101550747957, "content_hash": 5219871101550747957, "location": "book.translate.xml:3257", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 424, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 7, "source_unit": "https://translate-dev.freebsd.org/api/units/102566/?format=api", "priority": 100, "id": 34453, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=c870b51c5d426135", "url": "https://translate-dev.freebsd.org/api/units/34453/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.789768Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Calling Methods" ], "previous_source": "", "target": [ "调用方法" ], "id_hash": 6194391586393487417, "content_hash": 6194391586393487417, "location": "book.translate.xml:3265", "context": "", "note": "(itstool) path: sect2/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 425, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/102567/?format=api", "priority": 100, "id": 34455, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=d5f6e6541aa6f839", "url": "https://translate-dev.freebsd.org/api/units/34455/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.804427Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The last step in using Kobj is to simply use the generated functions to use the desired method within the object's class. This is as simple as using the interface name and the method name with a few modifications. The interface name should be concatenated with the method name using a '_' between them, all in upper case." ], "previous_source": "", "target": [ "使用Kobj的最后一部就是通过生成的函数调用对象类中的方法。调用时,接口名与方法名用'_'接合,而且全部使用大写字母。" ], "id_hash": 5569807131842101545, "content_hash": 5569807131842101545, "location": "book.translate.xml:3267", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 426, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 58, "source_unit": "https://translate-dev.freebsd.org/api/units/102568/?format=api", "priority": 100, "id": 34457, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=cd4bee1388e2c129", "url": "https://translate-dev.freebsd.org/api/units/34457/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.812764Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "For example, if the interface name was foo and the method was bar then the call would be:" ], "previous_source": "", "target": [ "例如,接口名为foo,方法为bar,调用就是:" ], "id_hash": 5973979556528971766, "content_hash": 5973979556528971766, "location": "book.translate.xml:3274", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 427, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 18, "source_unit": "https://translate-dev.freebsd.org/api/units/102569/?format=api", "priority": 100, "id": 34458, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=d2e7d6c1525adff6", "url": "https://translate-dev.freebsd.org/api/units/34458/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.824809Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "[return value = ] FOO_BAR(object [, other parameters]);" ], "previous_source": "", "target": [ "[返回值 = ] FOO_BAR(对象 [, 其它参数]);" ], "id_hash": -6389109687027059680, "content_hash": -6389109687027059680, "location": "book.translate.xml:3277", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 428, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 8, "source_unit": "https://translate-dev.freebsd.org/api/units/102570/?format=api", "priority": 100, "id": 34459, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=2755529731beb420", "url": "https://translate-dev.freebsd.org/api/units/34459/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.835115Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Cleaning Up" ], "previous_source": "", "target": [ "善后处理" ], "id_hash": -3859188218174712969, "content_hash": -3859188218174712969, "location": "book.translate.xml:3282", "context": "", "note": "(itstool) path: sect2/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 429, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/102571/?format=api", "priority": 100, "id": 34461, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=4a7168c32e52d377", "url": "https://translate-dev.freebsd.org/api/units/34461/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.858475Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "When an object allocated through <function>kobj_create()</function> is no longer needed <function>kobj_delete()</function> may be called on it, and when a class is no longer being used <function>kobj_class_free()</function> may be called on it." ], "previous_source": "", "target": [ "当一个用<function>kobj_create()</function>不再需要被使用时,可对这个对象调用<function>kobj_delete()</function>。当一个类不再需要被使用时,可对这个类调用<function>kobj_class_free()</function>。" ], "id_hash": 2043784135686009798, "content_hash": 2043784135686009798, "location": "book.translate.xml:3284", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 430, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 31, "source_unit": "https://translate-dev.freebsd.org/api/units/102572/?format=api", "priority": 100, "id": 34462, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=9c5cfad7cd24b3c6", "url": "https://translate-dev.freebsd.org/api/units/34462/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.867855Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The Jail Subsystem" ], "previous_source": "", "target": [ "Jail子系统" ], "id_hash": 6463077580901437616, "content_hash": 6463077580901437616, "location": "book.translate.xml:3301", "context": "", "note": "(itstool) path: info/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 431, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/102573/?format=api", "priority": 100, "id": 34464, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=d9b176d1256bd0b0", "url": "https://translate-dev.freebsd.org/api/units/34464/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.873773Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "\n\t <email>evms@cs.bu.edu</email>\n\t" ], "previous_source": "", "target": [ "\n\t <email>evms@cs.bu.edu</email>\n\t" ], "id_hash": -4544087666501180193, "content_hash": -4544087666501180193, "location": "book.translate.xml:3309", "context": "", "note": "(itstool) path: affiliation/address", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 432, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102574/?format=api", "priority": 100, "id": 34465, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=40f02857c9f6a4df", "url": "https://translate-dev.freebsd.org/api/units/34465/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.886037Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<personname> <firstname>Evan</firstname> <surname>Sarmiento</surname> </personname> <affiliation> <_:address-1/> </affiliation>" ], "previous_source": "", "target": [ "<personname> <firstname>Evan</firstname> <surname>Sarmiento</surname> </personname> <affiliation> <_:address-1/> </affiliation>" ], "id_hash": 5881637593851716778, "content_hash": 5881637593851716778, "location": "book.translate.xml:3303", "context": "", "note": "(itstool) path: info/author", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 433, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 7, "source_unit": "https://translate-dev.freebsd.org/api/units/102575/?format=api", "priority": 100, "id": 34467, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=d19fc63ab71d64aa", "url": "https://translate-dev.freebsd.org/api/units/34467/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.892645Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<year>2001</year> <holder role=\"mailto:evms@cs.bu.edu\">Evan Sarmiento</holder>" ], "previous_source": "", "target": [ "<year>2001</year> <holder role=\"mailto:evms@cs.bu.edu\">Evan Sarmiento</holder>" ], "id_hash": -7032217922836158686, "content_hash": -7032217922836158686, "location": "book.translate.xml:3314", "context": "", "note": "(itstool) path: info/copyright", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 434, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 4, "source_unit": "https://translate-dev.freebsd.org/api/units/102576/?format=api", "priority": 100, "id": 34469, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=1e688b0eb6372722", "url": "https://translate-dev.freebsd.org/api/units/34469/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.904655Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>security</primary>" ], "previous_source": "", "target": [ "<primary>安全</primary>" ], "id_hash": 8410621740997475201, "content_hash": 8410621740997475201, "location": "book.translate.xml:3320", "context": "", "note": "(itstool) path: chapter/indexterm", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 435, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102577/?format=api", "priority": 100, "id": 34470, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=f4b887e97c54fb81", "url": "https://translate-dev.freebsd.org/api/units/34470/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.913674Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>Jail</primary>" ], "previous_source": "", "target": [ "<primary>Jail</primary>" ], "id_hash": -8205469939170179389, "content_hash": -8205469939170179389, "location": "book.translate.xml:3321, book.translate.xml:15468", "context": "", "note": "(itstool) path: chapter/indexterm\n(itstool) path: sect2/indexterm", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 436, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102578/?format=api", "priority": 100, "id": 34472, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=0e205090949d86c3", "url": "https://translate-dev.freebsd.org/api/units/34472/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.921653Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>root</primary>" ], "previous_source": "", "target": [ "<primary>root</primary>" ], "id_hash": -5856119553024413130, "content_hash": -5856119553024413130, "location": "book.translate.xml:3322", "context": "", "note": "(itstool) path: chapter/indexterm", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 437, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102579/?format=api", "priority": 100, "id": 34474, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=2ebae24b27c2b236", "url": "https://translate-dev.freebsd.org/api/units/34474/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.929110Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "On most <trademark class=\"registered\">UNIX</trademark> systems, <literal>root</literal> has omnipotent power. This promotes insecurity. If an attacker gained <literal>root</literal> on a system, he would have every function at his fingertips. In FreeBSD there are sysctls which dilute the power of <literal>root</literal>, in order to minimize the damage caused by an attacker. Specifically, one of these functions is called <literal>secure levels</literal>. Similarly, another function which is present from FreeBSD 4.0 and onward, is a utility called <citerefentry><refentrytitle>jail</refentrytitle><manvolnum>8</manvolnum></citerefentry>. <application>Jail</application> chroots an environment and sets certain restrictions on processes which are forked within the <application>jail</application>. For example, a jailed process cannot affect processes outside the <application>jail</application>, utilize certain system calls, or inflict any damage on the host environment." ], "previous_source": "", "target": [ "在大多数<trademark class=\"registered\">UNIX</trademark> 系统中,用户<literal>root</literal>是万能的。这也就增加了许多危险。如果一个攻击者获得了一个系统中的<literal>root</literal>,就可以在他的指尖掌握系统中所有的功能。在FreeBSD里,有一些sysctl项削弱了<literal>root</literal>的权限,这样就可以将攻击者造成的损害减小到最低限度。这些安全功能中,有一种叫安全级别。另一种在FreeBSD 4.0及以后版本中提供的安全功能,就是 <citerefentry><refentrytitle>jail</refentrytitle><manvolnum>8</manvolnum></citerefentry>。<application>Jail</application>将一个运行环境的文件树根切换到某一特定位置,并且对这样环境中叉分生成的进程做出限制。例如,一个被监禁的进程不能影响这个<application>jail</application>之外的进程、不能使用一些特定的系统调用,也就不能对主计算机造成破坏。" ], "id_hash": -2154986652794604907, "content_hash": -2154986652794604907, "location": "book.translate.xml:3324", "context": "", "note": "(itstool) path: chapter/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 438, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 113, "source_unit": "https://translate-dev.freebsd.org/api/units/102580/?format=api", "priority": 100, "id": 34475, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=6217f30e90783295", "url": "https://translate-dev.freebsd.org/api/units/34475/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.942563Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<application>Jail</application> is becoming the new security model. People are running potentially vulnerable servers such as <application>Apache</application>, <application>BIND</application>, and <application>sendmail</application> within jails, so that if an attacker gains <literal>root</literal> within the <application>jail</application>, it is only an annoyance, and not a devastation. This article mainly focuses on the internals (source code) of <application>jail</application>. For information on how to set up a jail see the <link xlink:href=\"@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/jails.html\">handbook entry on jails</link>." ], "previous_source": "", "target": [ "<application>Jail</application>已经成为一种新型的安全模型。人们可以在jail中运行各种可能很脆弱的服务器程序,如<application>Apache</application>、<application>BIND</application>和<application>sendmail</application>。这样一来,即使有攻击者取得了<application>jail</application>中的<literal>root</literal>,这最多让人们皱皱眉头,而不会使人们惊慌失措。本文主要关注<application>jail</application>的内部原理(源代码)。如果你正在寻找设置<application>Jail</application>的指南性文档,我建议你阅读我的另一篇文章,发表在Sys Admin Magazine, May 2001,《Securing FreeBSD using <application>Jail</application>》。" ], "id_hash": 8764143216943867272, "content_hash": 8764143216943867272, "location": "book.translate.xml:3339", "context": "", "note": "(itstool) path: chapter/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 439, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 67, "source_unit": "https://translate-dev.freebsd.org/api/units/102581/?format=api", "priority": 100, "id": 34477, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=f9a07dd24696a588", "url": "https://translate-dev.freebsd.org/api/units/34477/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.949262Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Architecture" ], "previous_source": "", "target": [ "Jail的系统结构" ], "id_hash": -3937639386123481026, "content_hash": -3937639386123481026, "location": "book.translate.xml:3352", "context": "", "note": "(itstool) path: sect1/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 440, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102582/?format=api", "priority": 100, "id": 34479, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=495ab1d74085d03e", "url": "https://translate-dev.freebsd.org/api/units/34479/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.957503Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<application>Jail</application> consists of two realms: the userland program, <citerefentry><refentrytitle>jail</refentrytitle><manvolnum>8</manvolnum></citerefentry>, and the code implemented within the kernel: the <citerefentry><refentrytitle>jail</refentrytitle><manvolnum>2</manvolnum></citerefentry> system call and associated restrictions. I will be discussing the userland program and then how <application>jail</application> is implemented within the kernel." ], "previous_source": "", "target": [ "<application>Jail</application>由两部分组成:用户级程序,也就是<citerefentry><refentrytitle>jail</refentrytitle><manvolnum>8</manvolnum></citerefentry>;还有在内核中Jail的实现代码:<citerefentry><refentrytitle>jail</refentrytitle><manvolnum>2</manvolnum></citerefentry> 系统调用和相关的约束。我将讨论用户级程序和<application>jail</application>在内核中的实现原理。" ], "id_hash": -5578798369359647987, "content_hash": -5578798369359647987, "location": "book.translate.xml:3354", "context": "", "note": "(itstool) path: sect1/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 441, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 39, "source_unit": "https://translate-dev.freebsd.org/api/units/102583/?format=api", "priority": 100, "id": 34480, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=32942070d8ca2b0d", "url": "https://translate-dev.freebsd.org/api/units/34480/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.964397Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Userland Code" ], "previous_source": "", "target": [ "用户级代码" ], "id_hash": -3407155355412333946, "content_hash": -3407155355412333946, "location": "book.translate.xml:3362", "context": "", "note": "(itstool) path: sect2/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 442, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/102584/?format=api", "priority": 100, "id": 34481, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=50b75a419213fa86", "url": "https://translate-dev.freebsd.org/api/units/34481/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.973725Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>Jail</primary> <secondary>Userland Program</secondary>" ], "previous_source": "", "target": [ "<primary>Jail</primary> <secondary>Userland Program(用户级程序)</secondary>" ], "id_hash": -7016269260929069833, "content_hash": -7016269260929069833, "location": "book.translate.xml:3364", "context": "", "note": "(itstool) path: sect2/indexterm", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 443, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/102585/?format=api", "priority": 100, "id": 34483, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=1ea13447edd48cf7", "url": "https://translate-dev.freebsd.org/api/units/34483/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.984810Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The source for the userland <application>jail</application> is located in <filename>/usr/src/usr.sbin/jail</filename>, consisting of one file, <filename>jail.c</filename>. The program takes these arguments: the path of the <application>jail</application>, hostname, IP address, and the command to be executed." ], "previous_source": "", "target": [ "<application>Jail</application>的用户级源代码在<filename>/usr/src/usr.sbin/jail</filename>,由一个文件<filename>jail.c</filename>组成。这个程序有这些参数:<application>jail</application>的路径,主机名,IP地址,还有需要执行的命令。" ], "id_hash": -4799075569099866266, "content_hash": -4799075569099866266, "location": "book.translate.xml:3367", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 444, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 34, "source_unit": "https://translate-dev.freebsd.org/api/units/102586/?format=api", "priority": 100, "id": 34484, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=3d6642324d8bff66", "url": "https://translate-dev.freebsd.org/api/units/34484/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:46.996140Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Data Structures" ], "previous_source": "", "target": [ "数据结构" ], "id_hash": 8778769654741155345, "content_hash": 8778769654741155345, "location": "book.translate.xml:3375", "context": "", "note": "(itstool) path: sect3/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 445, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/102587/?format=api", "priority": 100, "id": 34485, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=f9d4747d33d33e11", "url": "https://translate-dev.freebsd.org/api/units/34485/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.005353Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "In <filename>jail.c</filename>, the first thing I would note is the declaration of an important structure <literal>struct jail j;</literal> which was included from <filename>/usr/include/sys/jail.h</filename>." ], "previous_source": "", "target": [ "在<filename>jail.c</filename>中,我将最先注解的是一个重要结构体<literal>struct jail j;</literal>的声明,这个结构类型的声明包含在<filename>/usr/include/sys/jail.h</filename>之中。" ], "id_hash": -7694196780229956686, "content_hash": -7694196780229956686, "location": "book.translate.xml:3377", "context": "", "note": "(itstool) path: sect3/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 446, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 23, "source_unit": "https://translate-dev.freebsd.org/api/units/102588/?format=api", "priority": 100, "id": 34486, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=1538b8cb42706bb2", "url": "https://translate-dev.freebsd.org/api/units/34486/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.019735Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The definition of the <literal>jail</literal> structure is:" ], "previous_source": "", "target": [ "<literal>jail</literal>结构的定义是:" ], "id_hash": 3377484265034158817, "content_hash": 3377484265034158817, "location": "book.translate.xml:3382", "context": "", "note": "(itstool) path: sect3/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 447, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 7, "source_unit": "https://translate-dev.freebsd.org/api/units/102589/?format=api", "priority": 100, "id": 34488, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=aedf3c0b5bd512e1", "url": "https://translate-dev.freebsd.org/api/units/34488/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.026547Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>/usr/include/sys/jail.h</filename>:\n\nstruct jail {\n u_int32_t version;\n char *path;\n char *hostname;\n u_int32_t ip_number;\n};" ], "previous_source": "", "target": [ "<filename>/usr/include/sys/jail.h</filename>:\n\nstruct jail {\n u_int32_t version;\n char *path;\n char *hostname;\n u_int32_t ip_number;\n};" ], "id_hash": -4933925693614626374, "content_hash": -4933925693614626374, "location": "book.translate.xml:3385", "context": "", "note": "(itstool) path: sect3/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 448, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 13, "source_unit": "https://translate-dev.freebsd.org/api/units/102590/?format=api", "priority": 100, "id": 34489, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=3b872cb903ed69ba", "url": "https://translate-dev.freebsd.org/api/units/34489/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.034056Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "As you can see, there is an entry for each of the arguments passed to the <citerefentry><refentrytitle>jail</refentrytitle><manvolnum>8</manvolnum></citerefentry> program, and indeed, they are set during its execution." ], "previous_source": "", "target": [ "正如你所见,传送给命令<citerefentry><refentrytitle>jail</refentrytitle><manvolnum>8</manvolnum></citerefentry>的每个参数都在这里有对应的一项。事实上,当命令<citerefentry><refentrytitle>jail</refentrytitle><manvolnum>8</manvolnum></citerefentry>被执行时,这些参数才由命令行真正传入。" ], "id_hash": -4751418532080043436, "content_hash": -4751418532080043436, "location": "book.translate.xml:3394", "context": "", "note": "(itstool) path: sect3/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 449, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 26, "source_unit": "https://translate-dev.freebsd.org/api/units/102591/?format=api", "priority": 100, "id": 34490, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=3e0f9204e8293a54", "url": "https://translate-dev.freebsd.org/api/units/34490/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.051259Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>/usr/src/usr.sbin/jail/jail.c</filename>\nchar path[PATH_MAX];\n...\nif (realpath(argv[0], path) == NULL)\n err(1, \"realpath: %s\", argv[0]);\nif (chdir(path) != 0)\n err(1, \"chdir: %s\", path);\nmemset(&j, 0, sizeof(j));\nj.version = 0;\nj.path = path;\nj.hostname = argv[1];" ], "previous_source": "", "target": [ "<filename>/usr/src/usr.sbin/jail/jail.c</filename>\nchar path[PATH_MAX];\n...\nif (realpath(argv[0], path) == NULL)\n err(1, \"realpath: %s\", argv[0]);\nif (chdir(path) != 0)\n err(1, \"chdir: %s\", path);\nmemset(&j, 0, sizeof(j));\nj.version = 0;\nj.path = path;\nj.hostname = argv[1];" ], "id_hash": -3212624975225175641, "content_hash": -3212624975225175641, "location": "book.translate.xml:3398", "context": "", "note": "(itstool) path: sect3/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 450, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 33, "source_unit": "https://translate-dev.freebsd.org/api/units/102592/?format=api", "priority": 100, "id": 34492, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=536a769b3327c1a7", "url": "https://translate-dev.freebsd.org/api/units/34492/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.068083Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Networking" ], "previous_source": "", "target": [ "网络设置" ], "id_hash": 5971631064820480690, "content_hash": 5971631064820480690, "location": "book.translate.xml:3412", "context": "", "note": "(itstool) path: sect3/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 451, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/102593/?format=api", "priority": 100, "id": 34493, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=d2df7ed07c4ffab2", "url": "https://translate-dev.freebsd.org/api/units/34493/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.087419Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "One of the arguments passed to the <citerefentry><refentrytitle>jail</refentrytitle><manvolnum>8</manvolnum></citerefentry> program is an IP address with which the <application>jail</application> can be accessed over the network. <citerefentry><refentrytitle>jail</refentrytitle><manvolnum>8</manvolnum></citerefentry> translates the IP address given into host byte order and then stores it in <literal>j</literal> (the <literal>jail</literal> structure)." ], "previous_source": "", "target": [ ">传给<citerefentry><refentrytitle>jail</refentrytitle><manvolnum>8</manvolnum></citerefentry>的参数中有一个是IP地址。这是在网络上访问<application>jail</application>时的地址。<citerefentry><refentrytitle>jail</refentrytitle><manvolnum>8</manvolnum></citerefentry>将IP地址翻译成网络字节顺序,并存入<literal>j</literal>(<literal>jail</literal>类型的结构体)。" ], "id_hash": 6608150151279246592, "content_hash": 6608150151279246592, "location": "book.translate.xml:3414", "context": "", "note": "(itstool) path: sect3/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 452, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 42, "source_unit": "https://translate-dev.freebsd.org/api/units/102594/?format=api", "priority": 100, "id": 34494, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=dbb4dd8d15717d00", "url": "https://translate-dev.freebsd.org/api/units/34494/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.100600Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>/usr/src/usr.sbin/jail/jail.c</filename>:\nstruct in_addr in;\n...\nif (inet_aton(argv[2], &in) == 0)\n errx(1, \"Could not make sense of ip-number: %s\", argv[2]);\nj.ip_number = ntohl(in.s_addr);" ], "previous_source": "", "target": [ "<filename>/usr/src/usr.sbin/jail/jail.c</filename>:\nstruct in_addr in;\n...\nif (inet_aton(argv[2], &in) == 0)\n errx(1, \"Could not make sense of ip-number: %s\", argv[2]);\nj.ip_number = ntohl(in.s_addr);" ], "id_hash": -7555972769832254749, "content_hash": -7555972769832254749, "location": "book.translate.xml:3421", "context": "", "note": "(itstool) path: sect3/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 453, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 22, "source_unit": "https://translate-dev.freebsd.org/api/units/102595/?format=api", "priority": 100, "id": 34496, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=1723cacc919fc2e3", "url": "https://translate-dev.freebsd.org/api/units/34496/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.117104Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "The <citerefentry><refentrytitle>inet_aton</refentrytitle><manvolnum>3</manvolnum></citerefentry> function \"interprets the specified character string as an Internet address, placing the address into the structure provided.\" The <literal>ip_number</literal> member in the <literal>jail</literal> structure is set only when the IP address placed onto the <literal>in</literal> structure by <citerefentry><refentrytitle>inet_aton</refentrytitle><manvolnum>3</manvolnum></citerefentry> is translated into host byte order by <citerefentry><refentrytitle>ntohl</refentrytitle><manvolnum>3</manvolnum></citerefentry>." ], "previous_source": "", "target": [ ">函数<citerefentry><refentrytitle>inet_aton</refentrytitle><manvolnum>3</manvolnum></citerefentry>“将指定的字符串解释为一个Internet地址,并将其转存到指定的结构体中”。<citerefentry><refentrytitle>inet_aton</refentrytitle><manvolnum>3</manvolnum></citerefentry>设定了结构体in,之后in中的内容再用<citerefentry><refentrytitle>ntohl</refentrytitle><manvolnum>3</manvolnum></citerefentry>转换成主机字节顺序,并置入<literal>jail</literal>结构体的<literal>ip_number</literal>成员。" ], "id_hash": 7886639735985734843, "content_hash": 7886639735985734843, "location": "book.translate.xml:3428", "context": "", "note": "(itstool) path: sect3/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 454, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 48, "source_unit": "https://translate-dev.freebsd.org/api/units/102596/?format=api", "priority": 100, "id": 34497, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=ed72f90dfee904bb", "url": "https://translate-dev.freebsd.org/api/units/34497/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.133436Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Jailing the Process" ], "previous_source": "", "target": [ "囚禁进程" ], "id_hash": -808379272149399813, "content_hash": -808379272149399813, "location": "book.translate.xml:3439", "context": "", "note": "(itstool) path: sect3/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 455, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/102597/?format=api", "priority": 100, "id": 34499, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=74c80f55bfbf06fb", "url": "https://translate-dev.freebsd.org/api/units/34499/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.140356Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Finally, the userland program jails the process. <application>Jail</application> now becomes an imprisoned process itself and then executes the command given using <citerefentry><refentrytitle>execv</refentrytitle><manvolnum>3</manvolnum></citerefentry>." ], "previous_source": "", "target": [ "最后,用户级程序囚禁进程。现在Jail自身变成了一个被囚禁的进程,并使用<citerefentry><refentrytitle>execv</refentrytitle><manvolnum>3</manvolnum></citerefentry>执行用户指定的命令。" ], "id_hash": -5284175872385233964, "content_hash": -5284175872385233964, "location": "book.translate.xml:3441", "context": "", "note": "(itstool) path: sect3/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 456, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 22, "source_unit": "https://translate-dev.freebsd.org/api/units/102598/?format=api", "priority": 100, "id": 34500, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=36aad60a73c9cbd4", "url": "https://translate-dev.freebsd.org/api/units/34500/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.154818Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<filename>/usr/src/usr.sbin/jail/jail.c</filename>\ni = jail(&j);\n...\nif (execv(argv[3], argv + 3) != 0)\n err(1, \"execv: %s\", argv[3]);" ], "previous_source": "", "target": [ "<filename>/usr/src/usr.sbin/jail/jail.c</filename>\ni = jail(&j);\n...\nif (execv(argv[3], argv + 3) != 0)\n err(1, \"execv: %s\", argv[3]);" ], "id_hash": 7277816879881621070, "content_hash": 7277816879881621070, "location": "book.translate.xml:3446", "context": "", "note": "(itstool) path: sect3/programlisting", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 457, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 16, "source_unit": "https://translate-dev.freebsd.org/api/units/102599/?format=api", "priority": 100, "id": 34502, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=e4ffffe489af8e4e", "url": "https://translate-dev.freebsd.org/api/units/34502/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.163118Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "As you can see, the <literal>jail()</literal> function is called, and its argument is the <literal>jail</literal> structure which has been filled with the arguments given to the program. Finally, the program you specify is executed. I will now discuss how <application>jail</application> is implemented within the kernel." ], "previous_source": "", "target": [ "正如你所见,函数<literal>jail()</literal>被调用,参数是结构体<literal>jail</literal>中被填入数据项,而如前所述,这些数据项又来自<citerefentry><refentrytitle>jail</refentrytitle><manvolnum>8</manvolnum></citerefentry>的命令行参数。最后,执行了用户指定的命令。下面我将开始讨论<literal>jail</literal>在内核中的实现。" ], "id_hash": 8820664648180955180, "content_hash": 8820664648180955180, "location": "book.translate.xml:3452", "context": "", "note": "(itstool) path: sect3/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 458, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 45, "source_unit": "https://translate-dev.freebsd.org/api/units/102600/?format=api", "priority": 100, "id": 34503, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=fa694bc37dabf82c", "url": "https://translate-dev.freebsd.org/api/units/34503/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.184087Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "Kernel Space" ], "previous_source": "", "target": [ "内核空间" ], "id_hash": 7376364836595692782, "content_hash": 7376364836595692782, "location": "book.translate.xml:3462", "context": "", "note": "(itstool) path: sect2/title", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 459, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/102601/?format=api", "priority": 100, "id": 34505, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=e65e1cbcbaf7f4ee", "url": "https://translate-dev.freebsd.org/api/units/34505/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.194935Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "<primary>Jail</primary> <secondary>Kernel Architecture</secondary>" ], "previous_source": "", "target": [ "<primary>Jail</primary> <secondary>Kernel Architecture(内核架构)</secondary>" ], "id_hash": -2470315466255096529, "content_hash": -2470315466255096529, "location": "book.translate.xml:3464", "context": "", "note": "(itstool) path: sect2/indexterm", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 460, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/102602/?format=api", "priority": 100, "id": 34506, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=5db7ad2bf6b6252f", "url": "https://translate-dev.freebsd.org/api/units/34506/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.203397Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_arch-handbook/zh_CN/?format=api", "source": [ "We will now be looking at the file <filename>/usr/src/sys/kern/kern_jail.c</filename>. This is the file where the <citerefentry><refentrytitle>jail</refentrytitle><manvolnum>2</manvolnum></citerefentry> system call, appropriate sysctls, and networking functions are defined." ], "previous_source": "", "target": [ "现在我们来看文件<filename>/usr/src/sys/kern/kern_jail.c</filename>。\n 在这里定义了<citerefentry><refentrytitle>jail</refentrytitle><manvolnum>2</manvolnum></citerefentry>的系统调用、相关的sysctl项,还有网络函数。" ], "id_hash": 145684044185740894, "content_hash": 145684044185740894, "location": "book.translate.xml:3467", "context": "", "note": "(itstool) path: sect2/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 461, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 25, "source_unit": "https://translate-dev.freebsd.org/api/units/102603/?format=api", "priority": 100, "id": 34507, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_arch-handbook/zh_CN/?checksum=820592ddc722265e", "url": "https://translate-dev.freebsd.org/api/units/34507/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:21:47.216781Z" } ] }{ "count": 2721, "next": "