Date: Wed, 29 Feb 2012 01:50:13 GMT From: Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> To: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/164306: update mail/mailagent to 3.1.77 and utmpx fix Message-ID: <201202290150.q1T1oDlD093341@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/164306; it has been noted by GNATS. From: Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> To: scheidell@FreeBSD.org Cc: bug-followup@FreeBSD.org Subject: Re: ports/164306: update mail/mailagent to 3.1.77 and utmpx fix Date: Wed, 29 Feb 2012 10:46:12 +0900 (JST) Thank you very much for the pointer, but I'm afraid that it is not applicable to this case. The patch for net/msend looks clean because msend already has codes for utmpx (calling get/setutxent instead of directly reading the utmp file when USE_UTMPX is defined). The patch just defines USE_UTMPX and fixes incompatibility of a member name. The actual problem (or difficulty for me) is that mailagent is a Perl script and there seems no way to obtain utmpx data structure by a Perl script (maybe except writing a C module calling set/getutxent ?). utmp-era programs can read and parse utmp file directly, but utmpx file is not directly readable (the file format (futx?) is hidden inside libc and there seems no way to read it in a portable way). CPAN has User::Utmp module, but it is not in FreeBSD ports collection. I tried to build it by myself but failed on 9.x. Also the author of mailagent seems to have a policy not to use any external modules. So I was stucked and decided to call /usr/bin/who instead, because mailagent just needs users and tty names they are on. mailagent uses them to decide which ttys to biff. I don't use biff function, but at least I want it to work as expected. I have only a little knowledge about utmpx on FreeBSD 9.x so my understanding might be wrong. If there is a clean way to access utmpx from a Perl script, I'd like to know. -- Yoshiaki Kasahara Research Institute for Information Technology, Kyushu University kasahara@nc.kyushu-u.ac.jp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202290150.q1T1oDlD093341>