Menu

#47 [PATCH] File modes for default files

open
nobody
None
5
2008-06-16
2008-06-15
No

Hi.

While porting NB 3.4rc1 to FreeBSD i found a small but annoying bug.

When a new blog is created you copy default files over to the new blog directory. That's fine, but you should not assume certain file modes.

The default files live in /usr/local/share/nanoblogger under FreeBSD an this files shouldn't be writable. Therfore you should set filemodes explicitely after copying the default files. A patch that works for me is attached.

Regards Tobias

Discussion

  • Anonymous

    Anonymous - 2008-06-15

    Patch

     
  • Anonymous

    Anonymous - 2008-06-16
    • summary: File modes for default files --> [PATCH] File modes for default files
     
  • Kevin Wood

    Kevin Wood - 2008-09-13

    Sorry for the late reply. It's been a while since I looked at your patch and had time to respond. I'm not sure I understand what the problem is, but from the way you describe it, it sounds specific to FreeBSD.

    Why couldn't you just set the files in /usr/local/share/nanoblogger to something like 644 permissions? I'm not claiming to be the expert here, I'm sure there's a good reason that even root can't write to /usr/local/share. On the few *nix systems I've observed (namely Linux and Mac OS X) most files stored in /usr/local/share have 644 permissions not 444.

    As a side note, NanoBlogger has experimental support for changing umask, but from what I understand that only effects files created not copied.

    I know some systems that have placed program files under /etc (e.g. /etc/nanoblogger/). Would that be sufficient?

    It's my opinion that this is more of a package maintainer issue, but I'm willing to give this a second look. From what I've seen, it's not that uncommon for package maintainers to automate patching a program in their post-install routines. I'm not sure what all the legal repercussions are, but it seems to happen.

    Thanks,
    Kevin

     
  • Anonymous

    Anonymous - 2008-09-13

    Well, it's been a while since I laid my hands on a linux systems so I don't know what the common sense is ;) Anyway if this is a non-issue for other systems forget it. I have an assorted set of simple patches that make nanoblogger adhere to FreeBSD policy. To make this short: Forget about it.

    I will happily maintain the FreeBSD port of nanoblogger when nb 3.4 is finally out. Keep on the good work!

    Regards Tobias

     

Log in to post a comment.

MongoDB Logo MongoDB