[#39222] [Bug #2036] AIX 5L 5.2にて、ruby-1.8.7-p174のビルド時にmake testをするとエラーになった。not ok float 7 -- ./sample/test.rb:1232 — 和弥 寺元 <redmine@...>
Bug #2036: AIX 5L 5.2にて、ruby-1.8.7-p174のビルド時にmake testをするとエラーになった。not ok float 7 -- ./sample/test.rb:1232
チケット #2036 が更新されました。 (by 和弥 寺元)
[#39248] pdeque - Double-Ended Priority Queue — Tanaka Akira <akr@...>
優先順位つきキューとして、このメールにつけてある pdeque.rb
[#39249] [Bug #2060] DLをCからRubyに変換する事を勧めます — Aaron Patterson <redmine@...>
Bug #2060: DLをCからRubyに変換する事を勧めます
なかだです。
2009/9/7 Nobuyoshi Nakada <nobu@ruby-lang.org>:
[#39277] Why doesn't Array#product return Enumerator? — Yusuke ENDOH <mame@...>
遠藤です。
まつもと ゆきひろです
遠藤です。
まつもと ゆきひろです
[#39282] [Bug #2067] bodyが大きいエラーページをopen-uriで取得するとfdがリークしている — takeru sasaki <redmine@...>
チケット #2067 が更新されました。 (by takeru sasaki)
まつもと ゆきひろです
なかだです。
まつもと ゆきひろです
In article <E1MliJq-0000yc-4o@x61.netlab.jp>,
言いだしっぺの佐々木です。
まつもと ゆきひろです
佐々木です。
In article <c507366f0909102211s5ae74f72r82afabdf57ae89@mail.gmail.com>,
[#39301] [Feature #2080] Proc#to_source, Method#to_source — Yuki Sonoda <redmine@...>
Feature #2080: Proc#to_source, Method#to_source
[#39322] [Feature #2093] String#stripの対象は\sか[:space:]か — Yui NARUSE <redmine@...>
Feature #2093: String#stripの対象は\sか[:space:]か
[#39325] makeターゲットrdevを抽象化 — "KISHIMOTO, Makoto" <ksmakoto@...4u.or.jp>
きしもとです
なかだです。
[#39352] [ruby19] Thread 切替えが異常に遅い? — Hidetoshi NAGAI <nagai@...>
永井@知能.九工大です.
なかだです。
永井@知能.九工大です.
ささだです.
永井@知能.九工大です.
なかだです。
[#39361] [Bug:1.9] ("00".."00").to_a => ["0"] — Nobuhiro IMAI <nov@...>
いまいです。
[#39367] Almost endless loop of BigMath::atan(x) when x.abs >= 1 — "Masahiro Kanai (CanI)" <cani.m.61st@...>
金井 仁弘と申します。
豊福です。遅い反応ですが。
豊福です。
金井です。
豊福です。
豊福です。
豊福です。
金井です。
[#39372] [Proposal] メンテナ確認大会のお知らせ — Yugui <yugui@...>
Yuguiです。
WXVndWkbJEIkNSRzJWEhPCVrJCIkaiQsJEgkJiQ0JDYkJCReJDckPyEjJDMkQSRpJEtKVj8uJDck
[#39385] Removing constant-able macros inside of the loop. — "Masahiro Kanai (CanI)" <cani.m.61st@...>
金井 仁弘と申します。
[#39388] Re: [ruby-cvs:32331] Ruby:r25113 (trunk): String#inspect's encoding should be fixed. — "Martin J. Dürst" <duerst@...>
成瀬さん、こんにちは。
こんにちは、なかむら(う)です。
成瀬です。
中村さん、成瀬さん、こんにちは。
MjAwOeW5tDnmnIgyOeaXpTEyOjMxICJNYXJ0aW4gSi4gRMO8cnN0IiA8ZHVlcnN0QGl0LmFveWFt
[#39404] [ANN] Ruby Developer's Meeting 20091013 — Yugui <yugui@...>
Yuguiです。
[ruby-dev:39230] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition.
小崎と申します
シロウトなんで口を挟むのに恐縮なんですが・・・
> In article <4a9f873c.22035a0a.40fb.2740@mx.google.com>,
> Nobuyoshi Nakada <nobu@ruby-lang.org> writes:
>
> > O_EXCL自体がサポートされていないということは、既存のファイルを上
> > 書きしてしまうということじゃないでしょうか。
>
> なかださんが [ruby-dev:39210] で引用したマニュアルの記述は、
> 単に O_EXCL が無視されるっていうニュアンスではないように思い
> ます。「競合状態 (race condition) に出会う可能性がある」とい
> う話なので、競合が起きなければ動くんじゃないでしょうか。
>
> テンポラリファイルの場合、成功すべきところで失敗するだけなら
> ごみファイルができるだけで済みますが、失敗すべきところで成功
> すると上書きされる可能性が出てきます。
>
> UDP で response が落ちるというだけなら前者で済むと思うんです
> が、それ以外にもなにか問題があると上書きしちゃうかもしれない
> ですね。
>
> いちおう、RFC 1094 には
>
> | 2.2.10. Create File
> |
> | struct createargs {
> | diropargs where;
> | sattr attributes;
> | };
> |
> | diropres
> | NFSPROC_CREATE(createargs) = 9;
> |
> | The file "name" is created in the directory given by "dir". The
> | initial attributes of the new file are given by "attributes". A
> | reply "status" of NFS_OK indicates that the file was created, and
> | reply "file" and reply "attributes" are its file handle and
> | attributes. Any other reply "status" means that the operation failed
> | and no file was created.
> |
> | Notes: This routine should pass an exclusive create flag, meaning
> | "create the file only if it is not already there".
>
> とあって、Notes のところで O_EXCL を渡すと読めるような気がし
> ないでもない記述があるんですが。
同RFCのstruct sattrの定義は以下
struct sattr {
unsigned int mode;
unsigned int uid;
unsigned int gid;
unsigned int size;
timeval atime;
timeval mtime;
};
なので、O_EXCLを入れる事が出来るメンバは無いように見えます。
どこかの上位ビットを使う暗黙の規約があるのかとも一瞬考えましたが、
少なくともLinuxにおいては、最新版においても、以下のように
素直にsattrにmodeを入れているだけのようです。
-----------------------------------------------------------------
static int nfs_create(struct inode *dir, struct dentry *dentry, int mode,
struct nameidata *nd)
{
struct iattr attr;
int error;
int open_flags = 0;
dfprintk(VFS, "NFS: create(%s/%ld), %s\n",
dir->i_sb->s_id, dir->i_ino, dentry->d_name.name);
attr.ia_mode = mode;
attr.ia_valid = ATTR_MODE;
if ((nd->flags & LOOKUP_CREATE) != 0)
open_flags = nd->intent.open.flags;
error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags, nd); // 実体は nfs_proc_create
if (error != 0)
goto out_err;
return 0;
out_err:
d_drop(dentry);
return error;
}
static int
nfs_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
int flags, struct nameidata *nd)
{
struct nfs_fh fhandle;
struct nfs_fattr fattr;
struct nfs_createargs arg = {
.fh = NFS_FH(dir),
.name = dentry->d_name.name,
.len = dentry->d_name.len,
.sattr = sattr
};
(snip)
}
static inline __be32 *
xdr_encode_sattr(__be32 *p, struct iattr *attr)
{
if (attr->ia_valid & ATTR_MODE) {
*p++ = xdr_one;
*p++ = htonl(attr->ia_mode & S_IALLUGO);
} else {
*p++ = xdr_zero;
}
if (attr->ia_valid & ATTR_UID) {
*p++ = xdr_one;
*p++ = htonl(attr->ia_uid);
} else {
*p++ = xdr_zero;
}
if (attr->ia_valid & ATTR_GID) {
*p++ = xdr_one;
*p++ = htonl(attr->ia_gid);
} else {
*p++ = xdr_zero;
}
if (attr->ia_valid & ATTR_SIZE) {
*p++ = xdr_one;
p = xdr_encode_hyper(p, (__u64) attr->ia_size);
} else {
*p++ = xdr_zero;
}
if (attr->ia_valid & ATTR_ATIME_SET) {
*p++ = xdr_two;
p = xdr_encode_time3(p, &attr->ia_atime);
} else if (attr->ia_valid & ATTR_ATIME) {
*p++ = xdr_one;
} else {
*p++ = xdr_zero;
}
if (attr->ia_valid & ATTR_MTIME_SET) {
*p++ = xdr_two;
p = xdr_encode_time3(p, &attr->ia_mtime);
} else if (attr->ia_valid & ATTR_MTIME) {
*p++ = xdr_one;
} else {
*p++ = xdr_zero;
}
return p;
}
-----------------------------------------------------------------
上記文章は、createを使う事によってO_EXCLを実現できるとRFC策定者は思ってるよ。
と言ってるだけではないでしょうか?
http://www.linux.or.jp/JF/JFdocs/Secure-Programs-HOWTO/avoid-race.html
を見ると、はっきりと
>ここで注目なのは、安全でない関数の tempnam(3)が使われていても、ループ内部で
> O_CREAT と O_EXCL を使って、セキュリティ上の弱点をカバーしている点です。
> 注目して欲しいのは、ファイル名を free()する必要があるところです。
> 処理が終わったら、close()や unlink()すべきです。標準 C 入出力ライブラリ
> を使いたいなら、fdopen()を「w+b」で使用して、ファイルディスクリプタを
> FILE * に変えてください。この解決方法は、NFS version 2 (v2)のシステム
> ではうまくいかないでしょう。理由は、古い NFS が O_EXCL をきちんとサポート
> していないからです。この解決方法にはちょっとした欠点もあって、tempnam
> を安全に使わないと、コンパイラやセキュリティ・スキャナがうるさく警告を
> 出すかもしれません。これは mkstemp(3)では問題となりません。
と、一時ファイル用のO_EXCLはダメと言っていますね。
#でも実装を見るとちゃんと動きそうな気がするんだよなー
#O_EXCLはnfsにいく前のvfsでエラーにするかどうかの話なので
# unlinkとかESTALE絡みの話が出てくる操作をしないかぎり、nfsが
# 特殊な考慮をしなくても動く気がしてならない。ぶつぶつ