monotone-commits-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-commits-diffs] net.venge.monotone: fdec1c4e345079a110865a67ee


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone: fdec1c4e345079a110865a67ee48de8420b6ec25
Date: Thu, 20 Jan 2011 09:13:36 GMT

revision:            fdec1c4e345079a110865a67ee48de8420b6ec25
date:                2011-01-19T12:11:34
author:              address@hidden
branch:              net.venge.monotone
changelog:
explicit merge of '1c20666bbf2f1890ffda4fbd950e6887a5d8def8'
              and 'f86d847ee99339dcb1b21eec14bf8bdea2b5b997'



manifest:
format_version "1"

new_manifest [b75b3aef7140d844d8973ec3efd430cbfe4e3bf5]

old_revision [1c20666bbf2f1890ffda4fbd950e6887a5d8def8]

patch "monotone.texi"
 from [7b8697cc25916c0f68737ac70a22634eb5a5403f]
   to [4f64ca94db9ee9221dd674961f24706bb62e0eee]

old_revision [f86d847ee99339dcb1b21eec14bf8bdea2b5b997]

patch "contrib/authorize_remote_automate.lua"
 from [9d6f81a90c85dcb1a566755ce5a04d5ba2c23d2a]
   to [6c972b03ef5a025b1b792bc942bfac3a851a530e]
============================================================
--- monotone.texi	7b8697cc25916c0f68737ac70a22634eb5a5403f
+++ monotone.texi	4f64ca94db9ee9221dd674961f24706bb62e0eee
@@ -13020,7 +13020,7 @@ @section Implementation Differences
 progress messages, and prevents unexpected out-of-band output in the
 @ref{Automation} interface.
 
-If you explicitely need to write to either stdout or stderr, please use
+If you explicitly need to write to either stdout or stderr, please use
 @code{io.stdout:write} and @code{io.stderr.write}.
 
 @item os.execute, io.popen
============================================================
--- contrib/authorize_remote_automate.lua	9d6f81a90c85dcb1a566755ce5a04d5ba2c23d2a
+++ contrib/authorize_remote_automate.lua	6c972b03ef5a025b1b792bc942bfac3a851a530e
@@ -1,5 +1,6 @@
 -- Copyright (c) 2010, Thomas Keller <address@hidden>
 --                     Richard Levitte <address@hidden>
+-- License: GPLv2 or later
 --
 -- This script reads key identities from a file "remote-automate-permissions"
 -- in the configuration directory and permits those authenticating with one
@@ -30,16 +31,12 @@ do
       _safe_commands = ARA_safe_commands
    end
 
-   local _save_get_remote_automate_permitted = get_remote_automate_permitted
-   function get_remote_automate_permitted(key_identity, command, options)
-      local permfile =
-	 io.open(get_confdir() .. "/remote-automate-permissions", "r")
+   function _get_remote_automate_permitted(key_identity, permfilename)
+      if not exists(permfilename) or isdir(permfilename) then return false end
+      local permfile = io.open(permfilename, "r")
       if (permfile == nil) then
 	 return false
       end
-
-      -- See if the incoming key matches any of the key identities or
-      -- patterns found in the permissions file.
       local matches = false
       local line = permfile:read()
       while (not matches and line ~= nil) do
@@ -52,8 +49,30 @@ do
 	 end
       end
       io.close(permfile)
-      if matches then return true end
+      return matches
+   end
 
+   local _save_get_remote_automate_permitted = get_remote_automate_permitted
+   function get_remote_automate_permitted(key_identity, command, options)
+      local permfilename = get_confdir() .. "/remote-automate-permissions"
+      local permdirname = permfilename .. ".d"
+
+      -- See if the incoming key matches any of the key identities or
+      -- patterns found in the permissions file.
+      if _get_remote_automate_permitted(key_identity, permfilename) then
+	 return true
+      end
+      if isdir(permdirname) then
+	 local files = read_directory(permdirname)
+	 table.sort(files)
+	 for _,f in ipairs(files) do
+	    pf = permdirname.."/"..f
+	    if _get_remote_automate_permitted(key_identity, pf) then
+	       return true
+	    end
+	 end
+      end
+
       -- No matching key found, let's see if the command matches one the
       -- admin allowed to be performed anonymously
       for _,v in ipairs(_safe_commands) do

reply via email to

[Prev in Thread] Current Thread [Next in Thread]