Un*x stuff

Little FreeBSD hints

A short document describing how to set permissions on /dev on FreeBSD 5.x/6.x.

A short document describing one way to set up printing using CUPS on FreeBSD.

Testcases for test(1)

A fairly exhaustive set of tests for test(1)'s parser, excluding XSI parts.

Download Python generator script (last modified 2011-11-30).

Ports filename database script

This is a simple script to create a database of files installable via ports.

PuTTY under FreeBSD

I will take a look at these some time after the release of 0.60.

pterm sometimes fails to set up the pty properly. FreeBSD does not allow most tty ioctls on the master side unless the slave side is open, and pterm does not guarantee that. This patch makes it open the slave side in the parent process, before fork(2), and close it after forking. Also, it fixes a wrong initialization of pty_utmp_helper_pipe, namely to 0 instead of -1. This wrong initialization can be seen in some bogus output when starting pterm.

Additionally, ownership of the pty is now treated properly: if you do not set the setuid bit on pterm, it will use if the first free pty with an accessible slave device; it will still leave the slave device wide open (allowing easy terminal emulation exploits and similar nastiness), but that cannot be helped. If you set the setuid bit, pterm will chown/chmod the pty at start and set it back to root:wheel 666 later.

Possible later additions: utmp support

Testing is invited.

Download patch (last modified 2004-12-16). Instructions: replace theexisting /usr/ports/security/putty/files/patch-pty.c with this one, then (re)install the port.

Another problem is that the port does not respect PREFIX. Also, there is no option to make pterm setuid root. Here is a fix (patch to /usr/ports/security/putty/Makefile (last modified 2004-12-16). The option is calledWITH_SETUID_PTERM.

pwait for FreeBSD

pwait was committed to FreeBSD 9-CURRENT in November 2009, and merged to 8-STABLE and 7-STABLE in December 2009.

A pwait implementation for FreeBSD. This program can wait for a process to terminate, regardless of parent-child relationship. It first appeared in Solaris.

Download tarball (last modified 2004-03-26).

err(3) for Solaris

An err(3) implementation for Solaris, taken from NetBSD pkgsrc lukemftp.

Download tarball (last modified 2004-10-16).


Back to Jilles' homepage

This page last modified: 2011-11-30

Obligatory snort activation: uid=0(root)

Created with Vim - Powered by FreeBSD - Valid HTML 4.01!