History log of /freebsd-10.1-release/lib/libutil/login_tty.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 202500 17-Jan-2010 ed

Fix a regression that was introduced in r191882.

I changed login_tty() to only work when the application is not a session
leader yet. This works fine for applications in the base system, but it
turns out various applications call this function after daemonizing,
which means they already use their own session.

If setsid() fails, just call tcsetsid() on the current session.
tcsetsid() will already perform proper security checks.

Reported by: Oliver Lehmann
MFC after: 1 week


# 191882 07-May-2009 ed

Add tcsetsid(3).

The entire world seems to use the non-standard TIOCSCTTY ioctl to make a
TTY a controlling terminal of a session. Even though tcsetsid(3) is also
non-standard, I think it's a lot better to use in our own source code,
mainly because it's similar to tcsetpgrp(), tcgetpgrp() and tcgetsid().

I stole the idea from QNX. They do it the other way around; their
TIOCSCTTY is just a wrapper around tcsetsid(). tcsetsid() then calls
into an IPC framework.


# 165906 08-Jan-2007 imp

Remove California Regent's clause 3, per letter


# 121193 18-Oct-2003 markm

ANSIfy, WARNSify, CONSTify. Bit of style(9)-ify.


# 116344 14-Jun-2003 markm

Tidy up. Sort headers.


# 84225 30-Sep-2001 dillon

Add __FBSDID()s to libutil


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 40117 09-Oct-1998 jkh

Now take stdio.h out of files that don't require it.


# 40091 08-Oct-1998 jkh

All these have to include stdio.h now.


# 28179 13-Aug-1997 steve

Protect the copyright comments from reformatting by
indent and make this compile -Wall clean like the
Makefile suggests that it should. :)

Pointed out by: Bruce Evans <bde@zeta.org.au>


# 13137 01-Jan-1996 peter

Bump libutil revision after recent addition of setproctitle().

Install (optional) libutil.h with prototypes for the functions and
document this in the man page.

minor cleanups to the various routines, include the prototype file, declare
return codes etc.


# 1574 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1573,
which included commits to RCS files with non-trunk default branches.


# 1573 27-May-1994 rgrimes

BSD 4.4 Lite Lib Sources