Bugtraq mailing list archives

Solaris mailx(1) lockfile bug


From: optyx <optyx () UBERHAX0R NET>
Date: Sat, 30 Dec 2000 12:12:17 -0800

mailx(1) bug:
        when mailx is run it creates a lockfile in /var/mail and links it
        to /var/mail/username.lock

        open("/var/mail/rootSxa4Mv", O_RDWR|O_CREAT|O_EXCL, 0600) = 4
        link("/var/mail/rootSxa4Mv", "/var/mail/root.lock") = 0

        if the file /var/mail/username.lock exists and it can delete the
        file, mailx will hang for a while then exit, deleting the
        /var/mail/username.lock file

        if the file /var/mail/username.lock exists and cannot be deleted,
        mailx will hang and not exit.  the user can control-C out of
        mailx.

an example shell script is attached.  to fix this rm /var/mail/*.lock.

-Optyx, Uberhax0r Communications
http://www.uberhax0r.net - leeter than dog

Attachment: mailx-lock.sh
Description:


Current thread: