Search Results: "erich"

12 April 2007

Erich Schubert: Apologies if I'm breaking a planet

I've done a needed upgrade to my blog software. In this process, I've also been changing my blogs GUIDs. Unfortunately, this probably means that some planets or feed readers will recognize all of my postings as 'new'. Sorry about that. I'm not sure if I can somehow prevent it from happening.Every now and then I receive a mail from someone complaining that the links to my blog entries are broken. Well, they aren't. The link tag has an appropriate value. However some applications (usually involving planet) prepend the feeds base URI to the GUID field or use it in other RDF places. And then some readers seem to not know about the link tag and use that instead. So I'm now using the permalink as GUID, so it should be a bit easier for some people, since they now can just click on my entries.

11 April 2007

Erich Schubert: Debian 'etch' release party in Munich

DebianMuc release party, add yourself now. Saturday, at the Flaucher (Isar).Weather forecast for this week is great. Probably around 24 C on saturday, the warmest day this week I've heard. It will still be getting cold at night (after all, it's not summer yet, though we like pretending it is); so maybe we should meet rather early. Also make sure to bring some warmer clothes, too.Anyway, there is the Wiki and our mailinglist for organizing the party.

Erich Schubert: What "beta" means in a web site name

"Beta" is short for "BETrAying". It means the web site isn't honest to you about the benefits for you, what they are doing with the data or what they are telling you. Examples: So spelled out it would be like:
Sorry, we're not telling you the truth about our service and the benefits, and that's why we're calling the service beta; once we've found out how to do it right and still earn some money with it, we'll remove the beta sign.

Erich Schubert: What "beta" means in a web site name

"Beta" is short for "BETrAying". It means the web site isn't honest to you about the benefits for you, what they are doing with the data or what they are telling you.Examples: So spelled out it would be like:
Sorry, we're not telling you the truth about our service and the benefits, and that's why we're calling the service beta; once we've found out how to do it right and still earn some money with it, we'll remove the beta sign.

Erich Schubert: System init - part #2

Yesterday, I wrote about our init actually being /bin/sh, since all sysvinit does it start a single shell script. Today, I'm going a bit into how services are brought up with sysv-style init. I won't be writing much about runlevels, since most users will not make use of multiple runlevels anyway. So what does a typical init script in /etc/init.d do? If you want to find out yourself, consider looking at /etc/init.d/skeleton, which is a template for init scripts. A modern init script should (as required by the LSB) start with a formatted comment with metadata such as dependencies and description. This is already trying to address some shortcomings of sysv-style init, but no actual code. The first thing most init scripts do is to check if their application is actually still installed. Init scripts are sometimes created by users, or are not automatically uninstalled since being treated as 'configuration files'; so it occurs often that the init script is still around even when the service was uninstalled. So they test if they're installed and executable. Next they probably read a configuration file, usually named /etc/default/packagename, with user settings (people used to do such changes in the init script itself, but for upgrading it proved to be a lot better to put all settings the user might want to modify there). The third step is to do the requested user action, which usually is one of 'start', 'stop', 'reload' and 'restart'. Some init scripts also have extra actions such as 'status'; not all init scripts support 'reload'. Doing such an action usually means to print out a status message and launching the service in the background (usually using the 'start-stop-daemon' daemon helper, which offers functionality to e.g. record the process PID in a file or forcing applications into the background that don't do so on their own), or locating the service (usually via a PID file, again this is commonly done using start-stop-daemon) and reloading or stopping it. Upon success, they again print a status message. An init script could be as simple as:
#!/bin/sh
if [ "$1" = "start" ]; then
  /usr/local/sbin/mycheapdaemon &
fi
There are many good reasons not to do it that way, but it will work. Some characteristics of sysv-style init scripts: Keep your eyes open for the next part of this series, where I'll show how some init systems improve on these issues.

Erich Schubert: System init - part #2

