[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how should a daemon drop privileges in a PAM-compatible way?

On Tue, 20 Nov 2007, Eric Cooper wrote:

> I wrote a daemon that is started from an init-script as root, and then
> uses setuid and setgid to drop to a less-privileged system user and
> group.
> A user discovered that the program breaks when he uses the
> libpam-tmpdir module, because TMPDIR doesn't get changed to the
> /tmp/user/NNN directory, so the daemon tries, unsuccessfully, to
> create files in /tmp.
> What is the correct way to handle this?

I'm inclined to argue that there's nothing you should do about that, at
least not anything with pam.  If it's easily possible don't do
tempfiles, but you can't start working around every broken setup out

                           |  .''`.  ** Debian GNU/Linux **
      Peter Palfrader      | : :' :      The  universal
 http://www.palfrader.org/ | `. `'      Operating System
                           |   `-    http://www.debian.org/

Reply to: