Submitted By: Mario Fetka (mario dot fetka at gmail dot com) Date: 2009-04-09 Initial Package Version: 2.0.0.444 Origin: me Upstream Status: unknown Description: make it compile with 2.6.29 diff -Naur novfs-2.0.0.444.orig/file.c novfs-2.0.0.444/file.c --- novfs-2.0.0.444.orig/file.c 2009-04-09 14:15:42.656043713 +0000 +++ novfs-2.0.0.444/file.c 2009-04-09 14:22:00.067362069 +0000 @@ -185,8 +185,13 @@ DbgPrint("novfs_Get_File_Info: Path = %s\n", Path); Info->mode = S_IFDIR | 0700; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + Info->uid = current_uid(); + Info->gid = current_gid(); +#else Info->uid = current->uid; Info->gid = current->gid; +#endif Info->size = 0; Info->atime = Info->mtime = Info->ctime = CURRENT_TIME; @@ -230,8 +235,13 @@ Info->mode &= ~(S_IWUSR); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + Info->uid = current_euid(); + Info->gid = current_egid(); +#else Info->uid = current->euid; Info->gid = current->egid; +#endif Info->size = reply->fileSize; Info->atime.tv_sec = reply->lastAccessTime; @@ -717,8 +727,13 @@ info->mode |= S_IXUSR; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + info->uid = current_euid(); + info->gid = current_egid(); +#else info->uid = current->euid; info->gid = current->egid; +#endif info->size = data->size; info->atime.tv_sec = data->lastAccessTime; diff -Naur novfs-2.0.0.444.orig/inode.c novfs-2.0.0.444/inode.c --- novfs-2.0.0.444.orig/inode.c 2009-04-09 14:15:42.650832058 +0000 +++ novfs-2.0.0.444/inode.c 2009-04-09 14:35:51.150978797 +0000 @@ -1216,7 +1216,11 @@ uid = novfs_scope_get_uid(((struct inode_data *) inode->i_private)->Scope); } else { SC_INITIALIZE(sessionId); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + uid = current_euid(); +#else uid = current->euid; +#endif } if (IS_ROOT(file->f_dentry) || // Root @@ -2707,7 +2711,11 @@ struct novfs_entry_info *info = NULL; struct inode_data *id; struct inode *inode = NULL; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + uid_t uid = current_euid(); +#else uid_t uid = current->euid; +#endif ino_t ino = 0; struct qstr name; char *buf; diff -Naur novfs-2.0.0.444.orig/scope.c novfs-2.0.0.444/scope.c --- novfs-2.0.0.444.orig/scope.c 2009-04-09 14:15:42.692656325 +0000 +++ novfs-2.0.0.444/scope.c 2009-04-09 14:45:04.925672739 +0000 @@ -92,11 +92,20 @@ task = current; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + DbgPrint("Scope_Find_Scope: %d %d %d %d\n", current_uid(), + current_euid(), current_suid(), current_fsuid()); + + //scopeId = task->euid; + UID_TO_SCHANDLE(scopeId, current_euid()); +#else DbgPrint("Scope_Find_Scope: %d %d %d %d\n", task->uid, task->euid, task->suid, task->fsuid); //scopeId = task->euid; UID_TO_SCHANDLE(scopeId, task->euid); +#endif + scope = Scope_Search4Scope(scopeId, 0, 0); @@ -108,17 +117,30 @@ scope->ScopePid = task->pid; scope->ScopeTask = task; scope->ScopeHash = 0; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + scope->ScopeUid = current_euid(); +#else scope->ScopeUid = task->euid; +#endif scope->ScopeUserName[0] = '\0'; if (!novfs_daemon_create_sessionId(&scope->SessionId)) { DbgPrint("Scope_Find_Scope2: %d %d %d %d\n", +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + current_uid(), current_euid(), + current_suid(), current_fsuid()); +#else task->uid, task->euid, task->suid, task->fsuid); +#endif memset(scope->ScopeUserName, 0, sizeof(scope->ScopeUserName)); scope->ScopeUserNameLength = 0; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + novfs_daemon_getpwuid(current_euid(), +#else novfs_daemon_getpwuid(task->euid, +#endif sizeof(scope->ScopeUserName), scope->ScopeUserName); scope->ScopeUserNameLength = @@ -477,8 +499,13 @@ rscope = NULL; rcu_read_lock(); for_each_process(task) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + if ((task->cred->uid == scope->ScopeUid) + || (task->cred->euid == scope->ScopeUid)) { +#else if ((task->uid == scope->ScopeUid) || (task->euid == scope->ScopeUid)) { +#endif rscope = scope; break; }