summaryrefslogtreecommitdiffstats
path: root/src/appl/libpty/logwtmp.c
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2009-11-22 14:58:54 +0000
committerGreg Hudson <ghudson@mit.edu>2009-11-22 14:58:54 +0000
commit14590b7c281e1fbf68afec2f3f4104b87e6010f4 (patch)
treee3f6c44278d9a69c45fbabd4b93146a99aa29244 /src/appl/libpty/logwtmp.c
parent829462f1ae36623021b57a03aa1e4e6bb2dfbb6d (diff)
downloadkrb5-14590b7c281e1fbf68afec2f3f4104b87e6010f4.tar.gz
krb5-14590b7c281e1fbf68afec2f3f4104b87e6010f4.tar.xz
krb5-14590b7c281e1fbf68afec2f3f4104b87e6010f4.zip
Unbundle applications into separate repository
Remove libpty, gssftp, telnet, and the bsd applications from the source tree, build system, and tests. Docs still need to be updated to remove mentions of the applications. The build system should be simplified now that we're down to one configure script and don't need some of the functionality currently in aclocal.m4. ticket: 6583 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23305 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/appl/libpty/logwtmp.c')
-rw-r--r--src/appl/libpty/logwtmp.c112
1 files changed, 0 insertions, 112 deletions
diff --git a/src/appl/libpty/logwtmp.c b/src/appl/libpty/logwtmp.c
deleted file mode 100644
index 2417fb4ce1..0000000000
--- a/src/appl/libpty/logwtmp.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * pty_logwtmp: Implement the logwtmp function if not present.
- *
- * Copyright 1995, 2001 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice appear in all
- * copies and that both that copyright notice and this permission
- * notice appear in supporting documentation, and that the name of
- * M.I.T. not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Furthermore if you modify this software you must label
- * your software as modified software and not distribute it in such a
- * fashion that it might be confused with the original M.I.T. software.
- * M.I.T. makes no representations about the suitability
- * of this software for any purpose. It is provided "as is" without
- * express or implied warranty.
- *
- */
-
-#include "com_err.h"
-#include "libpty.h"
-#include "pty-int.h"
-
-#if defined(HAVE_SETUTXENT) || defined(HAVE_SETUTENT)
-#ifdef HAVE_SETUTXENT
-#define PTY_STRUCT_UTMPX struct utmpx
-#else
-#define PTY_STRUCT_UTMPX struct utmp
-#endif
-
-#ifdef NEED_LOGWTMP_PROTO
-void logwtmp(const char *, const char *, const char *);
-#endif
-
-long
-pty_logwtmp(const char *tty, const char *user, const char *host)
-{
-#ifndef HAVE_LOGWTMP
- PTY_STRUCT_UTMPX utx;
- int loggingin;
- size_t len;
- const char *cp;
- char utmp_id[5];
-#endif
-
-#ifdef HAVE_LOGWTMP
- logwtmp(tty,user,host);
- return 0;
-#else
-
- loggingin = (user[0] != '\0');
-
- memset(&utx, 0, sizeof(utx));
- strncpy(utx.ut_line, tty, sizeof(utx.ut_line));
- strncpy(utx.ut_user, user, sizeof(utx.ut_user));
-#if (defined(HAVE_SETUTXENT) && defined(HAVE_STRUCT_UTMPX_UT_HOST)) \
- || (!defined(HAVE_SETUTXENT) && defined(HAVE_STRUCT_UTMP_UT_HOST))
- strncpy(utx.ut_host, host, sizeof(utx.ut_host));
- utx.ut_host[sizeof(utx.ut_host) - 1] = '\0';
-#endif
-#ifdef HAVE_SETUTXENT
- gettimeofday(&utx.ut_tv, NULL);
-#else
- (void)time(&utx.ut_time);
-#endif
- utx.ut_pid = (loggingin ? getpid() : 0);
- utx.ut_type = (loggingin ? USER_PROCESS : DEAD_PROCESS);
-
- len = strlen(tty);
- if (len >= 2)
- cp = tty + len - 2;
- else
- cp = tty;
- snprintf(utmp_id, sizeof(utmp_id), "kr%s", cp);
- strncpy(utx.ut_id, utmp_id, sizeof(utx.ut_id));
-
-#ifdef HAVE_SETUTXENT
- return ptyint_update_wtmpx(&utx);
-#else
- return ptyint_update_wtmp(&utx);
-#endif
-
-#endif /* !HAVE_LOGWTMP */
-}
-
-#else /* !(defined(HAVE_SETUTXENT) || defined(HAVE_SETUTENT)) */
-
-long
-pty_logwtmp(const char *tty, const char *user, const char *host)
-{
- struct utmp ut;
-
-#ifdef HAVE_LOGWTMP
- logwtmp(tty,user,host);
- return 0;
-#else
-
- memset(&ut, 0, sizeof(ut));
-#ifdef HAVE_STRUCT_UTMP_UT_HOST
- strncpy(ut.ut_host, host, sizeof(ut.ut_host));
- ut.ut_host[sizeof(ut.ut_host) - 1] = '\0';
-#endif
- strncpy(ut.ut_line, tty, sizeof(ut.ut_line));
- strncpy(ut.ut_name, user, sizeof(ut.ut_name));
- return ptyint_update_wtmp(&ut);
-
-#endif /* !HAVE_LOGWTMP */
-}
-
-#endif /* !(defined(HAVE_SETUTXENT) || defined(HAVE_SETUTENT)) */