From: Sankar P <psankar@novell.com>
Subject: novfs: Get proper UID when looking up inode
Patch-mainline: no
References: bnc#486997

novfs is incorrectly assigning the rights in the /var/opt/novell/nclmnt
directory. This causes nwlogin mappings to fail. 

Patch below is ported for SLED 11 SP1 and it is already submitted for
OES 2 service packs.

Ported-by: Sankar P <psankar@novell.com>
Signed-off-by: Pary D <dpary@novell.com>
Acked-by: Jan Kara <jack@suse.cz>

---
 fs/novfs/inode.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/fs/novfs/inode.c
+++ b/fs/novfs/inode.c
@@ -2760,7 +2760,11 @@ struct dentry *novfs_i_lookup(struct ino
 					}
 
 					if (!inode && ino) {
-						uid = novfs_scope_get_uid(id->Scope);
+						if (id && id->Scope) {
+							uid = novfs_scope_get_uid(id->Scope);
+						} else {
+							uid = novfs_scope_get_uid(novfs_get_scope(dentry));
+						}
 						if (novfs_lock_inode_cache(dir)) {
 							inode = novfs_get_inode (dentry->d_sb, info->mode, 0, uid, ino, &name);
 							if (inode) {
