From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4362 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Patch to musl to provide wtmp for Linux PAM Date: Wed, 4 Dec 2013 17:20:46 +0100 Message-ID: <20131204162046.GX1685@port70.net> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="wULyF7TL5taEdwHz" X-Trace: ger.gmane.org 1386174051 415 80.91.229.3 (4 Dec 2013 16:20:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Dec 2013 16:20:51 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4366-gllmg-musl=m.gmane.org@lists.openwall.com Wed Dec 04 17:20:59 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1VoFC6-0001v0-Ue for gllmg-musl@plane.gmane.org; Wed, 04 Dec 2013 17:20:59 +0100 Original-Received: (qmail 19502 invoked by uid 550); 4 Dec 2013 16:20:57 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 19494 invoked from network); 4 Dec 2013 16:20:57 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:4362 Archived-At: --wULyF7TL5taEdwHz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * Raphael Cohn [2013-12-04 14:49:32 +0000]: > By the way, are there any plans to support writing to lastlog / wtmp / etc? > If not, I might create a private patch to redirect the writes to syslog. In > my view, this is where information like this belongs... http://www.openwall.com/lists/musl/2012/03/04/4 i think the policy hasn't changed since > --- musl-0.9.14.orig/include/utmpx.h 2013-09-23 22:01:11.000000000 +0100 > +++ musl-0.9.14/include/utmpx.h 2013-12-04 10:32:20.000000000 +0000 > @@ -13,6 +13,8 @@ > #include > > #define UT_LINESIZE 32 > +#define UT_NAMESIZE 32 > +#define UT_HOSTSIZE 256 > note that utmpx.h is defined in posix (part of the XSI option) and UT_ is not reserved prefix for it so even the UT_LINESIZE is a namespace violation (although a rather harmless one) i attach a current list of namespace violations in musl based on http://port70.net/~nsz/c/posix/reserved.txt > +++ musl-0.9.14/src/legacy/utmp.c 2013-12-04 14:25:40.000000000 +0000 > @@ -0,0 +1,20 @@ > +#include > +#include > +#include > +#include > +#include "libc.h" > + > +void logwtmp(const char * line, const char * name, const char * host) > +{ > + struct utmp u; > + memset(&u, 0, sizeof(u)); > + > + u.ut_pid = getpid(); > + u.ut_type = name[0] ? USER_PROCESS : DEAD_PROCESS; > + strncpy(u.ut_line, line, sizeof(u.ut_line)); > + strncpy(u.ut_name, name, sizeof(u.ut_name)); > + strncpy(u.ut_host, host, sizeof(u.ut_host)); > + gettimeofday(&(u.ut_tv), NULL); > + > + updwtmp(_PATH_WTMP, &u); > +} note that updwtmp is just a stub so this logwtmp does not do much --wULyF7TL5taEdwHz Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="nsbug.txt" arpa/inet.h accept4 arpa/inet.h gid arpa/inet.h imr_address arpa/inet.h imr_ifindex arpa/inet.h imr_interface arpa/inet.h imr_multiaddr arpa/inet.h imr_sourceaddr arpa/inet.h imsf_fmode arpa/inet.h imsf_interface arpa/inet.h imsf_multiaddr arpa/inet.h imsf_numsrc arpa/inet.h imsf_slist arpa/inet.h ip6_mtuinfo arpa/inet.h ip6m_addr arpa/inet.h ip6m_mtu arpa/inet.h ipi6_addr arpa/inet.h ipi6_ifindex arpa/inet.h ipi_addr arpa/inet.h ipi_ifindex arpa/inet.h ipi_spec_dst arpa/inet.h pid arpa/inet.h quot arpa/inet.h rem arpa/inet.h ucred arpa/inet.h uid complex.h CMPLX complex.h CMPLXF complex.h CMPLXL float.h DBL_TRUE_MIN float.h FLT_TRUE_MIN float.h LDBL_TRUE_MIN inttypes.h quot inttypes.h rem netdb.h accept4 netdb.h gid netdb.h imr_address netdb.h imr_ifindex netdb.h imr_interface netdb.h imr_multiaddr netdb.h imr_sourceaddr netdb.h imsf_fmode netdb.h imsf_interface netdb.h imsf_multiaddr netdb.h imsf_numsrc netdb.h imsf_slist netdb.h ip6_mtuinfo netdb.h ip6m_addr netdb.h ip6m_mtu netdb.h ipi6_addr netdb.h ipi6_ifindex netdb.h ipi_addr netdb.h ipi_ifindex netdb.h ipi_spec_dst netdb.h pid netdb.h quot netdb.h rem netdb.h ucred netdb.h uid netinet/in.h accept4 netinet/in.h gid netinet/in.h imr_address netinet/in.h imr_ifindex netinet/in.h imr_interface netinet/in.h imr_multiaddr netinet/in.h imr_sourceaddr netinet/in.h imsf_fmode netinet/in.h imsf_interface netinet/in.h imsf_multiaddr netinet/in.h imsf_numsrc netinet/in.h imsf_slist netinet/in.h ip6_mtuinfo netinet/in.h ip6m_addr netinet/in.h ip6m_mtu netinet/in.h ipi6_addr netinet/in.h ipi6_ifindex netinet/in.h ipi_addr netinet/in.h ipi_ifindex netinet/in.h ipi_spec_dst netinet/in.h pid netinet/in.h quot netinet/in.h rem netinet/in.h ucred netinet/in.h uid stdio.h P_tmpdir stdlib.h aligned_alloc stdlib.h at_quick_exit stdlib.h mkostemp stdlib.h quick_exit stdlib.h quot stdlib.h rem stropts.h RPROTMASK sys/shm.h used_ids sys/socket.h accept4 sys/socket.h gid sys/socket.h pid sys/socket.h ucred sys/socket.h uid sys/uio.h UIO_MAXIOV termios.h CBAUDEX termios.h CRTSCTS termios.h EXTPROC termios.h XTABS tgmath.h CMPLX tgmath.h CMPLXF tgmath.h CMPLXL unistd.h dup3 unistd.h pipe2 utmpx.h UT_LINESIZE utmpx.h e_exit utmpx.h e_termination utmpx.h updwtmpx --wULyF7TL5taEdwHz--