0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

libfuse で遊んでたらシステム壊した

0
Posted at

何やらかした?

  • libfuse で実現したい機能があったので、PoC で遊んでた
  • 各関数を順次実装しながら動作確認してた
    • chmod / chown を適当に実装して、テストしたらシステムが死んだ
  • 具体的には、一般ユーザで全ての shell が Permission Denied になったので rescue mode (root) でしか起動できなくなった

原因は

  1. chmod / chown の第一引数 const char * path は、fuse を root にするパスで渡されるっぽい
  2. fuse は sudo でマウントするので、sudo chmod / sudo chown と同じ効果になる

上記の合せ技によって、システムのどこかの権限が異常になり、一般ユーザが何もできなくなった(っぽい)

その後

  • 色々試したけど、権限復旧は諦めた
  • SSD を取り出してバックアップした後、クリーンインストールして必要なファイルを戻した
    • Fedora 42 だったので Fedora 43 にした
    • 長年のゴミを消してシステムがきれいになったのでヨシとする
  • btrfs を ext4 の中にバックアップしたから地味にデータ取り出しが面倒くさかった
  • rm とかする前に気づけてよかった
  • 権限関連には気をつけよう!
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?