Forums: users (Thread #16211)

mew,pop proxy で ls とするとerrorとなる。 (2007-09-21 09:00 by Anonymous #32425)

加藤です。

mew-5.2, bsfilter-1.0.15 revsion 1.82で
pop-proxyで使用しています。
日本語のspamはほとんどspamとして認識していますが、
海外からくる2、3行のspamはすり抜けてきますので
ls(learinng spam)としてspam専用mail boxに
入れていました。

ところが, lsとすると以下のようなエラーがでてくるように
なりました。

Learnded as spam: /usr/local/bin/bsfilter:769:in 'open':Permission denied - home/zenkato/.bsfilter/C.prob.sdbm (Error::EACCES)

どのように処置すればいいのか教えていただけないでしょうか?

Reply to #32425×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mew,pop proxy で ls とするとerrorとなる。 (2007-09-22 23:35 by nabeken #32431)

原因が分からないのですが、対処療法として
% bsfilter -u
を実行して下さい。

*.prob.* を削除して、再作成するはずです。
Reply to #32425

Reply to #32431×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mew,pop proxy で ls とするとerrorとなる。 (2007-09-23 12:34 by Anonymous #32439)

お世話になります、 加藤です。

[zenkato@p4c8 ~]$ bsfilter -u
/usr/local/bin/bsfilter:769:in `open': Permission denied - /home/zenkato/.bsfilter/C.prob.sdbm (Errno::EACCES)
from /usr/local/bin/bsfilter:769:in `open_dbm'
from /usr/local/bin/bsfilter:716:in `open'
from /usr/local/bin/bsfilter:1747:in `update_probability'
from /usr/local/bin/bsfilter:3348:in `run'
from /usr/local/bin/bsfilter:3345:in `each'
from /usr/local/bin/bsfilter:3345:in `run'
from /usr/local/bin/bsfilter:3412
[zenkato@p4c8 .bsfilter]$ ls -al
合計 9028
drwx------ 2 zenkato zenkato 4096 9月 21 07:04 .
drwx------ 89 zenkato zenkato 24576 9月 23 12:10 ..
-rw------- 1 zenkato zenkato 4096 9月 21 07:04 C.clean.sdbm.dir
-rw-rw-r-- 1 zenkato zenkato 0 9月 23 12:21 C.clean.sdbm.lock
-rw------- 1 zenkato zenkato 4189184 9月 23 12:17 C.clean.sdbm.pag
-rw------- 1 root root 4096 9月 23 06:19 C.prob.sdbm.dir
-rw-rw-r-- 1 zenkato zenkato 0 9月 23 12:21 C.prob.sdbm.lock
-rw------- 1 root root 8383488 9月 23 12:13 C.prob.sdbm.pag
-rw------- 1 zenkato zenkato 4096 9月 23 12:17 C.spam.sdbm.dir
-rw-rw-r-- 1 zenkato zenkato 0 9月 23 12:21 C.spam.sdbm.lock
-rw------- 1 zenkato zenkato 524288 9月 23 12:17 C.spam.sdbm.pag
-rw-r--r-- 1 root root 5 9月 23 12:10 bsfilter.pid
-rw------- 1 zenkato zenkato 4096 9月 21 13:16 ja.clean.sdbm.dir
-rw-rw-r-- 1 zenkato zenkato 0 9月 23 12:17 ja.clean.sdbm.lock
-rw------- 1 zenkato zenkato 262144 9月 21 13:16 ja.clean.sdbm.pag
-rw------- 1 zenkato zenkato 4096 9月 23 12:13 ja.prob.sdbm.dir
-rw-rw-r-- 1 zenkato zenkato 0 9月 23 12:13 ja.prob.sdbm.lock
-rw------- 1 zenkato zenkato 1721344 9月 23 12:13 ja.prob.sdbm.pag
-rw------- 1 zenkato zenkato 4096 9月 23 06:18 ja.spam.sdbm.dir
-rw-rw-r-- 1 zenkato zenkato 0 9月 23 12:17 ja.spam.sdbm.lock
-rw------- 1 zenkato zenkato 523264 9月 23 12:13 ja.spam.sdbm.pag

drwx------ 2 zenkato zenkato 4096 9月 21 07:04 .bsfilter

となりました。何故
-rw------- 1 root root 4096 9月 23 06:19 C.prob.sdbm.dir
-rw------- 1 root root 8383488 9月 23 12:13 C.prob.sdbm.pag
となっているのかがわかりません。
Reply to #32425

Reply to #32439×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mew,pop proxy で ls とするとerrorとなる。 (2007-09-25 11:36 by zxcv3794 #32467)

水口です。

開発者では無いのではずしているかも知れませんが、やはり root で動く bsfilterプロセスが存在するのでは無いでしょうか。

root以外アクセス不可ファイルのタイムスタンプが他のファイルに比べて古くないので、何かの root プロセスがbsfilter のデータベースファイルに書き込みアクセスしているのはほぼ間違い無いかと思います。

proxyモードの bslfilter プロセスは、大丈夫でしょうか?

# OSにもよるのでしょうが、ブート時自動起動されるプロセスは、rootプロセスになるのがデフォルトだったりします。
Reply to #32439

Reply to #32467×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mew,pop proxy で ls とするとerrorとなる。 (2007-09-25 12:14 by Anonymous #32469)

加藤です。

bsfilterを/etc/rc.d/rc.localで起動していました。
C.prob.sdbm.dirとC.prob.sdbm.pagをchmodして
自分のuser/groupにしたら以前と同様にlsができました。

bsfilterをrootで動かすのはまずいのでしょうか?
Reply to #32467

Reply to #32469×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mew,pop proxy で ls とするとerrorとなる。 (2007-09-25 15:11 by zxcv3794 #32473)

水口です。

rootで動かすだけで不具合が約束される訳では無いでしょうが、避けるべき落とし穴がとても多いと思います。

今回の「普通のアカウントで bsfilter が動かなくなった」ことも、「何かの条件で root 以外で読み書きできないファイルが作られた」という落とし穴のひとつだと思うのですが。
Reply to #32469

Reply to #32473×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mew,pop proxy で ls とするとerrorとなる。 (2007-09-29 16:15 by Anonymous #32562)

加藤です。

大変基本的なことですが、一般ユーザでloginしたときに
bsfilterを起動させたいのですがどのように書いたら
いいのかわかりません。.bash_profileの
# User specific environment and startup programs
以下に書けばいいのでしょうか?
Reply to #32473

Reply to #32562×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mew,pop proxy で ls とするとerrorとなる。 (2007-09-29 19:26 by zxcv3794 #32564)

ログインの方法により設定すべき場所が違うと思います。

ブート完了後の画面に gnome のログイン画面が表示されていてそれにログインするのなら、答えは gnome のマニュアルに書いてあるはずです。

gnome では無く他のデスクトップ、KDE とか CDE とかの場合も、それぞれのデスクトップ固有の設定があると思います。

# 私は、長らくUNIXから遠ざかっているので、具体的な設定法は判らないです。 すみません。

.bash_profile に書いて正解なのは、「bash をログインシェルとするアカウント」に telnet とか シリアル接続端末からログインする場合でしょうか。


複数の場合に対応が必要なら、「ブート時に起動、ただしUID は指定したもの」という選択肢もありかと。

# どんな UNIX でも使えそうな suid, sgid ビットは、Rubyスクリプトでも有効?


ところで、この様なケースって結構ありそうな気がします。 Linuxなんかでシステム設定に慣れていない人が popモードを使用する際に苦労しそうです。 単なる思い付きですが、bsfilter に ~/.bsfilter (または指定ディレクトリ) の所有者の UID/GID で動作するオプションなんかがあれば、有用では無いでしょうか。

Reply to #32562

Reply to #32564×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mew,pop proxy で ls とするとerrorとなる。 (2007-09-30 22:42 by nabeken #32587)

> ~/.bsfilter (または指定ディレクトリ) の所有者の UID/GID で動作するオプション

複雑になるだけのようが気がするので避けたいです。

例えば
su foo "bsfilter..."
のように、使用するユーザの権限でプロセスを起動して貰いたいと思います。
Reply to #32564

Reply to #32587×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mew,pop proxy で ls とするとerrorとなる。 (2007-10-01 18:34 by zxcv3794 #32607)

すみません。 取り下げます。

マシンのシステム管理やその為の勉強に労力を割きたく無い人でも手軽に proxyモードをと考えたのですが、一般的には UID の制御だけでは不足で、PATH, umask, 環境変数あたりにも配慮が要りそうです。 これはアプリに求めるべき機能では無いですね。
Reply to #32587

Reply to #32607×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login