OpenBSD Journal

PyOpenBSD

Contributed by grey on from the almost slipped off the radar dept.

Thanks to Jose Nazario for pointing out Aldo Cortesi's PyOpenBSD to us.

The project page may be found here: http://www.nullcube.com/software/pyopenbsd.html

Below is the text from the original announcement back in November, which we unfortunately missed at that time:

PyOpenBSD is an extensive set of Python bindings for
libraries and functionality specific to the OpenBSD
operating system. PyOpenBSD's capabilities include interface
manipulation, extensive access to network statistics, an
interface to kernel events through kqueues, arbitrary
network packet parsing and manipulation, and complete pcap
bindings. For more information, please see the manual linked
from the PyOpenBSD page.

Please note that this is an Alpha release, intended mostly
to invite participation and comments from the Python and
OpenBSD communities.


http://www.nullcube.com/software/pyopenbsd.html

-- 
Aldo Cortesi
aldo at nullcube.com
http://www.nullcube.com
Off: (02) 9283 1131
Mob: 0419 492 863

This looks like it could be really useful for python and OpenBSD fans; but I think my favourite comment (or at least the funniest) on the subject as uttered by Tim Newsham may be found here.

(Comments are closed)


Comments
  1. By Dunceor (192.36.1.253) dunceor@gmail.com on

    Hmm hasn't this allready been on undeadly(deadly maybe)? I remember seeing this a few month's ago.. Or maybe it was on misc@? Well nevermind, it's a cool project anyway.

    Comments
    1. By FG (12.175.222.29) on

      At least on my system that was upgraded to current in early January.

      devel/py-openbsd

    2. By grey (207.215.223.2) on

      This is indeed a few months late, but it wasn't mentioned on (un)deadly before as a quick search reveals. I wish we'd noticed it sooner as it looks like it could be really useful (and at least gives me some incentive to give another shot at learning python which has been on my todo list for a while).

  2. By Sean Brown (204.209.209.129) on

    Has anything been done like this for Perl? Something like an OpenBSD Perl module?

    Comments
    1. By Krunch (81.240.117.88) on http://krunch.servebeer.com/~krunch/

      Since Perl is in the base system (while Python is not) it would be nice to have Perl bindings to the operating system. However this is another reason for me to learn Pyhton.

      Comments
      1. By johannes (131.130.1.143) on

        Shouldn't it be possible to do this without an additional extension, using ioctl? ioctl can be used from Perl by requiring ioctl.ph and then you could be able to "communicate[s] with the packet filter device using the ioctl interface described in pf(4)" (cite from pfctl(8))

        Admittedly I am neither able to program in Perl nor do I have much clue about ioctl, i.e. it's just a wild idea.

        Regards,
        j.

        Comments
        1. By Anonymous Coward (67.34.129.203) on

          Yes, Perl does have an ioctl function. But to use it you have to manually pack/unpack your any necessary C structs, etc. so it's not nearly as convenient as having an actual library do the "dirty" work for you, and thus being able to write stuff like this:
          use OpenBSD::pf;
          my $pf = new pf;
          $pf->block_in(from => '192.168.1.0/24', to => ANY);

    2. By B (218.102.177.2) on

      locate OpenBSD/ | egrep '\.pm'

      Comments
      1. By Anonymous Coward (67.34.129.203) on

        On my 3.6 box it returns this:
        /usr/libdata/perl5/OpenBSD/Logger.pm
        /usr/libdata/perl5/OpenBSD/Makewhatis.pm
        /usr/libdata/perl5/OpenBSD/Makewhatis/Check.pm
        /usr/libdata/perl5/OpenBSD/Makewhatis/Find.pm
        /usr/libdata/perl5/OpenBSD/Makewhatis/Formated.pm
        /usr/libdata/perl5/OpenBSD/Makewhatis/Unformated.pm
        /usr/libdata/perl5/OpenBSD/Makewhatis/Whatis.pm
        /usr/libdata/perl5/OpenBSD/PackageInfo.pm
        /usr/libdata/perl5/OpenBSD/PackageLocator.pm
        /usr/libdata/perl5/OpenBSD/PackageName.pm
        /usr/libdata/perl5/OpenBSD/PackingElement.pm
        /usr/libdata/perl5/OpenBSD/PackingList.pm
        /usr/libdata/perl5/OpenBSD/PackingOld.pm
        /usr/libdata/perl5/OpenBSD/PkgCfl.pm
        /usr/libdata/perl5/OpenBSD/RequiredBy.pm
        /usr/libdata/perl5/OpenBSD/Temp.pm
        /usr/libdata/perl5/OpenBSD/Ustar.pm
        /usr/libdata/perl5/OpenBSD/Vstat.pm
        /usr/libdata/perl5/OpenBSD/md5.pm
        Basically just a bunch of package system stuff...

  3. By antonakis (193.58.186.122) on

    hmm..this could be handy for,let's say...a curses-based obsd installer? Not that the current one isn't good imho

  4. By Anonymous Coward (81.209.99.177) on

    python is not included in the default installation, so it's already high security risk to install python from ports. and PyOpenBSD is propably even more risky, so it's only good for desktop and testing machines.

    Comments
    1. By Bert (68.50.4.145) thrashbluegrass at antisocial dot com on

      And what if it is only good for desktops?

      God knows, the first thing that popped into my mind was a GUI for a number of administrative tasks, which I am (and probably some friends are) probably going to start hacking on once the project gets to a good beta.

      Sure, you can drop into an xterm to do that, but most people I know are scared stiff of a command prompt. Making a GUI admin console is one of those things that is a prerequisite for greater usage of unix on the desktop.

      Comments
      1. By Anonymous Coward (67.34.129.203) on

        Apple already beat you to it. Do you think you can match their user interface and overall depth? Good ol' Unix is not really well-suited to serve as a desktop for Joe User, unless a huge resourceful corportation puts all their might behind it. Open Source apps and desktop environments are too disorganized and lack the drive needed to produce a polished interface that will satisfy Joe User.

        Comments
        1. By Anonymous Coward (81.209.99.177) on

          yeah that's true, but the only way they were able to do it, was sell own hardware with it, as everyone know it's hard to competive with MS. And it's a wet dream to get ultra secure desktop OS, as we did have to wait long time for ultra secure server OS that has features too.

        2. By Bert (68.50.4.145) thrashbluegrass at antisocial dot com on

          "Apple already beat you to it. Do you think you can match their user interface and overall depth?"

          Not really, and I don't really have to: if something can be offered on cheap x86 hardware, I'm willing to bet that it would compete favorably with the ultra-slick OSX at over a grand a pop for a machine. Especially since we're talking about me building something for my friends and family, not attempting to break into the commercial market.

          Hell, if Apple would port their candy to Intel hardware, we'd probably see a massive dropout of Windows desktop users.

        3. By Anonymous Coward (69.137.66.149) on

          > Apple already beat you to it. Do you think you can match their user interface and > overall depth? Certainly! Just do what everybody else does - rip 'em off.

          Comments
          1. By Anonymous Coward (64.48.234.32) on

            Apple's 'Finder' (windows explorer equiv) does not contain a "cut" option. Downloading files opens a popup asking one where to save the download, and only top-level options are available. Just two cents worth. I'll be using this bloody mini-mac for a headless server soon. I'm annoyed.

    2. By SH (82.182.103.172) on

      Just because an application is in the ports tree does not automatically make it a "high security risk" to install and use it.

      Comments
      1. By Anonymous Coward (81.209.99.177) on

        as stated somewhere in OpenBSD documents and said by theo. Stay away from the ports. (modified easier to understood format.)

        Comments
        1. By tedu (67.127.59.81) on

          somewhere? where?

        2. By nickf (67.86.34.250) on

          That was about preferring bin. packages to source ports, not about security.

        3. By jb (217.35.105.99) on

          scary. you'd think people would give a thought before yelling
          "insecure! theo said it!". boy, if you're driven by things like
          that without even trying to use your brain to reckon stuffs are
          secure (or not), i don't want to see your security policies :-P

        4. By djm@ (218.214.226.34) on

          I think you lost the actual meaning of what Theo said when you "modified" it.

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]