# HG changeset patch # User HIROSE Yuuji # Date 1340371839 -32400 # Node ID ba64f43f07f7e852b2ffb7b0fa9d52f3a3e4e471 # Parent 9a82edb295ca907a589f8e8298109bdb9e30246f umask of ML/spool changed. diff -r 9a82edb295ca -r ba64f43f07f7 after5.rb --- 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 [yuujigentei.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)