Older blog entries for elanthis (starting at number 194)

Ouchie

Eek, am I sore.

Friday was the day I increased most of the weights in my workout by 10 lbs., because I'd hit the upper limit on the lower weight settings. So that put me a little sorer than a normal workout. Saturday was a party in which I spent 4 hours in constant field battle with no breaks other than several short and quick gupls of water. Sunday was the last day of the Michigan Rennaissance Festival, in which I walked around all day on my already sore muscles. Thus, today, I'm having trouble moving. Seriously, I wasn't sure this morning I'd be able to get my pants on due to the pain in my back and legs reaching down to pull 'em up.

And you know what? I love it. Thrashing your body makes you feel so much more alive than sitting around doing nothing all day on a computer. Getting out and doing something is so much more fun than just sitting there. Sure, I'm in pain; that pain just means I spent my weekend well. ;-)

Festival was productive. Spent most of it sitting around talking to friends. Also picked up some items I've been wanting at last-day prices. Got a new ring (finally) for my left hand (a nice silver piece of celtic knots), a very small potion bottle necklace (useful for the LARP), and some leather armor for the upper torso (which I look quite sharp in). All in all, I spent <$400. ($290 for the armor, $40 for bracers, $30 for the ring, $12 for potion bottle, $17 for entrace fee, adds up to $389. If you add food and drink that might push it over $400, I guess.)

In any event, next weekend is the LARP again (finally), so I'm planning on having fun. I have a couple friends I'm making newbies of by bringing them out, hopefully they enjoy the experience. I'd like them to come out this event as their first versus the next, as the next it will be a lot colder, and it'll also be Halloween, meaning the big bad undead type monsters will be out, and those can be... painful. Nothing quite like a lich walking through town laying death spells on everyone in sight. Ah, the memories...

I didn't get crap down with AweMUD or my contract jobs this weekend. As I said above, I was having way too much fun doing physical activity sorts of things.

The fatigue I have right now tho from the combination of my recent insomnia and my exertions over the last several days is making it rather hard to get any work done now, though. Seriously considering heading home. Although, I suppose, I might get more work done if I stopped writing in the blog and just got to work... ;-)

To quote Ron White: "I didn't get where I am today by worrying what I'd feel like tomorrow."

[#] Comments

Bloody Joke

yeupou, haruspex: you guys need to learn how to take a joke. ;-)

Honestly, the only reason I picked MIT over the GPL was because I didn't feel like making a tarball, and didn't feel like copying the whole of the GPL license into the source file. Granted, I ended up not even feeling like including MIT license in the source file, so that reasoning is probably moot.

I'd relicense as GPL, except that also is too much effort, especially for a silly ~20 line python script.

I apologize to you for my sins against Saint Stallman and the Church of GNU. (Hint: yes, that too, was a joke.) ~_^

[#] Comments

Syndicate to Advogato

mathrick: I'm using a very simple Python script run from cron to export my WordPress entries to Advogato using the XML-RPC interface.

It needs a small table modification to the WP install; currently, it is just used to mark when an entry has been syndicated to Advogato. It does this by marking the post ID Advogato gives back when the post is made. Because it keeps the ID, it can theoretically allow you to edit a post in WP and have those edits get posted to Advogato as well. I haven't gotten my installation to do so yet, though. (I probably should, because I have made some edits to WP entries after they've been syndicated...)

I took the script, stripped out my user names and passwords, added some docs, and added an extra configuration option for the permalink address. I haven't tested these modifications, I may have introduced a bug, you are warned. Also, the permalink format is still somewhat hard-coded; you can easily change the URL, but if you are using a different permalink URL structure, you'll have to modify the code a bit. It could be made to just take a copy of the permalink format you enter into WP itself and auto-handle any WP permalink format, but I don't have much reason to do that myself. I'll take any modifications and put them on my copy; or you're free to officially maintain the script.

MIT licensed. The GPL can keep its dirty hands off my code.

You can download it here: repost.py