Yesterday, I wrote about our init actually being /bin/sh, since all sysvinit does it start a single shell script.Today, I'm going a bit into how services are brought up with sysv-style init. I won't be writing much about runlevels, since most users will not make use of multiple runlevels anyway.So what does a typical init script in /etc/init.d do?If you want to find out yourself, consider looking at /etc/init.d/skeleton, which is a template for init scripts.A modern init script should (as required by the LSB) start with a formatted comment with metadata such as dependencies and description. This is already trying to address some shortcomings of sysv-style init, but no actual code.The first thing most init scripts do is to check if their application is actually still installed. Init scripts are sometimes created by users, or are not automatically uninstalled since being treated as 'configuration files'; so it occurs often that the init script is still around even when the service was uninstalled. So they test if they're installed and executable.Next they probably read a configuration file, usually named /etc/default/packagename, with user settings (people used to do such changes in the init script itself, but for upgrading it proved to be a lot better to put all settings the user might want to modify there).The third step is to do the requested user action, which usually is one of 'start', 'stop', 'reload' and 'restart'. Some init scripts also have extra actions such as 'status'; not all init scripts support 'reload'. Doing such an action usually means to print out a status message and launching the service in the background (usually using the 'start-stop-daemon' daemon helper, which offers functionality to e.g. record the process PID in a file or forcing applications into the background that don't do so on their own), or locating the service (usually via a PID file, again this is commonly done using start-stop-daemon) and reloading or stopping it. Upon success, they again print a status message.An init script could be as simple as:
#!/bin/sh
if [ "$1" = "start" ]; then
  /usr/local/sbin/mycheapdaemon &
fi
There are many good reasons not to do it that way, but it will work.Some characteristics of sysv-style init scripts: Keep your eyes open for the next part of this series, where I'll show how some init systems improve on these issues.[Update: next part]

10 April 2007

Mike Hommey: Browser detection

Erich, the Gecko version number is pretty meaningless. With mozilla releases, the date reflects when the build was done. Which means if you build Firefox 1.5 today, it will get a Gecko/20070410 string. With Debian releases (except icedove), the date reflects the date for the client.mk in the source tarball, which is one of the last file upstream touches before a release. This helps having the same date for all 11 architectures (even after a binNMU) and is somehow more significant, but still not that much. There are, at the moment, 3 main branches for Gecko-based code: MOZILLA_1_8_0_BRANCH, MOZILLA_1_8_BRANCH and HEAD. The latter currently contains Gecko 1.9 alpha, Firefox 3.0 alpha, etc., and will eventually be branched to a MOZILLA_1_9_BRANCH or something similar when going in beta. The other branches are respectively for Gecko 1.8.0.x (Firefox 1.5.0.x, Thunderbird 1.5.0.x, Seamonkey 1.0.y, Xulrunner 1.8.0.x) and Gecko 1.8.1.x (Firefox 2.0.0.x, Thunderbird 2.0.0.x (not yet released), Xulrunner 1.8.1.x). [ In Debian Etch, we have Iceweasel 2.0.0.3 (Gecko 1.8.1.3), Iceape 1.0.8 (originally Gecko 1.8.0.10 but patched at version 1.8.0.11), Icedove 1.5.0.10 (Gecko 1.8.0.10 ; changes from version 1.8.0.11 didn’t make it, but they don’t affect the mailer code), and Xulrunner 1.8.0.11 (Gecko 1.8.0.11). The latter is used by kazehakase, galeon and epiphany. ] Whenever a new security release for Firefox 1.5.0.x and other products from the Gecko 1.8.0.x branch are done, the Gecko date obviously changes, and doesn’t reflect the fact that it’s an older Gecko than that of Firefox 2.0.0.x… Now if you take a closer look to the user agent string, you’ll see something that is actually more significant than the Gecko date, i.e. the Gecko revision, such as “rv:1.8.0.11″ in “Mozilla/5.0 (X11; U; Linux i686; ja_JP; rv:1.8.0.11) Gecko/20070324″

