[asterisk-bugs] [Asterisk 0016762]: [patch] ast_filecopy: keep modes for the created file

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Mar 10 00:43:08 CST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16762 
====================================================================== 
Reported By:                romain_proformatique
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   16762
Category:                   Core/FileFormatInterface
Reproducibility:            always
Severity:                   tweak
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           1.4.29 
JIRA:                       SWP-863 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 244242 
Request Review:              
====================================================================== 
Date Submitted:             2010-02-03 10:09 CST
Last Modified:              2010-03-10 00:43 CST
====================================================================== 
Summary:                    [patch] ast_filecopy: keep modes for the created
file
Description: 
In src/main/file.c, the static function “copy” creates a new file with
the hardcoded 0600 mode.

I've attached a patch to create the new file with the copied file's modes.
====================================================================== 

---------------------------------------------------------------------- 
 (0119203) tilghman (administrator) - 2010-03-10 00:43
 https://issues.asterisk.org/view.php?id=16762#c119203 
---------------------------------------------------------------------- 
This is actually incorrect.  As stated in the open(2) documentation, the
mode passed to the open(2) call is modified with the user umask, so opening
with the mode from the previous file is not guaranteed to produce the same
results.  The better way to do this is to call fchmod(2) on the destination
file descriptor. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-03-10 00:43 tilghman       Note Added: 0119203                          
======================================================================




More information about the asterisk-bugs mailing list