[#] Comments

Education

My younger sister brought home her progress report from school. On it are several scores the teacher thought we should know about, both good and bad. She thought it was important to tell us that my sister scored only a 65% on her "vacabulary" quiz.

We're writing up a progress report to send back to the teacher with my sister tomorrow. On it will be the scores: Spelling, 65%; Irony, 100%.

[#] Comments

Network Code == PITA

The Telnet Proxy for mudmagic.com is just about finished. We had some problems for the last week or so. I added a feature to track the number of connections from each host (to be able to limit them), and the linked list code had a bug that caused an infinite loop. Only, despite expecting that code to be the part causing the lockups, having debugger output to back up that hunch, and having looked directly at the line of code causing the problem some 50 times, I just couldn't see the problem. One of those instances where you just need someone other than the person who wrote the code to look it over, I guess. I rewrote the linked list code from scratch to get it working, and only afterwards did I finally see what the old code was doing wrong. Namely, when unlinking an entry, it did (last->next = current) instead of (last->next = current->next) like it was supposed to. Drat.

Anyways, I've also, having had this learning experience in writing networked code, decided to gut and rewrite the network code in AweMUD. The basics are in place and working great, although there are some more features I need to re-enable and some API cleanups to work out.

The biggest motivator to wanting the new code is an old bug in AweMUD where the connection tracking code had a bug (do you see a pattern here?) in which it would lose count and end up deciding that there were many connections from a particular host that wasn't connected at all.

The second biggest motivator is my need for perfection in my code, and the fact that the network code in AweMUD was crap. And incorrect in places. (Like wanting to call send() on a socket even though it might block.)

[#] Comments

Debuggers Are Wonderful Things

tenglin: Or, instead of crafting all that custom code and modifying tons of source files and so on, you could just learn how to use a debugger properly and get all that for free without needing to modify or hack anything. ;-)

Here's a link to the on-line version of the GDB Manual.

[#] Comments

Telnet Proxy

Mr. Ellis of MUDMagic.com offerred me a contract to develop a simple but robust telnet proxy for his site. He has made available a new Java MUD client applet. However, applets, for security reasons, can only connect to the host the applet is run from. Therefor, to be able to support connecting to all the MUDs listed on mudmagic.com, a proxy is necessary. The original coder didn't write a very nice proxy, however, as it apparantly had all sorts of lockups and the like.

The proxy I wrote for him is running much nicer. I didn't really accept the contract; I instead offerred to write it for free, as sort of a community contribution thing. It's actually my first real threaded application. And works perfectly. Go me. ^_^

It really is a super simplistic app. It listens on a port for connections. For each connection it spawns a thread. The thread waits for a single command line of the form "connect [host] [port]". Once it gets that, it checks in a list of host/port combination read in from a simple text file to see if the connection should be allowed. if so, it connects to the server, and just forwards bytes back and forth between the two connections. That's it.

I need to do a few more small features for it, and it's complete. For example, it needs to timeout connections if they aren't active. I'd also like to have it track the number of connections from each client address. Currently, we have a limit on the number of clients; a malicious user could DoS the service by just making a ton of connections. With a per address limit, it will then at least require a DDoS - and there's not a whole lot you can do about that kind of stuff anyhow.

I also noticed that I should probably clean up the code that loads in the host list. It locks and unlocks many times as it runs. (Actually, it doesn't do any locking - but calls a lot of functions that do.) A client could connect in the middle of a host list refresh and, as the list is incomplete, get booted off and flaged for trying to access a host that isn't allowed. Moving all the code to the reload function (the only function that calls the other functions) and just using one lock/unlock set would fix that.

The proxy is BSD licensed, btw.

[#] Comments

My Hero

http://primates.ximian.com/~dobey/?date=2004-09-14 - if I read that right, that means there's soon to be a simple WebDAV server for sharing data in $HOME. If it allows (or can easily be modified to allow) operation without needing GNOME and requiring system authentication for read/write access, this can fill my need for a simple WebDAV daemon for sharing files on my file server from any host running any OS. (At least, all the major OSes/desktops support WebDAV.)

Dobey rules!

[#] Comments

AweMUD Work

Getting back into the swing with AweMUD development.

I'm starting to strongly dislike the weaknesses of C++. It's a great higher level C, but that's about the best you can say. I actually sometimes think using straight C would be better, just to avoid the temptation of complexity.

I want to do some more work on the entity/object model. The current code is quite functional, but rather complex. All entities are two levels deep, except for NPC/Player, which have the Character class in between them and Entity. Entity describes both an interface and an implementation.

Entity carries a lot of baggage with it. The name/keywords stuff, events, update look, affects (when those come in), etc. I think perhaps it would be cleaner to make some other interfaces for the events stuff and so on.

I'd also like to make Zone and Room not be children of Entity, since they don't fit the real definition of what Entity is. Entity is anything which concretely exists and can be acted upon, while Room and Zone are abstract containers.

The blueprint and entity data stuff is also just... "blegh." I'm thinking perhaps it would be best to make both Entity and Character interfaces only, just give Object it's own full implementation of everything, NPC it's own, RoomExit it's own, and Player it's own.

It's also like to breakup the Object and NPC implementations; one for uniques and one for blueprinted. A blueprinted Object, for example, would not be allowed to have any of its attributes changed at all. That would so simply its implementation. Then the unique object would just carry all its own data members, simplifying its implementation.

And then of course there is the whole affects situation. Or lack thereof. I need to come up with a good implementation. Some of the above work would help. But I'm getting _really_ sick of pushing affects off. I want them in, and I want them in _now_. ;-)

Scriptix is also getting on my nerves. I should really finish off the Scriptix2 implementation and start pulling that in.

Finally, the skill and ruleset code. I need to write the AweMUD conversation of my table top rules down and put a copy in the AweMUD dist, and then start implementing it fully. The two big changes are the time system and the XP system. In the table-top game, time is turn based, which doesn't work for a MUD. Also, in the game, XP is awarded based on player feedback and GM fiat, which also doesn't work for a MUD. Most of the rest of the rules can be used unmodified.

[#] Comments

SELinux Misfeature (Again)

Just a note on yet another design misfeature in SELinux I've found. I've talked about the numerous problems that make SELinux not only impractical, but insecure by nature, before. This one has only recently occured to me, after seeing some bugs caused by (wait for it) ... SELinux misconfigurations.

This note is on how SELinux "enhances" security of the machine. The way SELinux works is by restricting rights. You take a program that is running and remove some of its powers, thereby ensuring it can only do what you want it to. When done properly, you'd remove all the process's rights and add back only those you specifically need. Of course, doing this in SELinux is a huge pain that even the experienced SELinux developers have trouble getting right for a huge number of common applications, but that's not today's warning.

No, the problem is that SELinux works by removing rights. Say you have a program which needs to have certain privileges that normal applications run by normal users don't have. Since SELinux can't grant privileges, only revoke them, you must first give the program elevated privileges. For example, making it setuid root. Then you use SELinux to remove those root privileges you don't need, giving you what you do need.

Aside from the problem noted above in how hard it might be to make sure you revoke everything necessary, there is still the problem where the file system gets out of sync with the intended SELinux access controls (you lose the SELinux tags on the file, for example) or in which the machine may be booted temporarly with SELinux disabled. What's the problem? You've got commands that users can execute which have root (or similar) privileges. Setuid root programs, for example. While there are certainly perfectly secure machines with setuid root apps around without SELinux, a machine that was designed with SELinux in mind may find that it can't securely cope with a lack of SELinux, or with SELinux functioning less than perfectly. SELinux is like an electronic lock that unlocks when the power goes out - when the power is out, attackers have free reign of the system.

A better electronic lock would instead stay locked when the power goes out, and simply lose the ability to unlock. In this case, SELinux wouldn't take an insecure machine and secure it; it would take a too-secure machine and open it up enough to function with all requested features.

At first it might seem a bit silly. After all, you need the machine to be usable with SELinux off to do whatever maintenance is necessary, right? The answer, of course, is that the machine *will* still be accessible. You might have to boot into single user mode, but it'd still be quite possible. With SELinux malfunctioning, the machine might stop being able to do certain tasks, but security is not compromised. The web server might not be able to serve pages to customers anymore, but attackers also won't be able to crack the customer credit card databae, either. You guarantee that at no time, ever, with or without SELinux, will the machine ever be inherently insecure. When SELinux is on, everything works as intended; when it's off, the machine is secured tighter than ever.

Such a machine would, for example, have no setuid root executable, or even any processes running as root. Not one. The entire system would be running as non-privilege users. For those apps that need classically root-only privileges, such as a network daemon opening a port below 1024, or the login program, they would still not ever at any point in time run as root; SELinux would just grant those processes the ability to access the resources they need (such as the passwd files for login).

This sort of secured system might work by even removing from the kernel any uid==0 checks. In no case will there ever be the ability for a process to run with privileges not explicitly granted to it. The only exception would be something like single-user mode, which can only be entered at boot up, of course.

[#] Comments

185 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!