Erich Schubert: On System Init part 1

I thought I could write a multi part blog series about init systems (with the obvious goal of convincing some more people we should properly support other init systems as well). In the first step, I'll have short look at our current init. First of all, our init isn't really /sbin/init from the sysvinit. The real work is done by /bin/sh, so usuall bash or dash. Using the latter can already cut down boot time for you by a few seconds, according to some people. The init process is indeed used to kickoff the system, but it's in fact not doing much. Pretty much all it does is described by /etc/inittab. If you havn't ever had a look at this file, maybe you should now. During a typical system boot, init is doing three things:
  1. Start /etc/init.d/rcS
  2. Start /etc/init.d/rc 2
  3. Start the gettys (console logins)
other tasks it handles is pretty much waiting for Ctrl+Alt+Del and if someone triggers a shutdown. The actual shutdown work is again done by a shell script - /etc/init.d/rc 6 So my claim that our init system actually is /bin/sh isn't really far off, is it? Some random notes: Maybe tomorrow I'll write a bit about features of other init systems, and what benefits they offer. Maybe also on why the SELinux strict policy doesn't really like this way of starting and stopping services because of isolation issues. Or on that there are two types of things happening at init. [Update: next post in this series.]

Erich Schubert: On System Init part 1

I thought I could write a multi part blog series about init systems (with the obvious goal of convincing some more people we should properly support other init systems as well).In the first step, I'll have short look at our current init.First of all, our init isn't really /sbin/init from the sysvinit. The real work is done by /bin/sh, so usuall bash or dash. Using the latter can already cut down boot time for you by a few seconds, according to some people.The init process is indeed used to kickoff the system, but it's in fact not doing much. Pretty much all it does is described by /etc/inittab. If you havn't ever had a look at this file, maybe you should now.During a typical system boot, init is doing three things:
  1. Start /etc/init.d/rcS
  2. Start /etc/init.d/rc 2
  3. Start the gettys (console logins)
other tasks it handles is pretty much waiting for Ctrl+Alt+Del and if someone triggers a shutdown. The actual shutdown work is again done by a shell script - /etc/init.d/rc 6So my claim that our init system actually is /bin/sh isn't really far off, is it?Some random notes: Maybe tomorrow I'll write a bit about features of other init systems, and what benefits they offer. Maybe also on why the SELinux strict policy doesn't really like this way of starting and stopping services because of isolation issues. Or on that there are two types of things happening at init.[Update: next post in this series.]

9 April 2007

Erich Schubert: Browser detection

