Skip to content

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

Merged
ianhattendorf merged 2 commits intoAxosoft:masterfrom
julianmesa-gitkraken:fix-filename-change-attr-directory
Dec 2, 2022
Merged

Fix file name when change attribute from a directory in linux#173
ianhattendorf merged 2 commits intoAxosoft:masterfrom
julianmesa-gitkraken:fix-filename-change-attr-directory

Conversation

@julianmesa-gitkraken
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@julianmesa-gitkraken
Copy link
Copy Markdown
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