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

Fix file name when change attribute from a directory in linux #173

Conversation

julianmesa-gitkraken
Copy link
Contributor

@julianmesa-gitkraken julianmesa-gitkraken commented Nov 24, 2022

When you change an attribute in a directory the file name length can be 0 in the event (event->len) in linux, the event name property is optional.

           struct inotify_event {
               int      wd;       /* Watch descriptor */
               uint32_t mask;     /* Mask describing event */
               uint32_t cookie;   /* Unique cookie associating related
                                     events (for rename(2)) */
               uint32_t len;      /* Size of name field */
               char     name[];   /* Optional null-terminated name */
           };

When you change an attribute in a directory the file name length can be 0
ianhattendorf
ianhattendorf previously approved these changes Nov 28, 2022
@ianhattendorf
Copy link
Contributor

Do we need to check event->name anywhere else?

@julianmesa-gitkraken
Copy link
Contributor Author

julianmesa-gitkraken commented Nov 30, 2022

Do we need to check event->name anywhere else?

I think is not required, but I have added it for security in all code

@ianhattendorf ianhattendorf merged commit 0c4c1bd into Axosoft:master Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants