Skip to contentSkip to conversation

Bug#617242: mlmmj-make-ml does not ensure correct permissions

mlmmj Thomas Goirand 4 participants 7 messages Mar 7, 2011 – Mar 8, 2011

lore
Share & tools
lore
#0 lore raw

Someone sent this against the MLMMJ package in Debian. I found it a very valid request. I think either mlmmj-make-ml should set the umask explicitly, or even better, perform some chmods.

Thomas

-------- Original Message --------
Subject: Bug#617242: mlmmj-make-ml does not ensure correct permissions for created files and directories
Resent-Date: Mon, 07 Mar 2011 13:21:02 +0000, Mon, 07 Mar 2011 13:21:05
+0000
Resent-From: Reuben Thomas <[email protected]>
Resent-To: [email protected]
Resent-CC: MLMMJ packaging team <[email protected]>
Date: Mon, 07 Mar 2011 13:16:46 +0000
From: Reuben Thomas <[email protected]>
Reply-To: Reuben Thomas <[email protected]>, [email protected]
To: Debian Bug Tracking System <[email protected]>

Package: mlmmj
Version: 1.2.17-1
Severity: minor

I have my umask set to 0027. If I run mlmmj-make-ml with sudo, then this umask is inherited, and used to create all the files and directories for a new mailing list, which is wrong. The files and directories should be explicitly chmodded to the correct permissions.

#1 lore raw

Re: [mlmmj] Fwd: Bug#617242: mlmmj-make-ml does not ensure correct

Hi,

With regard to mlmmj-make-ml.sh, I'd have some improvement ideas as well, one of them being a defaults-folder from which a control directory can be generated. I have in fact been working on this, but abandoned it because I assumed, nobody would care anyway. I might continue working on it in future. Any objections or other feature requests for mlmmj-make-ml? (Telling me this is a dumb idea is perfectly fine!)

Best regards,

Moritz

#2 lore raw

Re: [mlmmj] Fwd: Bug#617242: mlmmj-make-ml does not ensure correct

In reply to Thomas Goirand
Quoted 7 lines · Moritz Wilhelmy

With regard to mlmmj-make-ml.sh, I'd have some improvement ideas as well, one of them being a defaults-folder from which a control directory can be generated. I have in fact been working on this, but abandoned it because I assumed, nobody would care anyway. I might continue working on it in future. Any objections or other feature requests for mlmmj-make-ml? (Telling me this is a dumb idea is perfectly fine!)

I like the idea. In fact, I suggested basically the same thing in response to a related request from Thomas recently. Have a look at this:

http://mlmmj.org/archive/mlmmj/2011-01/1914.html

Another thought I just had is that it might be good to have an option to mlmmj-make-ml to symlink rather than copy texts (though it should not affect control).

Ben.

#3 lore raw

Re: [mlmmj] Fwd: Bug#617242: mlmmj-make-ml does not ensure correct

In reply to Thomas Goirand

Yeah. mlmmj-make-ml could definitely do with some enhancements like this. When integrating with web interfaces, control files often need to have the group set and be group-writable to be accessible by the webserver, too. Or even be owned by the webserver user. I guess most of this is looked after by the administrator after running mlmmj-make-ml usually, but it would probably be good for mlmmj-make-ml to give a more sensible starting point.

But what is most sensible?

- chown to the list owner and chmod 0[67]00 and do nothing about groups?
- chown to the list owner, chgrp to the mail system user, and chmod 0[67][67]0?
- something else?
- prompt the user about it?

Ben.

Quoted 32 lines · Thomas Goirand

Someone sent this against the MLMMJ package in Debian. I found it a very valid request. I think either mlmmj-make-ml should set the umask explicitly, or even better, perform some chmods.

Thomas

-------- Original Message --------
Subject: Bug#617242: mlmmj-make-ml does not ensure correct permissions for created files and directories
Resent-Date: Mon, 07 Mar 2011 13:21:02 +0000, Mon, 07 Mar 2011 13:21:05
+0000
Resent-From: Reuben Thomas<[email protected]>
Resent-To: [email protected]
Resent-CC: MLMMJ packaging team<[email protected]>
Date: Mon, 07 Mar 2011 13:16:46 +0000
From: Reuben Thomas<[email protected]>
Reply-To: Reuben Thomas<[email protected]>, [email protected]
To: Debian Bug Tracking System<[email protected]>