Don't use the browser name for capability detection. I'd like to emphasize that. For example Google Groups won't let me upload an image to my profile, because I'm not running Firefox or Internet Exploder. Well, I tried both Epiphany (which has a very clean and fast UI, unlike Firefox which is totally cluttered) and Iceweasel (which is Firefox, but with the trademark replaced). Both are using Gecko, Gecko/20070324 for Epiphany and Gecko/20070310 for Iceweasel. So I'm very sure they have the same capabilites as Firefox 2 when it comes to web sites. If you want to test for Firefox's capabilities, use the Gecko version number.. Thank you. [Update: it was suggested I point people to GeckoIsGecko.org, which has links on how to properly detect the Gecko engine, instead of relying on the browser name.] [Update: Mike Hommey pointed out that the 'Gecko/date' string is mostly meaningless, and largely is the build date; it doesn't contain tree information. Instead you should be using the "rv: 1.8.0.11" part of the User-Agent. This is also what the getGeckoRv function on the howto linked from GeckoIsGecko.org does. Oh, and Firefox 2 is not gecko 2, but IIRC uses gecko 1.8.x, just like my Epiphany.]

Erich Schubert: Renaming applications

You probably have read it alread Gaim will be renamed to Pidgin. Most likely because of AOL being unhappy with them using AIM in their name (although they support a dozen other messengers as well; getting rid of AIM in the name was also 'wanted' by the Gaim developers I guess). However, such software renames eventually cause some problems. For example, will the API also be renamed? Will libgaim become libpidgin? Will the DBus interfaces change their name? A dozen of applications might be affected by that, including the popular AdiumX messenger for OSX. (One of the prettiest I've seen so far, btw.) Other examples of such renames (and the problems caused by that) is the Mozilla chaos. Mozilla doens't allow to distribute modified versions of Firefox or Thunderbird under these names, so Debian has to replace the names (though most of our patches at some point are adopted by upstream, or they'd be okay with them, Debian also has the requirement that our users must be able to do their own modifications!). This is why etch just shipped with "Iceweasel" and "Icedove" instead. However some web sites don't test for the browsers "Gecko" version, and for example Google Groups, when trying to set the profile image, tells me I need to run Firefox or Internet Explorer. Though I'm pretty sure the function would just work fine with both Epiphany (my primary browser) and Iceweasel. The transition from "cdrecord" to "wodim" was a bit smoother. On the one hand, many application were already expecting functionality not present in the "official" cdrecord (and yes, Joerg, I know that your opinion might differ on that point - I don't care, nor does anybody else I know). On the other hand, it mostly affects programs included in the distribution, so they can be easily handled. There aren't random websites testing for it either, and custom scripts written by users can probably handled via a wrapper (this is much more difficult for libraries I guess, or the DBus API of Gaim. Fortunately for Gaim, these interfaces aren't used much, so it can be solved with a simple search and replace and recompilation in affected applications). I think when more distributions switch from Firefox to Iceweasel because of realizing that it might be important to some of their users and recommend Epiphany because of it's smoother user interface, we might also see less websites doing incorrect browser capability detection.

8 April 2007

Erich Schubert: Visualizing iptables

I've written a small parser for iptables rules in Python, and made it output GraphVis data. Byte counters are translated to line width, packet counters to line color. Dashed lines didn't receive any data so far. This is the result for my laptop's tiny firewall setup (generated by Pyroman; the double accept/drop/reject rules are mostly for cosmetic purposes, and counting data and packet totals. However the reject rule also does a 'cleaner' reject for TCP connections) Visualization of a small iptables rule setup I've ran it on a much larger firewall (~100 chains, ~600 rules; a multi-homed firewall at our university), but it becomes to messy with the dotty layout algorithm. The firewall chains generated by pyroman are pretty flat; it generates one chain per client-server combination, the INPUT etc. chains are filled with source/destination filters, the services are filtered in the second level then. Also most of the traffic is handled by connection tracking, so it boils down to having one big accept line, with little going on beyond that. So the visualization turned out to be only of partial interest (at least for Pyroman-generated firewalls. It could be useful if someone actually nests chains more levels deep). Still there is some interesting stuff I might be going to try with the iptables-save parser I've written: [P.S. Anyone aware of a GTK/Gnome application or library for visualizing graphs?]

Erich Schubert: Chinese hacking activities

Most of the time when I lookup the IP addresses used in FTP and SSH scans, they belong to some network in china. And apparently the last two times when the Asus website was modified (this time exploiting another unpatched vulnerability in Microsoft Internet Explorer, with .ani files), they were loading exploit code from certain servers in China. Well, I guess you just cannot trust their regime; if it isn't actively encouraging the hacking activities, it at least completely fails to do something about them (you might recall that China tries to censor much of the Internet, but apparently they aren't able to firewall off hackers going out?). It's hard to tell what their motivations are. I guess it's military interests (i.e. having points of attack in case of a war) combined with industrial espionage. To me this means, that I can't really trust developers from China, and that I better double-check their code. While I don't assume them to be bad guys, you never know what their government might force them to do. Sorry about that.

Erich Schubert: Debian 4.0 'etch' released

