Unability to open generalised "file descriptor" files eg: /proc/self/fd/xxx

オープン
#4,092 コメント 10 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
bash, go, linux, zsh

調査の方向性

まず報告されたコマンド micro <(ls) を再現し、/proc/self/fd/11 を通常のファイルではないとして拒否する入力ファイル引数の処理を追跡します。既存のファイルオープン時のチェックを確認し、通常のパス検証を壊さずに、報告されたディスクリプタパスで動作するようにします。process-substitution の入力が micro で開けるようになれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
Description

Many unices and unix-like OS-es support special directory in /proc (or elsewhere) to open inherited parent's proces file descriptors as files.

This is often used by advanced shell sub process redirection (bash, zsh and other more advanced shells).

Example:

$ nano <(ls) 
# "opens" directory listing as editable buffer (incoming as "descriptor" file from shell, containing actual output of `ls`)

Unfortunately with micro this fails:

: micro <(ls)                 
Error: /proc/self/fd/11 is not a regular file and cannot be opened

Press enter to continue

micro is probably doing regular file check on it's input file argument and raw file descriptor fails this.
This might be some kind of protection.

However this should be at least specialcased for file prefixes like /proc/self/fd/* on linux, to allow for shell sub-process redirection to work.

Environment
  • Version:
  • OS:
  • Terminal:
主要言語
Go
スター
29.8k
フォーク
1.4k
平均マージ
1日 12時間
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

micro-editor/micro のほかの issue

micro-editor/micro の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。