From: authn <opacki@acn.waw.pl>
To: linux-kernel@vger.kernel.org
Subject: Getting the "file struct" problem.
Date: Tue, 17 Aug 2004 22:41:35 +0200 [thread overview]
Message-ID: <200408172241.35933.opacki@acn.waw.pl> (raw)
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
reply other threads:[~2004-08-17 20:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200408172241.35933.opacki@acn.waw.pl \
--to=opacki@acn.waw.pl \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®