lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 7 Apr 2007 13:07:10 +0200 (MEST)
From:	Jan Engelhardt <jengelh@...ux01.gwdg.de>
To:	JanuGerman <doublemalam@...oo.co.uk>
cc:	linuxkernel <linux-kernel@...r.kernel.org>
Subject: Re: Two questions regarding Opening files within Kernel!


On Apr 7 2007 06:58, JanuGerman wrote:
>Hi Every one,
>
>  I have got two questions regarding opening files within the Linux 
>  kernel. If some body can help me, in sorting out this problem, i will 
>  be very thankful.
>
>1)   I have just a file path with me, an absolute path, but no dentry, 
>   no inode, no vfsmount object, which function i can call to get a 
>   "file" object associated with the absoulte file path. I have surfed 
>   arround the source code especially fs/open.c and some other files, 
>   but each function requires a parameter "mode" and "fd" beside file 
>   path. Actually, i was confuse about the "mode" parameter (and its 
>   differece with "flag"), like what to send, and secondly for "fd", i 
>   am not sure, what value to send as there is no file infact and only 
>   file path exists. Any idea?

Not sure if this is the right function, but it should get you started...

struct dentry *foooobar = lookup_one_len("/foo/bar", current->fs->root);

>2) Any functionality within linux kernel source code, to read one line 
>   per file? or some indirect way to set buffer size for one read?. 
>   That is, any existing header file for doing text I/O rather than 
>   binary within the kernel source code?

http://kernelnewbies.org/FAQ/WhyWritingFilesFromKernelIsBad
(same goes for reading)


Jan
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