CentOS 5.3 and yum-updatesd

Just found out that in CentOS 5.3 (and perhaps in upstream RHEL too) the automatic update yum-updatesd is not working anymore. There is a hint in the Release Notes.

The concerning bug report speaks of an minor issue. In my opinion its a major issue! Automatic updates do not work anymore and you don’t even get notified about that fact!

Update:There are some scripts out there which check for updates without the need for a special daemon. One of them is yumnotifier.

imapsync and flags

imapsync is a imap copy / sync tool based on message-id headers. It doesn’t use any state file and therefore cannot do a real two-way sync, but for just copying from one to another server its a usefull tool.

The documentation states

“All flags are preserved, unread will stay unread, read will stay read, deleted will stay deleted.”.

Unfourtunately this is not true. Imapsync always adds flags, it never removes them. The issue can also be found in last version 1.285.

The absence of a flag is quite a worthwhile information, and when doing mirroring it is essentially. But the fix is easy: Just replace the single occurence of “+FLAGS” with “FLAG”, so that imap request results in not adding but replacing the flags on the destination server.

Ubuntu / Gnome and USB mass storage upper case

Sometimes it is annoying that ubuntu / Gnome opens USB mass storage devices such as sticks or cardreaders vfat partitions in uppercase by default. In order to change this adapt the mount settings in gconf path /system/storage/default_options/vfat/mount_options. gconf can be configured with the command line gconftool-2 or the graphical gconf-editor.

The gconf default setting for vfat is “shortname=mixed”. Just change it to “shortname=lower”. See also mount (8) manpage.

Regular expressions in VIM

An issue I often stumble across in VIM is the regular expression syntax (or “patterns” in VIM speak).

The main difference to other regular expression implementations is that some special meta-character have to be escaped to give them their special meaning. Its just the other way around; usually you would escape them to match the character itself.

Example: To match one ore more occurences of a digit you would normallry would write “\d+”. But in VIM you have to write “\d\+d” instead. This is also true for “\?” and “\{\}” patterns. See vim documenatation for more such patterns.

The behaviour can slightly be modified with the magic option.

pam_userdb

pam_userdb ist ein pam-Modul, welches die Authentifizierunsgdaten in einer Hash-db ablegt. Im Zusammenhang mit vsftpd wird es gerne als Account-Datenbank für virtuelle User benutzt.

Eine Konfiguration kann dann beispielsweise so aussehen:

auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_users
account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_users

Die Datei vsftpd_users ist im Dateisystem dabei als vsftpd_users.db abgelegt. Die meisten Implementierungen fügen von sich aus an den Datei-Namen ein “db” an und können mit Dateinamen-Angaben inklusive “db” nicht umgehen. Ein solcher Fall kann auch vorliegen, wenn im Log die folgende Meldung zu sehen ist:pam_userdb[759]: user_lookup: could not open database `/etc/vsftpd/vsftpd_users.db'

vsftpd_users.db wird dabei mit folgendem Befehl aus vsftpd_users.txt erzeugt: db_load -T -t hash -f vsftpd_users.txt vsftpd_users.dbvsftpd_users.db besteht dabei aus Eintragen der Form

Username1
Password1
Username2
Password2