It's finally out. Happy Easter. Debian has just Yes, it's finally out. And I hope it has the high quality you've come to expect for Debian releases (which is probably why it takes us so long, apart from supporting 11 architectures in this release). Congrats, and a big thank you to all those involved, especially our release managers.

Russell Coker: SE Linux - not too difficult for new users

At http://tanso.net/selinux/ Jan-Frode Myklebust has documented his work in creating new SE Linux policy to run Googleearth on Red Hat Enterprise Linux 5. He discussed this with us on #selinux in irc.freenode.net (the main SE Linux IRC channel).

One of his later IRC comments was:
btw erich, the reason for creating this googleearth module was mostly triggered by your apparmor blog entry.. I wanted to see how much more difficult it would be to create policies in selinux compared to apparmor, and must say it wasn't too hard.

"erich" refers to Erich Schubert. His AppArmor blog entry is currently the top entry in his SE Linux list.

Erich Schubert: Upgrading Debian

I've upgraded an old woody box to etch these days. Live - I've been telling people they need to find a replacement for this machine for years now, but it's still around and playing an important role. And with 'woody' I mean 'a woody heavily played around with, with a couple of backports and exotic stuff like XFS, a custom 2.4.25 kernel with grsecurity'. Especially the latter was why I was afraid of doing the upgrade. In a first step, I incrementally upgraded everything to sarge (well, at least where the backports weren't already newer than sarge). I installed the stock sarge kernel, and prepared a reboot. The reboot was then done out of schedule, because the machine died on it's own - it has been crashing about 1-2 times a year, and it hadn't happened for some time. Judging from the logs, it was that old problem again. At second try it came up with the new kernel: I always forget to enable init ramdisks in the bootloader when switching from a custom kernel with every needed module built-in. I then continued upgrading to etch, pretty much one service at a time. Some things (I didn't do a full list; the box was running to many modified versions of packages of this being useful as upgrade reports to the release team, and it's a bit late in the schedule, too) where upgrading didn't work out of the box: But other than that, the upgrade was mostly a job for apt-get, not for me. The bad news: there is still something wrong with the machine. It doesn't crash, but spits e.g. the following to dmesg:
amavisd-new: page allocation failure. order:5, mode:0xd0
 [] __alloc_pages+0x2f8/0x370
 [] __get_free_pages+0x25/0x40
 [] kmem_getpages+0x22/0xc0
 [] cache_grow+0xba/0x180
 [] xfs_bmap_read_extents+0x36e/0x540 [xfs]
 [] cache_alloc_refill+0x16a/0x220
 [] xfs_bmap_alloc+0xe0d/0x1c60 [xfs]
 [] __kmalloc+0x74/0x80
 [] kmem_alloc+0x59/0xc0 [xfs]
...
So there is something wrong with the XFS malloc handling. This has happened twice now since the reboot. I've been suspecting XFS of being related to the servers' crashes before (which tend to occur during load; the crash which 'allowed' me to switch to 2.6 actually showed the OOM killer of that old kernel killing some inappropriate processes). After the easter holidays, I'll reboot the machine with the etch kernel, maybe this is gone then.

7 April 2007

Erich Schubert: Debian Init hackfest

I'd like to propose a Init Hackfest for Debian when etch is released. Debian includes several init systems, including sysvinit, runit, minit, initng and upstart. However, only sysvinit is really supported, and others can be used in a compability mode (and most of their benefits are gone then). So there is some work to be done here. Some init scripts probably could also use some cleanup. :-) Shortly after the release of etch is probably the best moment to work on such key parts such as the init system, since many packages are affected. I suggest to provide patches to the package maintainers and do uploads to 7-day delayed. If you are interested, maybe you could add your name to the wiki page? I also think the mailing list initscripts-ng-devel at alioth is appropriate for discussion.

Erich Schubert: Hello Planet GNOME!

