[Asterisk-code-review] file.c/ ast file read dirs: Truncate path after calling stat (asterisk[master])

George Joseph asteriskteam at digium.com
Tue Nov 15 15:57:43 CST 2016


Hello Kevin Harwell, Anonymous Coward #1000019,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/4447

to look at the new patch set (#3).

Change subject: file.c/__ast_file_read_dirs:  Truncate path after calling stat
......................................................................

file.c/__ast_file_read_dirs:  Truncate path after calling stat

One of the code paths in __ast_file_read_dirs will only get executed if
the OS doesn't support dirent->d_type OR if the filesystem the
particular file is on doesn't support it.  So, while standard Linux
systems support the field, some filesystems like XFS do not.  In this
case, we need to call stat() to determine whether the directory entry
is a file or directory so we append the filename to the supplied
directory path and call stat.  We forgot to truncate path back to just
the directory afterwards though so we were passing a complete file name
to the callback in the dir_name parameter instead of just the directory
name.

Change-Id: I54e4228bd8355fad65200c6df3ec4c9c8a98dfba
---
M main/file.c
1 file changed, 9 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/47/4447/3
-- 
To view, visit https://gerrit.asterisk.org/4447
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I54e4228bd8355fad65200c6df3ec4c9c8a98dfba
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-code-review mailing list