mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add UNIXFileOwner, UNIXFileGroup
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e1dcc80d4c
commit
8d64baf2a8
2 changed files with 12 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
Sun Jul 27 10:21:28 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
|
||||
|
||||
* lib/drb/unix.rb: add UNIXFileOwner, UNIXFileGroup.
|
||||
|
||||
Sun Jul 27 03:10:43 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* io.c (io_reopen): avoid dup2() equal handles not to close itself and
|
||||
|
|
|
@ -31,6 +31,14 @@ module DRb
|
|||
else
|
||||
soc = UNIXServer.open(filename)
|
||||
end
|
||||
owner = config[:UNIXFileOwner]
|
||||
group = config[:UNIXFileGroup]
|
||||
if owner || group
|
||||
require 'etc'
|
||||
owner = Etc.getpwnam( owner ).uid if owner
|
||||
group = Etc.getgrnam( group ).gid if group
|
||||
File.chown owner, group, filename
|
||||
end
|
||||
mode = config[:UNIXFileMode]
|
||||
File.chmod(mode, filename) if mode
|
||||
|
||||
|
|
Loading…
Reference in a new issue