Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dirent: Print when reported entries count is too low. See #19. #20

Conversation

nh2
Copy link

@nh2 nh2 commented Jan 1, 2018

This fixes it for getdents() but other calls remain to have the same problem.

This fixes it for `getdents()` but other calls remain to have the same problem.
@codecov
Copy link

codecov bot commented Apr 8, 2020

Codecov Report

Merging #20 into master will increase coverage by 0.00%.
The diff coverage is 66.66%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #20   +/-   ##
=======================================
  Coverage   86.08%   86.08%           
=======================================
  Files         259      259           
  Lines       17632    17633    +1     
=======================================
+ Hits        15179    15180    +1     
  Misses       2453     2453           
Impacted Files Coverage Δ
dirent.c 60.00% <66.66%> (+0.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e32da0...beae6ae. Read the comment docs.

ldv-alt added a commit that referenced this pull request Apr 12, 2020
The old approach of allocating memory for all dentries was problematic,
fix it by fetching and printing dentries sequentially.

* dirent_types.c: New file.
* xgetdents.c: Likewise.
* xgetdents.h: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* dirent.c: Include "xgetdents.h" and "print_fields.h".
(header_size): New variable.
(print_dentry_head, decode_dentry_head, decode_dentry_tail): New
functions.
(print_old_dirent): Rewrite using print_dentry_head.
(SYS_FUNC(getdents)): Rewrite using xgetdents, decode_dentry_head,
and decode_dentry_tail.
* dirent64.c: Include "xgetdents.h", "kernel_dirent.h"
and "print_fields.h" instead of "defs.h", <dirent.h>
and "xlat/dirent_types.h".
(decode_dentry_head, decode_dentry_tail): New functions.
(SYS_FUNC(getdents64)): Rewrite using xgetdents, decode_dentry_head,
and decode_dentry_tail.

Resolves: #19
Resolves: #20
@ldv-alt ldv-alt closed this in 048fd0a Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants