Weblog

All | China | Cricket | General | IPFilter | OpenSolaris | Solaris IPFilter | USA vs.... | Zones
« Previous month (Jun 2007) | Main | Next month (Aug 2007) »
20070731 Tuesday July 31, 2007

Cookies and GMail

For a long while, I've been using GMail but have been keeping the privacy implicatins at bay by restricting what cookies I accept to mail.google.com (or gmail.com.)

Now a login to gmail requires me to accept cookies from .google.com. That's not quite so comfortable a thought!

By moving GMail services under www.google.com, it is now no longer as easy to distinguish between the cookies you want (ie those required for GMail) and those you don't want (those Google wants you to have while you search.)

( Jul 31 2007, 04:08:18 AM PDT ) Permalink Comments [4]

20070717 Tuesday July 17, 2007

Scripting with cscope

The cscope (and cscope-fast) tools provide an excellent way for us to search for particular instances of phrases, etc, inside the Solaris source code. The only downside is that the tool is interactive: it wants to use curses to ask for input and display its output. How then to make use of its knowledge in scripts?

Whilst the proper solution is to have cscope and cscope-fast modified to have a non-curses output format, a workaround that can be used in the mean time is to define a special "tty" that ensures no escape sequences (or other nasties) end up in the output.

And the end result is I can do this:


$ ~/bin/cscope-grep ip_input
1       ip.c    <global>        15017   ip_input(ill_t  *ill,   ill_rx_ring_t  *ip_ring,        mblk_t  *mp_chain,
2       ip.h    <global>        3225    extern  void    ip_input(ill_t  *,     ill_rx_ring_t    *,      mblk_t  *,
3       ip_if.c ill_capability_dls_capabl       2925    dls.dls_rx      =      (uintptr_t)ip_input;
4       ip.c    ip_rput 14993   ip_input(ill,   NULL,   mp,     NULL);
5       ip_netinfo.c    ip_ni_queue_func_impl   1293    ip_input(ill,   NULL,  packet->ni_packet,       0);
6       ip_squeue.c     ip_soft_ring_assignment 754     ip_input(ill,   NULL,   mp_chain,       mhip);                          

Update

As Alan Burlinson mentioned below, cscope-fast has a command line option, "-l", that allows for it to generate output that is not screen orientated. This can be used like this:


$ cscope-fast -l -d -0 ip_input
uts/common/inet/ip/ip.c <global> 15017 ip_input(ill_t *ill, ill_rx_ring_t *ip_ring, mblk_t *mp_chain,
uts/common/inet/ip.h <global> 3225 extern void ip_input(ill_t *, ill_rx_ring_t *, mblk_t *,
uts/common/inet/ip/ip_if.c ill_capability_dls_capable 2925 dls.dls_rx = (uintptr_t)ip_input;
uts/common/inet/ip/ip.c ip_rput 14993 ip_input(ill, NULL, mp, NULL);
uts/common/inet/ip/ip_netinfo.c ip_ni_queue_func_impl 1293 ip_input(ill, NULL, packet->ni_packet, 0);
uts/common/inet/ip/ip_squeue.c ip_soft_ring_assignment 754 ip_input(ill, NULL, mp_chain, mhip);
>>

While this gives us a leg up, there are two problems:

To wrap this up, I've used a perl script below because I'm more familiar with perl being able to carve up an array and print it out than I am with shell.


#!/bin/perl
$args = join(' ',@ARGV);
open(I, "cat /dev/null | cscope-fast -l -d $args|") || die $!;
while (<I>) {
        last if (/^>>/);
        @F = split(/ /);
        @B = splice(@F,3,$#F);
        @A = splice(@F,0,3);
        print join("\t",@A)."\t".join(' ',@B)."\n";
}
close(I);
exit(0);

Thanks Alan for the pointer and reminder.

( Jul 17 2007, 10:05:44 AM PDT ) Permalink Comments [2]

20070702 Monday July 02, 2007

Nevada, Solaris 10 Update 4 - IPFilter and Zones

Back in "Using IPFilter between zones for firewalling", I mentioned that our project to enable IPFilter between zones had been approved. This project was made a part of OpenSolaris (or nevada) late last year and in "Packet Filtering Hooks integrated into Solaris Nevada", I mentioned that the project had been successful. But the missing ingredient: how do I use this?

Out of the box, if you start using IPFilter with Solaris Zones (using shared stack instances), you won't be able to intercept those pesky packets that are going directly from zone to zone. There's a hidden button that you need to push in ipf.conf called intercept_loopback.

How is this button used? At the top of your ipf.conf file, you need to have a line like this:

set intercept_loopback true;

Note the ; at the end of the line. Similarly, to disable it, replacing "true" with "false" is sufficient.

NOTE that as this line implies, all loopback traffic will now be intercepted, including loopback (lo0) traffic, so you may need to be more careful about what you block vs pass.

( Jul 02 2007, 08:09:56 PM PDT ) Permalink Comments [0]

Calendar

RSS Feeds

Search

Links

Navigation

Referers