[asterisk-dev] These fixes ok?

Tony Mountifield tony at softins.clara.co.uk
Fri Apr 25 08:20:49 CDT 2008


In article <1209125726.7424.76.camel at luna.puzzled.xs4all.nl>,
Patrick <asterisk-list at puzzled.xs4all.nl> wrote:
> Hi,
> 
> Yesterday I tried to compile asterisk 1.2.28 on an up-to-date F8 laptop
> and bumped into some issues (http://pastebin.ca/996456). From Tilghman
> in #asterisk-dev I understood that 1.2 will not get any fixes besides
> security. So I will just create a patch.
> 
> Below are the fixes I came up with. Since I don't know C very well I
> would appreciate it if anyone could comment if these fixes are correct:
> 
> File:   channels/chan_iax2.c on line 1239
> Change: fd = open(s2, O_RDWR | O_CREAT | O_EXCL);
> To:     fd = open(s2, O_RDWR | O_CREAT | O_EXCL, 0600);
> 
> File:   channels/chan_zap.c on line 9389
> Change: myfd = open(argv[4], O_CREAT|O_WRONLY);
> To:     myfd = open(argv[4], O_CREAT|O_WRONLY, 0600);
> 
> File:   apps/app_chanspy.c on line 441
> Change: if ((fd = open(filename, O_CREAT | O_WRONLY, O_TRUNC, 0644))
> To:     if ((fd = open(filename, O_CREAT | O_WRONLY, O_TRUNC))

This last one is wrong. The error in the original is that the comma
before O_TRUNC should be a | character:

Change: if ((fd = open(filename, O_CREAT | O_WRONLY, O_TRUNC, 0644))
To:     if ((fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0644))

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-dev mailing list