一般的に、エンドユーザーは、Red Hat Enterprise Linux がターゲットポリシーを実行している場合に、SELinux との相互作用はほとんどありません。これは、ユーザーが unconfined_t
のドメインと、ターゲットデーモン 以外 の残りのシステムで実行しているためです。
ほとんどの場合、標準の DAC コントロールは、SELinux が参照される前に、必要なアクセスまたはパーミッションを持たないタスクを実行することを防ぎます。したがって、avc: denied
メッセージを生成しない可能性があります。
以下のセクションでは、エンドユーザーが Red Hat Enterprise Linux システムで実行する必要がある可能性のある一般的なタスクおよびプラクティスを説明します。これらのタスクは、エンドユーザーだけでなく、すべての特権レベルのユーザーに適用されます。
ファイルシステムの操作では、セキュリティーコンテキストは、ファイルのラベル、アクセスしているプロセス、および操作が発生したディレクトリーという点として考慮する必要があります。このため、mv と cp のあるファイルを移動およびコピーすると、予期しない結果が生じる可能性があります。
-Z user:role:type
オプションを使用して、新規ファイルに必要なラベルを指定します。
-p
(または --preserve=mode,ownership,timestamps
)オプションは指定された属性を保持し、可能であれば link などの追加属性を保持します。
touch bar foo
ls -Z bar foo
-rw-rw-r-- auser auser user_u:object_r:user_home_t bar
-rw-rw-r-- auser auser user_u:object_r:user_home_t foo
touch bar foo
ls -Z bar foo
-rw-rw-r-- auser auser user_u:object_r:user_home_t bar
-rw-rw-r-- auser auser user_u:object_r:user_home_t foo
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
追加のコマンドライン引数なしで cp コマンドを使用すると、作成プロセスのデフォルトのタイプとターゲットディレクトリーを使用して、新しい場所にファイルのコピーが作成されます。この場合、cp および /tmp
に適用される特定のルールがないため、新しいファイルには親ディレクトリーのタイプが設定されます。
cp bar /tmp
ls -Z /tmp/bar
-rw-rw-r-- auser auser user_u:object_r:tmp_t /tmp/bar
cp bar /tmp
ls -Z /tmp/bar
-rw-rw-r-- auser auser user_u:object_r:tmp_t /tmp/bar
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
tmp_t
タイプは、一時ファイルのデフォルトタイプです。
-Z
オプションを使用して、新規ファイルのラベルを指定します。
cp -Z user_u:object_r:user_home_t foo /tmp
ls -Z /tmp/foo
-rw-rw-r-- auser auser user_u:object_r:user_home_t /tmp/foo
cp -Z user_u:object_r:user_home_t foo /tmp
ls -Z /tmp/foo
-rw-rw-r-- auser auser user_u:object_r:user_home_t /tmp/foo
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
Expand 表50.1 mv コマンドおよび cp コマンドの動作 コマンド 動作 mv ファイルは、元のラベルを保持します。これにより、問題、混乱、またはマイナーなセキュリティーが発生する可能性があります。たとえば、sbin_t
ドメインで実行している tmpwatch プログラムは、ファイルのタイプが原因で、/tmp
ディレクトリー内の経過時間ファイルを削除できない可能性があります。 cp 作成プロセスのドメイン(cp )とターゲットディレクトリーのタイプに基づくデフォルトの動作を使用して、ファイルのコピーを作成します。 cp -p ファイルのコピーを作成し、可能な場合は指定された属性とセキュリティーコンテキストを保持します。デフォルトの属性は mode 、ownership 、および timestamps です。その他の属性は links および all です。 cp -Z <user:role:type> 指定されたラベルで ファイルのコピーを作成します。-Z
オプションは、--context
と同義語です。
Show more
以下の例は、ps コマンドの出力例を一部示しています。ほとんどのプロセスは unconfined_t
ドメインで実行されており、いくつかの例外があります。
ps auxZ
[user@localhost ~]$ ps auxZ
LABEL USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
system_u:system_r:init_t root 1 0.0 0.1 2032 620 ? Ss 15:09 0:00 init [5]
system_u:system_r:kernel_t root 2 0.0 0.0 0 0 ? S 15:09 0:00 [migration/0]
system_u:system_r:kernel_t root 3 0.0 0.0 0 0 ? SN 15:09 0:00 [ksoftirqd/0]
user_u:system_r:unconfined_t user 3122 0.0 0.6 6908 3232 ? S 16:47 0:01 /usr/libexec/gconfd-2 5
user_u:system_r:unconfined_t user 3125 0.0 0.1 2540 588 ? S 16:47 0:00 /usr/bin/gnome-keyring-daemon
user_u:system_r:unconfined_t user 3127 0.0 1.4 33612 6988 ? Sl 16:47 0:00 /usr/libexec/gnome-settings-daemon
user_u:system_r:unconfined_t user 3144 0.1 1.4 16528 7360 ? Ss 16:47 0:01 metacity --sm-client-id=default1
user_u:system_r:unconfined_t user 3148 0.2 2.9 79544 14808 ? Ss 16:47 0:03 gnome-panel --sm-client-id default2
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
id -Z
[root@localhost ~]# id -Z
user_u:system_r:unconfined_t
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
id コマンドで -Z
オプションを使用して、別のユーザーのセキュリティーコンテキストを検査できないことに注意してください。つまり、現在ログインしているユーザーのセキュリティーコンテキストのみを表示できます。
id
id root
id -Z root
[user@localhost ~]$ id
uid=501(user) gid=501(user) groups=501(user) context=user_u:system_r:unconfined_t
[user@localhost ~]$ id root
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
[user@localhost ~]$ id -Z root
id: cannot display context when selinux not enabled or when displaying the id
of a different user
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
cd /etc
ls -Z h* -d
drwxr-xr-x root root system_u:object_r:etc_t hal
-rw-r--r-- root root system_u:object_r:etc_t host.conf
-rw-r--r-- root root user_u:object_r:etc_t hosts
-rw-r--r-- root root system_u:object_r:etc_t hosts.allow
-rw-r--r-- root root system_u:object_r:etc_t hosts.canna
-rw-r--r-- root root system_u:object_r:etc_t hosts.deny
drwxr-xr-x root root system_u:object_r:hotplug_etc_t hotplug
drwxr-xr-x root root system_u:object_r:etc_t hotplug.d
drwxr-xr-x root root system_u:object_r:httpd_sys_content_t htdig
drwxr-xr-x root root system_u:object_r:httpd_config_t httpd
cd /etc
ls -Z h* -d
drwxr-xr-x root root system_u:object_r:etc_t hal
-rw-r--r-- root root system_u:object_r:etc_t host.conf
-rw-r--r-- root root user_u:object_r:etc_t hosts
-rw-r--r-- root root system_u:object_r:etc_t hosts.allow
-rw-r--r-- root root system_u:object_r:etc_t hosts.canna
-rw-r--r-- root root system_u:object_r:etc_t hosts.deny
drwxr-xr-x root root system_u:object_r:hotplug_etc_t hotplug
drwxr-xr-x root root system_u:object_r:etc_t hotplug.d
drwxr-xr-x root root system_u:object_r:httpd_sys_content_t htdig
drwxr-xr-x root root system_u:object_r:httpd_config_t httpd
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
~/public_html
ディレクトリーなどのターゲットデーモンに関連する特別なディレクトリーに移動またはコピーする場合、または /home
以外のディレクトリーで動作するスクリプトを作成する場合は、ファイルの再ラベル付けが必要になる場合があります。
再ラベル付け操作には、以下の 2 つの一般的なタイプがあります。
targeted ポリシーにおける SELinux パーミッション制御の大半は、Type Enforcement (
TE )です。したがって、通常、セキュリティーラベルのユーザーおよびロール情報を無視し、タイプの変更にフォーカスできます。通常、ファイルのロールとユーザー設定を考慮する必要はありません。
再ラベル付けがデーモンの実行可能ファイルのラベルに影響を及ぼす場合は、デーモンを再起動して、正しいドメインで実行していることを確認する必要があります。たとえば、/usr/sbin/mysqld
に誤ったセキュリティーラベルがあり、restorecon などの再ラベル付け操作を使用してこれに対応する場合は、再ラベル付け操作の後に mysqld
を再起動する必要があります。実行可能ファイルを正しいタイプ(mysqld_exec_t
)に設定すると、起動時に適切なドメインに移行できるようになります。
chcon コマンドを使用して、ファイルを正しいタイプに変更します。このコマンドを使用するには、適用する正しいタイプを知っている必要があります。以下の例のディレクトリーおよびファイルには、/home
で作成されたファイルシステムオブジェクトに定義されたデフォルトタイプのラベルが付けられています。
cd ~
ls -Zd public_html/
drwxrwxr-x auser auser user_u:object_r:user_home_t public_html/
ls -Z web_files/
-rw-rw-r-- auser auser user_u:object_r:user_home_t 1.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 2.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 3.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 4.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 5.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t index.html
cd ~
ls -Zd public_html/
drwxrwxr-x auser auser user_u:object_r:user_home_t public_html/
ls -Z web_files/
-rw-rw-r-- auser auser user_u:object_r:user_home_t 1.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 2.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 3.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 4.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 5.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t index.html
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
これらのファイルを public_html
ディレクトリーに移動すると、元のタイプを保持します。
mv web_files/* public_html/
ls -Z public_html/
-rw-rw-r-- auser auser user_u:object_r:user_home_t 1.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 2.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 3.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 4.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 5.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t index.html
mv web_files/* public_html/
ls -Z public_html/
-rw-rw-r-- auser auser user_u:object_r:user_home_t 1.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 2.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 3.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 4.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 5.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t index.html
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
特別なユーザーのパブリック HTML フォルダーからこれらのファイルを表示可能にするには、httpd
が読み取り権限を持つタイプが必要です。Apache HTTP Server は UserDir に対して設定され、ブール値 httpd_enable_homedirs
が有効になります。
chcon -R -t httpd_user_content_t public_html/
ls -Z public_html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 1.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 2.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 3.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 4.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 5.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t index.html
ls -Z public_html/ -d
drwxrwxr-x auser auser user_u:object_r:httpd_user_content_t public_html/
chcon -R -t httpd_user_content_t public_html/
ls -Z public_html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 1.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 2.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 3.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 4.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t 5.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t index.html
ls -Z public_html/ -d
drwxrwxr-x auser auser user_u:object_r:httpd_user_content_t public_html/
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
カーネルで SELinux が無効になっているときに作成されたファイルなどのラベルがない場合は、chcon system_u:object_r:shlib_t foo.so で完全なラベルを指定する必要があります。そうしないと、部分的なコンテキストをラベル付けされていないファイルに適用するというエラーが発生します。
restorecon コマンドを使用して、ポリシーに従ってファイルをデフォルト値に戻します。ファイルシステム全体で機能するこの操作を実行する方法は、
fixfiles または policy relabeling の 2 つがあります。これらの方法にはそれぞれスーパーユーザー権限が必要です。これらの方法の両方に対する注意点は、
「ファイルシステムの再ラベル付け」 に記載されています。
以下の例は、デフォルトのユーザーのホームディレクトリーコンテキストを、異なるタイプのファイルセットに復元する方法を示しています。最初の 2 つのファイルセットにはタイプが異なるため、アーカイブのためにディレクトリーに移動されています。これらのコンテキストは相互に異なり、標準のユーザーのホームディレクトリーでは正しくありません。
ls -Z /tmp/
-rw-rw-r-- auser auser user_u:object_r:tmp_t /tmp/file1
-rw-rw-r-- auser auser user_u:object_r:tmp_t /tmp/file2
-rw-rw-r-- auser auser user_u:object_r:tmp_t /tmp/file3
mv /tmp/{1,2,3} archives/
mv public_html/* archives/
ls -Z archives/
-rw-rw-r-- auser auser user_u:object_r:tmp_t file1
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file1.html
-rw-rw-r-- auser auser user_u:object_r:tmp_t file2
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file2.html
-rw-rw-r-- auser auser user_u:object_r:tmp_t file3
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file3.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file4.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file5.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t index.html
ls -Z /tmp/
-rw-rw-r-- auser auser user_u:object_r:tmp_t /tmp/file1
-rw-rw-r-- auser auser user_u:object_r:tmp_t /tmp/file2
-rw-rw-r-- auser auser user_u:object_r:tmp_t /tmp/file3
mv /tmp/{1,2,3} archives/
mv public_html/* archives/
ls -Z archives/
-rw-rw-r-- auser auser user_u:object_r:tmp_t file1
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file1.html
-rw-rw-r-- auser auser user_u:object_r:tmp_t file2
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file2.html
-rw-rw-r-- auser auser user_u:object_r:tmp_t file3
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file3.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file4.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t file5.html
-rw-rw-r-- auser auser user_u:object_r:httpd_user_content_t index.html
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
archives/
ディレクトリーには、ユーザーのホームディレクトリーにデフォルトのタイプが作成されているため、すでにデフォルトのタイプがあります。
ls -Zd archives/
drwxrwxr-x auser auser user_u:object_r:user_home_t archives/
ls -Zd archives/
drwxrwxr-x auser auser user_u:object_r:user_home_t archives/
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
restorecon コマンドを使用してファイルに再ラベル付けするには、ポリシーで設定されたデフォルトのファイルコンテキストを使用するため、これらのファイルには現在のディレクトリーのデフォルトラベルのラベルが付けられます。
/sbin/restorecon -R archives/
ls -Z archives/
-rw-rw-r-- auser auser system_u:object_r:user_home_t file1
-rw-rw-r-- auser auser system_u:object_r:user_home_t file1.html
-rw-rw-r-- auser auser system_u:object_r:user_home_t file2
-rw-rw-r-- auser auser system_u:object_r:user_home_t file2.html
-rw-rw-r-- auser auser system_u:object_r:user_home_t file3
-rw-rw-r-- auser auser system_u:object_r:user_home_t file3.html
-rw-rw-r-- auser auser system_u:object_r:user_home_t file4.html
-rw-rw-r-- auser auser system_u:object_r:user_home_t file5.html
-rw-rw-r-- auser auser system_u:object_r:user_home_t index.html
/sbin/restorecon -R archives/
ls -Z archives/
-rw-rw-r-- auser auser system_u:object_r:user_home_t file1
-rw-rw-r-- auser auser system_u:object_r:user_home_t file1.html
-rw-rw-r-- auser auser system_u:object_r:user_home_t file2
-rw-rw-r-- auser auser system_u:object_r:user_home_t file2.html
-rw-rw-r-- auser auser system_u:object_r:user_home_t file3
-rw-rw-r-- auser auser system_u:object_r:user_home_t file3.html
-rw-rw-r-- auser auser system_u:object_r:user_home_t file4.html
-rw-rw-r-- auser auser system_u:object_r:user_home_t file5.html
-rw-rw-r-- auser auser system_u:object_r:user_home_t index.html
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
tar ユーティリティーまたは star ユーティリティーを使用して、SELinux セキュリティーコンテキストを保持するアーカイブを作成できます。以下の例は star を使用して、このようなアーカイブを作成する方法を示しています。追加の属性がキャプチャーされ、*.star
ファイルのヘッダーが xattrs に完全に対応するタイプになるように、適切な -xattr
および -H=exustar
オプションを使用する必要があります。これらのオプションおよびその他のオプションの詳細は、の man ページを参照してください。
以下の例は、html ファイルおよびディレクトリーの作成と抽出を示しています。2 つのディレクトリーには異なるラベルがあることに注意してください。ファイルコンテキストの未インポート部分は、印刷目的で省略されています(省略される...で示されます)。
ls -Z public_html/ web_files/
public_html/:
-rw-rw-r-- auser auser ...httpd_user_content_t 1.html
-rw-rw-r-- auser auser ...httpd_user_content_t 2.html
-rw-rw-r-- auser auser ...httpd_user_content_t 3.html
-rw-rw-r-- auser auser ...httpd_user_content_t 4.html
-rw-rw-r-- auser auser ...httpd_user_content_t 5.html
-rw-rw-r-- auser auser ...httpd_user_content_t index.html
web_files/:
-rw-rw-r-- auser auser user_u:object_r:user_home_t 1.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 2.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 3.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 4.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 5.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t index.html
ls -Z public_html/ web_files/
public_html/:
-rw-rw-r-- auser auser ...httpd_user_content_t 1.html
-rw-rw-r-- auser auser ...httpd_user_content_t 2.html
-rw-rw-r-- auser auser ...httpd_user_content_t 3.html
-rw-rw-r-- auser auser ...httpd_user_content_t 4.html
-rw-rw-r-- auser auser ...httpd_user_content_t 5.html
-rw-rw-r-- auser auser ...httpd_user_content_t index.html
web_files/:
-rw-rw-r-- auser auser user_u:object_r:user_home_t 1.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 2.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 3.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 4.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 5.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t index.html
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
以下のコマンドはアーカイブを作成し、すべての SELinux セキュリティーコンテキストを保持します。
star -xattr -H=exustar -c -f all_web.star public_html/ web_files/
star: 11 blocks + 0 bytes (total of 112640 bytes = 110.00k).
star -xattr -H=exustar -c -f all_web.star public_html/ web_files/
star: 11 blocks + 0 bytes (total of 112640 bytes = 110.00k).
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
-Z
オプションを指定して ls コマンドを使用して、セキュリティーコンテキストを検証します。
ls -Z all_web.star
-rw-rw-r-- auser auser user_u:object_r:user_home_t \ all_web.star
ls -Z all_web.star
-rw-rw-r-- auser auser user_u:object_r:user_home_t \ all_web.star
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
アーカイブを別のディレクトリーにコピーできるようになりました。この例では、アーカイブは /tmp
にコピーされます。派生一時タイプを作成する特定のポリシーがない場合、デフォルトの動作は tmp_t
タイプを取得することです。
cp all_web.star /tmp/ cd /tmp/
ls -Z all_web.star
-rw-rw-r-- auser auser user_u:object_r:tmp_t all_web.star
cp all_web.star /tmp/ cd /tmp/
ls -Z all_web.star
-rw-rw-r-- auser auser user_u:object_r:tmp_t all_web.star
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
これで、星 を使用してアーカイブを展開し、拡張属性を復元できます。
star -xattr -x -f all_web.star
star: 11 blocks + 0 bytes (total of 112640 bytes = 110.00k).
ls -Z /tmp/public_html/ /tmp/web_files/
/tmp/public_html/:
-rw-rw-r-- auser auser ...httpd_sys_content_t 1.html
-rw-rw-r-- auser auser ...httpd_sys_content_t 2.html
-rw-rw-r-- auser auser ...httpd_sys_content_t 3.html
-rw-rw-r-- auser auser ...httpd_sys_content_t 4.html
-rw-rw-r-- auser auser ...httpd_sys_content_t 5.html
-rw-rw-r-- auser auser ...httpd_sys_content_t index.html
/tmp/web_files/:
-rw-rw-r-- auser auser user_u:object_r:user_home_t 1.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 2.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 3.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 4.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 5.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t \ index.html
star -xattr -x -f all_web.star
star: 11 blocks + 0 bytes (total of 112640 bytes = 110.00k).
ls -Z /tmp/public_html/ /tmp/web_files/
/tmp/public_html/:
-rw-rw-r-- auser auser ...httpd_sys_content_t 1.html
-rw-rw-r-- auser auser ...httpd_sys_content_t 2.html
-rw-rw-r-- auser auser ...httpd_sys_content_t 3.html
-rw-rw-r-- auser auser ...httpd_sys_content_t 4.html
-rw-rw-r-- auser auser ...httpd_sys_content_t 5.html
-rw-rw-r-- auser auser ...httpd_sys_content_t index.html
/tmp/web_files/:
-rw-rw-r-- auser auser user_u:object_r:user_home_t 1.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 2.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 3.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 4.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t 5.html
-rw-rw-r-- auser auser user_u:object_r:user_home_t \ index.html
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
star を使用してアーカイブを作成するときに絶対パスを使用する場合、アーカイブは同じパスに展開されます。たとえば、このコマンドで作成されたアーカイブは、ファイルを /var/log/httpd/
に復元します。
star -xattr -H=exustar -c -f httpd_logs.star /var/log/httpd/
star -xattr -H=exustar -c -f httpd_logs.star /var/log/httpd/
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
このアーカイブの拡張を試みると、パス のファイルがアーカイブにあるファイルよりも新しい場合は、警告を発行します。