@@ -627,11 +627,11 @@ * Current implementation is an FNV-1a 32-bit */ #if UINT_MAX < 4294967295 #error Integer size is too small #endif -static unsigned long long appfs_get_path_inode(const char *path) { +static unsigned long long appfs_get_path_inode(const char *path, int uid) { unsigned int retval; const unsigned char *p; retval = 2166136261; /* FNV-1a 32-bit offset_basis */ @@ -642,10 +642,12 @@ #else /* GCC Optimized replacement */ retval += (retval << 1) + (retval << 4) + (retval << 7) + (retval << 8) + (retval << 24); #endif } + + retval += uid; return(retval); } /* @@ -664,11 +666,11 @@ return(-1); } if (appfs_path_info_cache != NULL) { - hash_idx = (appfs_get_path_inode(path) + uid) % appfs_path_info_cache_size; + hash_idx = (appfs_get_path_inode(path, uid)) % appfs_path_info_cache_size; if (appfs_path_info_cache[hash_idx]._cache_path != NULL) { if (strcmp(appfs_path_info_cache[hash_idx]._cache_path, path) == 0 && appfs_path_info_cache[hash_idx]._cache_uid == uid) { retval = 0; @@ -707,11 +709,11 @@ if (appfs_path_info_cache == NULL) { appfs_path_info_cache = calloc(appfs_path_info_cache_size, sizeof(*appfs_path_info_cache)); } - hash_idx = (appfs_get_path_inode(path) + uid) % appfs_path_info_cache_size; + hash_idx = (appfs_get_path_inode(path, uid)) % appfs_path_info_cache_size; if (appfs_path_info_cache[hash_idx]._cache_path != NULL) { free(appfs_path_info_cache[hash_idx]._cache_path); } @@ -740,11 +742,11 @@ return; } if (appfs_path_info_cache != NULL) { - hash_idx = (appfs_get_path_inode(path) + uid) % appfs_path_info_cache_size; + hash_idx = (appfs_get_path_inode(path, uid)) % appfs_path_info_cache_size; if (appfs_path_info_cache[hash_idx]._cache_path != NULL) { free(appfs_path_info_cache[hash_idx]._cache_path); appfs_path_info_cache[hash_idx]._cache_path = NULL; @@ -911,11 +913,11 @@ return(-EIO); } pathinfo->packaged = 0; - pathinfo->inode = appfs_get_path_inode(path); + pathinfo->inode = appfs_get_path_inode(path, fsuid); appfs_call_libtcl( attr_value_str = Tcl_GetString(attr_value); switch (attr_value_str[0]) {