File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -71,8 +71,12 @@ void watch_list_add(int fd, const char *path)
71
71
if (len > 0 &&
72
72
strcmp (& globbuf .gl_pathv [i ][len ], "/.." ) == 0 )
73
73
continue ;
74
- selinux_restorecon (globbuf .gl_pathv [i ],
75
- r_opts .restorecon_flags );
74
+
75
+ if (selinux_restorecon (globbuf .gl_pathv [i ], r_opts .restorecon_flags ) < 0 ) {
76
+ if (errno != ENOENT )
77
+ syslog (LOG_ERR , "Unable to relabel %s: %s\n" ,
78
+ globbuf .gl_pathv [i ], strerror (errno ));
79
+ }
76
80
}
77
81
globfree (& globbuf );
78
82
}
@@ -138,8 +142,12 @@ int watch_list_find(int wd, const char *file)
138
142
0 )
139
143
exitApp ("Error allocating memory." );
140
144
141
- selinux_restorecon (path ,
142
- r_opts .restorecon_flags );
145
+ if (selinux_restorecon (path , r_opts .restorecon_flags ) < 0 ) {
146
+ if (errno != ENOENT )
147
+ syslog (LOG_ERR , "Unable to relabel %s: %s\n" ,
148
+ path , strerror (errno ));
149
+ }
150
+
143
151
free (path );
144
152
return 0 ;
145
153
}
You can’t perform that action at this time.
0 commit comments