FS#13722 - [initscripts-2009-0N] fix minilogd variable init

Attached to Project: Arch Linux
Opened by Gerardo Exequiel Pozzi (djgera) - Monday, 09 March 2009, 20:50 GMT
Last edited by Aaron Griffin (phrakture) - Monday, 09 March 2009, 21:00 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: minilogd don't log some messages

For example:
$ strace logger hola
...
connect(1, {sa_family=AF_FILE, path="/dev/log"...}, 110) = 0
send(1, "<13>Mar 9 17:28:05 root: hola\0"..., 31, MSG_NOSIGNAL) = -1 EPIPE (Broken pipe)
close(1) = 0
...

This is because in accept() addrlen should be initialized (see accept(2) manpage): "The addrlen argument is a value-result argument: the caller must initialize it to contain the size (in bytes) of the structure pointed to by addr; on return it will contain the actual size of the peer address."

Patching fixed it:
$strace logger hola
...
connect(1, {sa_family=AF_FILE, path="/dev/log"...}, 110) = 0
send(1, "<13>Mar 9 18:46:35 root: hola\0"..., 31, MSG_NOSIGNAL) = 31
close(1) = 0
...

And now, when start syslog-ng, msg appears on logs ;)
Mar 9 18:46:35 arch32 root: hola

Also init pointer *message to NULL.
This task depends upon

Closed by  Aaron Griffin (phrakture)
Monday, 09 March 2009, 21:00 GMT
Reason for closing:  Implemented
Additional comments about closing:  Pushed to git. You rule

Loading...