« May 2008
SunMonTueWedThuFriSat
    
1
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
       
Today
XML

Tom Haynes

loghyr.com
excfb.com

Blogs to Gander At

Navigation

Editing

AllMarks

Referers

Today's Page Hits: 444

Powered by Roller Weblogger.

statcounter.com

clustrmaps.com

Locations of visitors to this page

technorati.com

www.alesti.org

Add to Alesti RSS Reader

South Park as I was 10 years ago

South Park Fantasy

South Park today

South Park Reality

I have more hair and it isn't so grey. :->

10 years ago, really

Toon Tom

Today, literally

Tom Today

Site notes

This page validates as XHTML 1.0, and will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device. It was created using techniques detailed at glish.com/css/.

« Simple policy evalua... | Main | Exploring pulling... »
20080122 Tuesday January 22, 2008
Subnet evaluation is working

I knew I was close to having a lot more work last night. I spent a little bit of time this morning getting the error handling done the way I wanted for the evaluation (does a return of FALSE mean an error or not to match?). I also spliced the network parsing into the command line. Still needs to be reworked a bit, a network address is not a subnet after all. But, it now handles evaluating addresses correctly:

% /a.out -r tests/hulk.txt -d 12 -u 1167 -a 192.168.3.211
4, 25, 34000, uid == 1066
5, 30, 32000, uid == 1067 || uid == 1065
6, 15, 2000, uid == 1068 && gid == 500
7, 40, 8000, gid == 500
9, 40, 8000, day == 10
15, 3, 15000, subnet ==  192.168.3.0/24
16, 3, 15000, subnet ==  10.10.20.0/24
25, 2, 48000, ip ==  192.168.2.211
1114, 30, 32000, !(uid == 1167 || uid == 1165)
1115, 40, 8000, !(day == 11)
The matching policy is: 15, 3, 15000, subnet ==  192.168.3.0/24
% ./a.out -r tests/hulk.txt -d 12 -u 1167 -a 192.168.2.211
...
The matching policy is: 25, 2, 48000, ip ==  192.168.2.211
% ./a.out -r tests/hulk.txt -d 12 -u 1167 -a 10.10.20.5
...
The matching policy is: 16, 3, 15000, subnet ==  10.10.20.0/24

Looks like I should have an option to dump the policies and by default not do it.

What I am struggling with now is how to differentiate between essentially testing this on the server and on any other machine. If it is the server, then I can state that the only command line parameters for attributes are those that I can pull out of a NFS request. I don't need anything else.

But if this is being run on a different computer, then I might need to provide some mock-up ability. E.g., I might want to set a netmask, a domain name, etc. In short, any of the secondary attributes.

I'm thinking of taking these off of the command line and putting them in a .speadm file. I want to focus on the command line looking like a NFS packet, but still allow for flexibility when debugging.

The latest code is at: speadm.c and speadm.h.


Originally posted on Kool Aid Served Daily
Copyright (C) 2008, Kool Aid Served Daily

Trackback URL: http://blogs.sun.com/tdh/entry/subnet_evaluation_is_working
Comments:

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed
Copyright (C) 2007, Kool Aid Served Daily