Page MenuHomeFreeBSD

Properly patch up dirname()/basename() calls to not clobber ent->log.
ClosedPublic

Authored by ed on Sep 8 2016, 8:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 12:47 AM
Unknown Object (File)
Nov 1 2023, 6:49 PM
Unknown Object (File)
Jul 13 2023, 12:08 AM
Unknown Object (File)
Jun 26 2023, 3:43 PM
Unknown Object (File)
Jun 26 2023, 3:42 PM
Unknown Object (File)
Jun 26 2023, 3:41 PM
Unknown Object (File)
Jun 26 2023, 3:31 PM
Unknown Object (File)
Jun 16 2023, 9:42 AM
Subscribers

Details

Summary

It turns out that we had a couple of more calls to dirname()/basename()
in newsyslog(8) that assume the input isn't clobbered. This is bad,
because it apparently breaks log rotation now that the new dirname()
implementation has been merged.

Fix this by first copying the input and then calling
dirname()/basename(). While there, improve the naming of variables in
this function a bit.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ed retitled this revision from to Properly patch up dirname()/basename() calls to not clobber ent->log..
ed updated this object.
ed edited the test plan for this revision. (Show Details)
ed added reviewers: gjb, ngie.
bdrewery added a reviewer: bdrewery.
bdrewery added a subscriber: bdrewery.
bdrewery added inline comments.
usr.sbin/newsyslog/newsyslog.c
1535 ↗(On Diff #20212)

I don't see a reason for this old strdup

This revision is now accepted and ready to land.Sep 8 2016, 8:34 PM
This revision was automatically updated to reflect the committed changes.