if (result < 0)
continue;
perm[PERM_LEN] = 0;
+
/* rwxp */
if ((perm[2] == 'x' && path[0] == '/') ||
- (perm[1] == 'w' && path[0] != '/')) {
+ (perm[1] == 'w' && path[0] != '/') ||
+ is_dotnet_file(path)) {
char* addr2 = strchr(addr, '-');
if (addr2 == NULL) {
_E("Not found '-' in addr: %s", addr);
return result;
}
+bool is_dotnet_file(const char *path)
+{
+ static const char *DOTNET_EXTS[] = { ".dll", ".exe", NULL };
+
+ bool result = false;
+ size_t p_len = strlen(path);
+ while (p_len > 0 && path[p_len-1] == '\n')
+ p_len--;
+
+ for (const char **ext = DOTNET_EXTS; *ext != NULL; ext++) {
+ size_t d_len = strlen(*ext);
+
+ if ((p_len >= d_len) &&
+ (strncasecmp(&path[p_len - d_len], *ext, d_len) == 0)) {
+ result = true;
+ break;
+ }
+ }
+ return result;
+}
+
/**
* @}
*/
bool write_to_file(const char *content, const char *base_dir, const char *file_name);
+bool is_dotnet_file(const char *path);
#ifdef __cplusplus
}
#endif