Skip to content

Logger (e.g. from Rails) creates files with wrong permissions #228

@psy-q

Description

@psy-q

Try this on JRuby 1.7.0pre1:

require 'rubygems'
require 'logger'
log = Logger.new("/tmp/test.log")
log.info "blah"

The file will have funky permissions:

   ---x--S--x 1 rca rca 121 Jul 17 14:56 /tmp/test.log

That seems to be octal 102101

Whereas MRI 1.9.3 behavior seems correct:

-rw-r--r-- 1 rca rca 121 Jul 17 14:59 /tmp/test2.log

That seems to be octal 100644. I don't know where the conversion goes wrong, whether there's some wrong masking going on?

jruby 1.7.0.preview1 (ruby-1.9.3-p203) (2012-05-19 00c8c98) (OpenJDK Server VM 1.7.0_03) [linux-i386-java]
OpenJDK Runtime Environment (IcedTea7 2.1.1) (7~u3-2.1.1-1)
OpenJDK Server VM (build 22.0-b10, mixed mode)

This is on Debian GNU/Linux 7 (wheezy).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions