Date: Wed, 6 Jan 2010 12:42:46 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r201641 - user/ed/utmpx/lib/libulog Message-ID: <201001061242.o06Cgk7k026371@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Wed Jan 6 12:42:46 2010 New Revision: 201641 URL: http://svn.freebsd.org/changeset/base/201641 Log: Remove the utmpx interface from libulog. Deleted: user/ed/utmpx/lib/libulog/ulog_getutxent.3 user/ed/utmpx/lib/libulog/ulog_getutxent.c user/ed/utmpx/lib/libulog/ulog_internal.h user/ed/utmpx/lib/libulog/ulog_pututxline.c user/ed/utmpx/lib/libulog/ulog_setutxfile.3 user/ed/utmpx/lib/libulog/ulog_util.c Modified: user/ed/utmpx/lib/libulog/Makefile user/ed/utmpx/lib/libulog/Symbol.map user/ed/utmpx/lib/libulog/ulog.h user/ed/utmpx/lib/libulog/ulog_login.c user/ed/utmpx/lib/libulog/ulog_login_pseudo.c user/ed/utmpx/lib/libulog/utempter.c Modified: user/ed/utmpx/lib/libulog/Makefile ============================================================================== --- user/ed/utmpx/lib/libulog/Makefile Wed Jan 6 12:42:16 2010 (r201640) +++ user/ed/utmpx/lib/libulog/Makefile Wed Jan 6 12:42:46 2010 (r201641) @@ -7,32 +7,18 @@ SHLIBDIR?=/lib LIB= ulog SHLIB_MAJOR= 0 INCS= ulog.h utempter.h -SRCS= ulog.h ulog_getutxent.c ulog_internal.h ulog_login.c \ - ulog_login_pseudo.c ulog_pututxline.c ulog_util.c utempter.c +SRCS= ulog.h ulog_login.c ulog_login_pseudo.c utempter.c -MAN= ulog_getutxent.3 ulog_login.3 ulog_setutxfile.3 \ - utempter_add_record.3 -MLINKS+=ulog_getutxent.3 ulog_endutxent.3 \ - ulog_getutxent.3 ulog_getutxline.3 \ - ulog_getutxent.3 ulog_pututxline.3 \ - ulog_getutxent.3 ulog_setutxent.3 \ - ulog_login.3 ulog_login_pseudo.3 \ +MAN= ulog_login.3 utempter_add_record.3 +MLINKS+=ulog_login.3 ulog_login_pseudo.3 \ ulog_login.3 ulog_logout.3 \ ulog_login.3 ulog_logout_pseudo.3 \ - ulog_setutxfile.3 ulog_getutxuser.3 \ utempter_add_record.3 utempter_remove_added_record.3 \ utempter_add_record.3 utempter_remove_record.3 \ utempter_add_record.3 addToUtmp.3 \ utempter_remove_added_record.3 removeFromUtmp.3 \ utempter_remove_record.3 removeLineFromUtmp.3 -# Add links to <utmpx.h>-style functions. -MLINKS+=ulog_endutxent.3 endutxent.3 \ - ulog_getutxent.3 getutxent.3 \ - ulog_getutxline.3 getutxline.3 \ - ulog_pututxline.3 pututxline.3 \ - ulog_setutxent.3 setutxent.3 - VERSION_DEF= ${.CURDIR}/../libc/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map Modified: user/ed/utmpx/lib/libulog/Symbol.map ============================================================================== --- user/ed/utmpx/lib/libulog/Symbol.map Wed Jan 6 12:42:16 2010 (r201640) +++ user/ed/utmpx/lib/libulog/Symbol.map Wed Jan 6 12:42:46 2010 (r201641) @@ -3,17 +3,10 @@ */ FBSD_1.2 { - ulog_endutxent; - ulog_getutxent; - ulog_getutxline; - ulog_getutxuser; ulog_login; ulog_login_pseudo; ulog_logout; ulog_logout_pseudo; - ulog_pututxline; - ulog_setutxent; - ulog_setutxfile; addToUtmp; removeFromUtmp; Modified: user/ed/utmpx/lib/libulog/ulog.h ============================================================================== --- user/ed/utmpx/lib/libulog/ulog.h Wed Jan 6 12:42:16 2010 (r201640) +++ user/ed/utmpx/lib/libulog/ulog.h Wed Jan 6 12:42:46 2010 (r201641) @@ -30,79 +30,12 @@ #define _ULOG_H_ #include <sys/cdefs.h> -#include <sys/_timeval.h> -#include <sys/_types.h> - -#ifndef _PID_T_DECLARED -typedef __pid_t pid_t; -#define _PID_T_DECLARED -#endif - -/* - * libulog. - * - * This library is provided as a migratory tool towards <utmpx.h>. We - * cannot yet implement <utmpx.h>, because our on-disk file format lacks - * various fields. <utmpx.h> also has some shortcomings. Ideally we - * want to allow logging of user login records generated by unprivileged - * processes as well, provided that they hold a file descriptor to a - * pseudo-terminal master device. - * - * This library (or at least parts of it) will hopefully deprecate over - * time, when we provide the <utmpx.h> API. - */ - -struct ulog_utmpx { - char ut_user[32]; - char ut_id[8]; /* XXX: unsupported. */ - char ut_line[32]; - char ut_host[256]; - pid_t ut_pid; /* XXX: unsupported. */ - short ut_type; -#define EMPTY 0 -#define BOOT_TIME 1 -#define OLD_TIME 2 -#define NEW_TIME 3 -#define USER_PROCESS 4 -#define INIT_PROCESS 5 /* XXX: unsupported. */ -#define LOGIN_PROCESS 6 /* XXX: unsupported. */ -#define DEAD_PROCESS 7 -#define SHUTDOWN_TIME 8 - struct timeval ut_tv; -}; __BEGIN_DECLS -/* POSIX routines. */ -void ulog_endutxent(void); -struct ulog_utmpx *ulog_getutxent(void); -#if 0 -struct ulog_utmpx *ulog_getutxid(const struct ulog_utmpx *); -#endif -struct ulog_utmpx *ulog_getutxline(const struct ulog_utmpx *); -struct ulog_utmpx *ulog_pututxline(const struct ulog_utmpx *); -void ulog_setutxent(void); - -/* Extensions. */ -struct ulog_utmpx *ulog_getutxuser(const char *); -int ulog_setutxfile(int, const char *); -#define UTXI_TTY 0 -#define UTXI_TIME 1 -#define UTXI_USER 2 - -/* Login/logout utility functions. */ void ulog_login(const char *, const char *, const char *); void ulog_login_pseudo(int, const char *); void ulog_logout(const char *); void ulog_logout_pseudo(int); __END_DECLS -#ifdef _ULOG_POSIX_NAMES -#define utmpx ulog_utmpx -#define endutxent ulog_endutxent -#define getutxent ulog_getutxent -#define getutxline ulog_getutxline -#define pututxline ulog_pututxline -#define setutxent ulog_setutxent -#endif /* _ULOG_POSIX_NAMES */ - #endif /* !_ULOG_H_ */ Modified: user/ed/utmpx/lib/libulog/ulog_login.c ============================================================================== --- user/ed/utmpx/lib/libulog/ulog_login.c Wed Jan 6 12:42:16 2010 (r201640) +++ user/ed/utmpx/lib/libulog/ulog_login.c Wed Jan 6 12:42:46 2010 (r201641) @@ -30,13 +30,13 @@ __FBSDID("$FreeBSD$"); #include <sys/time.h> #include <paths.h> #include <string.h> - -#include "ulog_internal.h" +#include <utmpx.h> +#include "ulog.h" void ulog_login(const char *line, const char *user, const char *host) { - struct ulog_utmpx utx; + struct utmpx utx; /* Remove /dev/ component. */ if (strncmp(line, _PATH_DEV, sizeof _PATH_DEV - 1) == 0) @@ -52,13 +52,13 @@ ulog_login(const char *line, const char strncpy(utx.ut_host, host, sizeof utx.ut_host); gettimeofday(&utx.ut_tv, NULL); - ulog_pututxline(&utx); + pututxline(&utx); } void ulog_logout(const char *line) { - struct ulog_utmpx utx; + struct utmpx utx; /* Remove /dev/ component. */ if (strncmp(line, _PATH_DEV, sizeof _PATH_DEV - 1) == 0) @@ -71,5 +71,5 @@ ulog_logout(const char *line) strncpy(utx.ut_line, line, sizeof utx.ut_line); gettimeofday(&utx.ut_tv, NULL); - ulog_pututxline(&utx); + pututxline(&utx); } Modified: user/ed/utmpx/lib/libulog/ulog_login_pseudo.c ============================================================================== --- user/ed/utmpx/lib/libulog/ulog_login_pseudo.c Wed Jan 6 12:42:16 2010 (r201640) +++ user/ed/utmpx/lib/libulog/ulog_login_pseudo.c Wed Jan 6 12:42:46 2010 (r201641) @@ -34,8 +34,7 @@ __FBSDID("$FreeBSD$"); #include <stdlib.h> #include <sysexits.h> #include <unistd.h> - -#include "ulog_internal.h" +#include "ulog.h" #define _PATH_ULOG_HELPER "/usr/libexec/ulog-helper" Modified: user/ed/utmpx/lib/libulog/utempter.c ============================================================================== --- user/ed/utmpx/lib/libulog/utempter.c Wed Jan 6 12:42:16 2010 (r201640) +++ user/ed/utmpx/lib/libulog/utempter.c Wed Jan 6 12:42:46 2010 (r201641) @@ -27,7 +27,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "ulog_internal.h" +#include "ulog.h" #include "utempter.h" static int last_fd = -1;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001061242.o06Cgk7k026371>