changeset 56:ba64f43f07f7 draft

umask of ML/spool changed.
author HIROSE Yuuji <yuuji@gentei.org>
date Fri, 22 Jun 2012 22:30:39 +0900
parents 9a82edb295ca
children d089cb42619d
files after5.rb
diffstat 1 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/after5.rb	Thu Jun 21 22:09:24 2012 +0900
+++ b/after5.rb	Fri Jun 22 22:30:39 2012 +0900
@@ -4,7 +4,7 @@
 # Associative Scheduling Table - after5
 # (C)2003, 2004, 2006, 2008, 2012 by HIROSE Yuuji [yuuji<at>gentei.org]
 # $Id: after5.rb,v 1.19 2012/04/01 11:52:25 yuuji Exp yuuji $
-# Last modified Thu Jun 21 21:42:34 2012 on firestorm
+# Last modified Thu Jun 21 22:53:35 2012 on firestorm
 # See http://www.gentei.org/~yuuji/software/after5/
 # このスクリプトはEUCで保存してください。
 $hgid = <<_HGID_.split[1..-2].join(" ")
@@ -1670,12 +1670,12 @@
 	# exec(@attr['mail'], "-s", subject, to)
         recipient = rcptto || to.split(/,\s*|\s+/)
         #p recipient
-        File.umask(077)
+        File.umask(027)
         if spoolto && spoolto.is_a?(String) &&
             proc {
             require 'fileutils'
             begin
-              test(?d, spoolto) or FileUtils.mkdir_p(spoolto, 0700)
+              test(?d, spoolto) or FileUtils.mkdir_p(spoolto, 0750)
               test(?w, spoolto)
             rescue
               nil
@@ -2732,9 +2732,22 @@
     if viamail then
       prohibitviahttp()
       name = ENV['DEFAULT']
+      unless grepgroup(name)
+        sendMail(@opt['maintainer'], "no group",
+                 sprintf("Invalid group address: %s(%s@%s)\nSent by %s\n" +
+                         "URL: %s\n------------\n",
+                         name, ENV['LOCAL'], ENV['HOST'], ENV['SENDER'],
+                         @opt['url']) +
+                 "> "+STDIN.readlines.join("> "))
+        exit 0                  # should exit 0 in mail mode
+      end
     else                        # via http
       return nil unless checkauth
       name = @params['name'].untaint
+      unless grepgroup(name)
+        @O.print @H.p("No such group: #{name}")
+        return true
+      end
       nick = @sc.nickname(@params['user'])
       from = sprintf("%s <%s>", nick, @params['user'])
       body = @params['body'].gsub("\r", "").untaint
@@ -2766,7 +2779,7 @@
       "X-ML-Name" => name,
       "X-ML-URI" => sprintf("%s?-groupman+%s", @opt['url'], name),
       "Errors-to" => @opt['maintainer'],
-      "Return-path" => @opt['maintainer']}
+      "Return-path" => @opt['maintainer']} # This should be ML-owner
     Dir.chdir @mydir
     rcpts = if grepgroup(name)
               @sc.members(name)

yatex.org