1
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?

Windows版Squid ver.7のインストールについて

Last updated at Posted at 2025-10-24

はじめに

WindowsServer版NASサーバーにSquid ver.4.14 を導入していました。

社のセキュリティチェックに引っかかったようで、バージョンアップまたは代替を探すことになりました。

2025年10月、Squidに重大な脆弱性が発見されたとのニュースがあった。

バージョンアップ

公式サイトのWindowsインストーラー版があるのは ver.4.14 が最新である。
かといって、最新版Squid ver.7.2 は Cygwin を使用してビルドする必要があるようだ。
ビルド方法としては、ver.5のブログがあるくらい。

ver.4.14のWindowsインストーラ版を作成した方のIssuesを読んでいたら、フォークして、ver.7.1 のWindowsインストーラ版を作成してくれた方がいた。

仕組み

Cygwinとは、Windows上にLinuxなどのUNIX系OSの環境を再現するソフトウェアパッケージの一つ。

Cygwin上で.exe にコンパイルできる。.exe 自体は、Windowsが直接実行できる形式(PE形式)です。したがって、ユーザーから見ると「普通のWindowsアプリ」に見えます。

内部的には:

  • .exe が起動されると、まず cygwin1.dll がロードされる
  • DLLがPOSIX環境を初期化(fork/exec/pipeなどを模倣)
  • その上でプログラム本体の main() が呼ばれる

このため、Cygwinが導入されていない環境でも必要DLLが一緒にあれば単体で動作します。

Visual StudioにてWindowsサービスプログラムをC#で作成しており、Windowsサービスにて Process クラスで squid.exe を呼び出しています。

this.squid = new Process();
this.squid.StartInfo.FileName = PredefinedPaths.InstallationFolder + @"\bin\squid.exe";
this.squid.StartInfo.CreateNoWindow = true;
this.squid.StartInfo.Arguments = "-N";

this.squid.Start();

最後に

セキュリティ対策として、ver.7.1 のバージョンアップでは、まだ駄目かも知れない。
恒久対策としては ver.7.2 へのアップグレードとなるが、すぐできない人向けのワークアラウンドとして、「email_err_data off」の設定を行えばいいようだ。

1
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
1
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?