Package: mlmmj
Version: 1.2.17-1
Severity: minor

I have my umask set to 0027. If I run mlmmj-make-ml with sudo, then this umask is inherited, and used to create all the files and directories for a new mailing list, which is wrong. The files and directories should be explicitly chmodded to the correct permissions.

#4 lore raw

Re: [mlmmj] Fwd: Bug#617242: mlmmj-make-ml does not ensure correct

In reply to Thomas Goirand
Quoted 1 line · Ben Schmidt

Yeah. mlmmj-make-ml could definitely do with some enhancements like this.

mlmmj-make-ml is a very good example of a temporary solution becoming permanent. This is just the script I hacked together when doing some of the very first tests for 0.1.0 :)

Signature · 4 lines
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogical, with just a little bit more effort?"
                                 -- A. P. J.
#5 lore raw

Re: [mlmmj] Fwd: Bug#617242: mlmmj-make-ml does not ensure correct

In reply to Thomas Goirand
Quoted 5 lines · Moritz Wilhelmy

Hi,

With regard to mlmmj-make-ml.sh, I'd have some improvement ideas as well, one of them being a defaults-folder from which a control directory can be generated.

Do you mean like a template we would store in /etc/mlmmj/default-list-config or something similar? That's a very good idea indeed!

Quoted 2 lines

I have in fact been working on this, but abandoned it because I assumed, nobody would care anyway.

I do, and I would even more if this resolves the Debian bug chmod issue.

Quoted 2 lines

Any objections or other feature requests for mlmmj-make-ml? (Telling me this is a dumb idea is perfectly fine!)

Removing the .sh from the original distribution would be welcome: adding .sh to a shell script is forbidden in Debian, and having different naming schemes across various Unixes is an issue for a software that uses MLMMJ and is cross-unix (but I already extensively discussed the issue, others pointed out that for backward compatibility, MLMMJ should create symlinks).

Quoted 7 lines · Ben Schmidt

Yeah. mlmmj-make-ml could definitely do with some enhancements like this. When integrating with web interfaces, control files often need to have the group set and be group-writable to be accessible by the webserver, too. Or even be owned by the webserver user. I guess most of this is looked after by the administrator after running mlmmj-make-ml usually, but it would probably be good for mlmmj-make-ml to give a more sensible starting point.

DTC (my web hosting control panel) calls it from dtc / dtcgrp, and it should stay like this.

Quoted 5 lines

But what is most sensible?

- chown to the list owner and chmod 0[67]00 and do nothing about groups?
- chown to the list owner, chgrp to the mail system user, and chmod 0[67][67]0?

I think it's fine not to do chown (the calling user should own the folders, and you aren't always calling it when being root, so chown wont work), but it is important to do chmod.

Quoted 1 line

- prompt the user about it?

Please don't (unless something like --interactive-please is used, which would be btw a good option)! :)

Thomas

#6 lore raw

Re: [mlmmj] Fwd: Bug#617242: mlmmj-make-ml does not ensure correct

In reply to Thomas Goirand
Quoted 9 lines
Quoted 2 lines

Any objections or other feature requests for mlmmj-make-ml? (Telling me this is a dumb idea is perfectly fine!)

Removing the .sh from the original distribution would be welcome: adding .sh to a shell script is forbidden in Debian, and having different naming schemes across various Unixes is an issue for a software that uses MLMMJ and is cross-unix (but I already extensively discussed the issue, others pointed out that for backward compatibility, MLMMJ should create symlinks).

This has already been done in version control. Speaking of which, yeah, patches against the current revision in VC would be easier for me to apply than patches against the release, of course. Hg changeset patches even easier, or an Hg or Git repo I can pull from.

All the ideas discussed around this feature are sounding good to me.

Cheers,

Ben.

Quoted 14 lines
Quoted 5 lines

But what is most sensible?

- chown to the list owner and chmod 0[67]00 and do nothing about groups?
- chown to the list owner, chgrp to the mail system user, and chmod 0[67][67]0?

I think it's fine not to do chown (the calling user should own the folders, and you aren't always calling it when being root, so chown wont work), but it is important to do chmod.

Quoted 1 line

- prompt the user about it?

Please don't (unless something like --interactive-please is used, which would be btw a good option)! :)