/usr/share/mime 파일에 대한 손상된 권한을 수정하는 방법은 무엇입니까?

/usr/share/mime 파일에 대한 손상된 권한을 수정하는 방법은 무엇입니까?

때때로 Void Linux에서 /usr/share/mime.

모든 GTK 애플리케이션에는 다음 오류가 발생합니다.

(evince:14593): Gtk-WARNING **: 11:32:26.476: Could not load a pixbuf from icon theme.

This may indicate that pixbuf loaders or the mime database could not be found. 

잘못된 권한은 일반적으로 다음과 같습니다(모든 파일의 모드는 640입니다).

-rw-r----- 1 root root  10773 Mar  1 13:37 aliases
drwxr-xr-x 1 root root  17650 Mar  1 13:37 application/
drwxr-xr-x 1 root root   1264 Mar  1 13:37 audio/
drwxr-xr-x 1 root root     72 Mar  1 13:37 font/
-rw-r----- 1 root root  21733 Mar  1 13:37 generic-icons
-rw-r----- 1 root root  31371 Mar  1 13:37 globs
-rw-r----- 1 root root  34843 Mar  1 13:37 globs2
-rw-r----- 1 root root     20 Mar  1 13:37 icons
drwxr-xr-x 1 root root   2474 Mar  1 13:37 image/
drwxr-xr-x 1 root root   5868 Mar  1 13:37 inode/
-rw-r----- 1 root root  28142 Mar  1 13:37 magic
drwxr-xr-x 1 root root    216 Mar  1 13:37 message/
-rw-r----- 1 root root 147456 Mar  1 13:37 mime.cache
drwxr-xr-x 1 root root     46 Mar  1 13:37 model/
drwxr-xr-x 1 root root    224 Mar  1 13:37 multipart/
drwxr-xr-x 1 root root    136 Mar  1 13:37 packages/
-rw-r----- 1 root root  17811 Mar  1 13:37 subclasses
drwxr-xr-x 1 root root   3220 Mar  1 13:37 text/
-rw-r----- 1 root root    964 Mar  1 13:37 treemagic
-rw-r----- 1 root root  21842 Mar  1 13:37 types
-rw-r----- 1 root root      5 Mar  1 13:37 version
drwxr-xr-x 1 root root    688 Mar  1 13:37 video/
drwxr-xr-x 1 root root    522 Mar  1 13:37 x-content/
drwxr-xr-x 1 root root     28 Mar  1 13:37 x-epoc/
-rw-r----- 1 root root   1775 Mar  1 13:37 XMLnamespaces

이 문제를 해결하려면 권한을 복구한 다음 MIME 데이터베이스 및 gdk pixbuf 캐시를 다시 생성해야 합니다.

파일에 대한 권한을 644로 수정하는 가장 좋은 방법은 무엇입니까?

답변1

/usr/share/mime모든 파일(디렉토리 제외)에 대한 권한을 640에서 644 이하로 변경하려면 다음을 실행하세요.

find /usr/share/mime -type f -perm 640 -exec chmod 644 {} \;
  • find /usr/share/mime다음에서 파일 찾기/usr/share/mime
  • -type f일반 파일(디렉토리 아님)로 제한
  • -perm 640권한이 640인 파일로 검색을 제한합니다.
  • -exec chmod 644 {} \;chmod 644발견된 파일에서 실행

답변2

이 특정 권한 문제를 해결하는 또 다른 방법은 올바른 umask를 사용하여 MIME 데이터베이스를 다시 작성하는 것입니다.

$ sudo sh
# umask 022
# update-mime-database /usr/share/mime
# exit

관련 정보