Skip to content

Commit

Permalink
intermediate
Browse files Browse the repository at this point in the history
  • Loading branch information
dancy committed Sep 14, 2006
1 parent 4b9904f commit 3f47e31
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
7 changes: 6 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Remove pam.cl once it is integrated into the base lisp.
Make a standard function that can be called to determine if a client
is trusted based on IP address. This function will use 127.0.0.1 and
*relay-access* as its initial basis, but also needs to be able to
include data from other sources (such as drac). There should be a
list of functions that are called. Add-ons would simply add to the
list.

Improve logging.
* Output should be in a more consistent format.
Expand Down
6 changes: 5 additions & 1 deletion config.cl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;; $Id: config.cl,v 1.42 2006/08/28 01:02:22 dancy Exp $
;; $Id: config.cl,v 1.43 2006/09/14 15:09:43 dancy Exp $

(in-package :user)

Expand Down Expand Up @@ -52,6 +52,10 @@
;; included implicitly so you don't need to add them.
(defparameter *localdomains* nil)

(defparameter *trusted-client-checkers* nil)

(defparameter *trusted-clients* '("127.0.0.1"))

;; List of functions to call to determine if the client is allowed to
;; relay through this server. Function is called with arguments:
;; 1) ip address of client
Expand Down
11 changes: 10 additions & 1 deletion utils.cl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
;; Commercial Software developed at private expense as specified in
;; DOD FAR Supplement 52.227-7013 (c) (1) (ii), as applicable.
;;
;; $Id: utils.cl,v 1.20 2006/04/09 17:21:50 dancy Exp $
;; $Id: utils.cl,v 1.21 2006/09/14 15:09:43 dancy Exp $

(in-package :user)

Expand Down Expand Up @@ -180,6 +180,15 @@
(ash (logand ip #x0000ff00) 8)
(ash (logand ip #x000000ff) 24))))

(defun trusted-client-p (addr)
)

(defun addr-in-relay-access-list-p (addr)
(dolist (check *relay-access*)
(if (addr-in-network-p cliaddr (parse-addr check))
(return t))))


(defun relaying-allowed-p (addr from to)
(dolist (checker *relay-checkers*)
(if (funcall checker addr from to)
Expand Down

0 comments on commit 3f47e31

Please sign in to comment.