I've been added to Planet GNOME (thanks jdub!), and this post is just to say hello! I havn't been a large GNOME contributor so far (I was the Debian maintainer for Galeon some years ago, thats about it), but I recently started a small DBus related project (for exploring the DBus APIs of programs), dbus-inspector, which is now hosted in the GNOME subversion repository. Other GNOME-related projects I'm thinking of: I'd like to say thank you for all the great work you did. Having been a Galeon power user, I'm by now quite convinced of the "keep it simple" approach, and I have the impression that not having so many options means that I get more work done (since I don't waste time playing around with infinite options). Thanks for that. And for providing me with a pretty and unobtrusive work environment for the last 8 years or so.

6 April 2007

Erich Schubert: Debtas AI (it's, like, alive!)

These days I picked up the Debtags AI topic again (so yes, development is alive, not the AI). Some people will remember this topic, it was a Google Summer of Code project. The project didn't really complete back then. Since my thesis isn't coming along too well (I don't know how to explain to my professor what I'm trying to achieve...), I've been playing around with different stuff. So I've picked up the Debtags AI again. Back at the end of the GSoC or sometime later last summer, I had started a rewrite of the Debtags AI stuff in C++ for performance reasons. I also had some ideas on how to make it scale better and on how to improve the results. I think I've reached an interesting state now; training time of the AI is down to a few minutes (remember it was a few days when the GSoC started?), so I managed to cut off another order of magnitude. Evaluation of a text against the database (i.e. for every tag) happens in the fraction of a second. This AI is turning out quite well now. I have one more idea for a trick that could improve the results from an algorithm side, and one from the data side. Enrico is already looking at how to integrate it with the web apps. :-) And I also want to scale it up further. How about using it to classify web pages by their text content? I already have an idea on how to get some good training data... maybe I should consider writing a business plan instead of a diploma thesis...

4 April 2007

Erich Schubert: More comments on AppArmor

Some more comments on AppArmor, since some people might see my previous post just as being disappointed by seeing it in Ubuntu, and not much work on SELinux. First of all, I should note that I don't have any SELinux systems I'm responsible for anymore. They still run SELinux in strict and are doing well, but I'm no longer responsible for them. So I'm actually pretty much out of SELinux development nowadays. I did some occasional policy merge to monitor policy development, and when I tried VMware, I even setup a SELinux system to check the current state. But I wouldn't call myself an active developer or even user. So I don't think I'm as biased as you might think I am. Some things why I don't trust the AppArmor people: Instead they should be honest about what AppArmor can, and what it can not do. I don't doubt that it can be used to make exploits with specially crafted PDF files in evince and such simple viewer applications a lot harder, but their security is not as thorough and complete as SELinux. They are potentially vulnerable to some attacks caused by their path name based approach, or that they cannot do MAC for files with unpredictable names such as most of /proc (e.g. /proc/1234/cmdline), any kind of sockets or when file descriptors are passed from one application to another. They should also admit that since SELinux initially assigns file labels by very similar pathname/filename patterns as AppArmor uses, it maybe isn't that much harder to setup in this aspect... In fact, it's much easier in SELinux to add an additional location for font files, since all the application policies don't need to be modified or reloaded, just the new font directory needs to be relabeled. In AppArmor, you'd need to modify an 'abstraction', then reload any policy that depends on this abstraction (you probably can only reload all at the same time, so that's not too hard). To anyone with a tiny bit of computer science knowledge, it should also be obvious that the performance of reconstructing the file path and matching it against a large set of filename globs (AppArmor) necessarily is slower than just using the security label in to the files attributes (SELinux, where this globbing was done once when doing the relabeling); any performance difference that shows that SELinux is slower than AppArmor is probably caused by SELinux doing a lot more security checks than AppArmor. So even AppArmor could benefit from using labeled security... I'm cool with saying that AppArmor is easier to get started with than SELinux, but they need to be honest about the differences to SELinux and the problems with AppArmor.

Next.

Previous.