Getting the "file struct" problem.
From: authn
Date: Tue Aug 17 2004 - 15:42:40 EST
Hello,
I need to have a uid of an owner of a some file. And i do like:
struct file *filep;
filep=filp_open(filename, 0, 0);
if (IS_ERR(filep))
return -EIO;
And then i just follow by filep->f_dentry->d_inode->i_uid. But this solution
doesnt work in all cases. The case where it doesnt work is a file with
permissions like /bin/su
-rws--x--x 1 root bin 35780 Jun 21 21:20 /bin/su*
Where read permission has only root. Then i got I/O error. How to solve it ?
Maybe there is some other way to get the dentry struct of a file?
--
Regards
apacz
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/