| Summary: | struct utsname fields are allocated too small | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Randall Hopper <aa8vb> |
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 3.2-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
State Changed From-To: open->closed Duplicate of PR 4688, which was closed after SYS_NMLN was increased to 256. |
The version string for FreeBSD is much longer than 32 characters: > uname -v FreeBSD 3.2-RELEASE #0: Mon Jun 28 16:45:38 EDT 1999 rhh@stealth:/32_share/os/3.2/usr/src/sys/compile/WINCAST but this can't be queried via uname() by cross-platform utilities, because of a small length definition in utsname.h: /usr/include/sys/utsname.h: #define SYS_NMLN 32 struct utsname { ... char version[SYS_NMLN]; /* Version level. */ }; FWIW, on SGI IRIX: /usr/include/sys/utsname.h: #define _SYS_NMLN 257 /* 4.0 size of utsname elements.*/ /* Must be at least 257 to */ /* support Internet hostnames. */ struct utsname { char sysname[_SYS_NMLN]; char nodename[_SYS_NMLN]; char release[_SYS_NMLN]; char version[_SYS_NMLN]; Fix: Please expand sys/utsname.h's SYS_NMLN to around 256. Thanks. How-To-Repeat: Query the FreeBSD version via uname(3) and observe the truncation.