bugGNU Screen - Bugs: bug #45345, utmp.c requires utmp.h include...

 
 

bug #45345: utmp.c requires utmp.h include under musl

Submitter:  None
Submitted:  Wed 17 Jun 2015 09:20:37 PM UTC
   
 
Category:  Build/Install Severity:  3 - Normal
Priority:  * 5 - Normal Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Release:  Cur Dev Sources
Fixed Release:  4.3.0 Planned Release:  None
Work Required:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 07 Jul 2015 06:20:04 PM UTC, comment #3: 

screen 4.3.0 seems to compile ok.

Anonymous
Sun 28 Jun 2015 09:30:59 PM UTC, comment #2: 

Which version did you use to test, can you retest with 4.3.0 tarball or screen-v4 branch?

os.h should already be included by screen.h

Amadeusz Sławiński <amade>
Group administrator
Sat 20 Jun 2015 10:21:35 PM UTC, comment #1: 

The relevant code (replacing getlogin()) is behind a BUGGYGETLOGIN. Is
this macro nowadays still relevant? acconfig.h says about this macro:

/*

  • If ttyslot() breaks getlogin() by returning indexes to utmp entries
  • of type DEAD_PROCESS, then our getlogin() replacement should be
  • selected by defining BUGGYGETLOGIN.

 */

In contrast, we have in configure.in:

oldlibs="$LIBS"
LIBS="$LIBS -lelf"
AC_CHECKING(SVR4)
AC_TRY_LINK([#include <utmpx.h>
],,
[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
[AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN))])]
,LIBS="$oldlibs")

So whether getlogin() will be replaced depends on whether libelf is installed...

Anonymous
Wed 17 Jun 2015 09:20:37 PM UTC, original submission:  

In order to be able to compile screen in a musl libc toolchain we need to patch src/utmp.c to include "os.h" which takes care of properly including utmp.h

Without the fix the compilation fails like this:

<pre>mips_mips32_gcc-4.8-linaro_musl-1.1.10/usr/include -I/mnt/dl/slave/brcm63xx.smp/build/staging_dir/toolchain-mips_mips32_gcc-4.8-linaro_musl-1.1.10/include  -DETCSCREENRC='"/etc/screenrc"' -DSCREENENCODINGS='"/usr/share/screen/utf8encodings"' -DHAVE_CONFIG_H -DGIT_REV=\""`git describe --always 2>/dev/null`"\" \
     -Os -pipe -mno-branch-likely -mips32 -mtune=mips32 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -Wformat -Werror=format-security -Wl,-z,now -Wl,-z,relro  -D_GNU_SOURCE utmp.c
utmp.c: In function 'getlogin':
utmp.c:850:15: error: storage size of 'u' isn't known
   struct utmp u;
               ^
utmp.c:860:38: error: invalid application of 'sizeof' to incomplete type 'struct utmp'
   while (read(fd, (char *)&u, sizeof(struct utmp)) == sizeof(struct utmp))
                                      ^</pre>

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #34250:  os-include.patch added by None (171B - text/x-patch - Proposed patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by amade (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-07-08 amade StatusNone Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.3.0
    2015-06-17 None Attached File- Added os-include.patch, #34250

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code