-EXDEV
> Suppose I give you a handle to data, how do you know what disk
> it belongs to ?
f_ino->i_sb should give you that information.
> Suppose I give you an O_RDONLY handle to a file which you then
> flink and gain write access too ?
This, I believe, is the real issue. However, we already have that
problem:
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <limits.h>
int main(int argc, char *argv[])
{
int rfd, wfd;
char filebuf[PATH_MAX];
rfd = open("testfile", O_RDONLY|O_CREAT, 0666);
/* Now rfd is a read-only file descriptor */
sprintf(filebuf, "/proc/self/fd/%d", rfd);
wfd = open(filebuf, O_RDWR);
/* Now wfd is a read-write file descriptor */
write(wfd, "Tjo fidelittan hatt!\n", 21);
return 0;
}
-hpa
-- <hpa@transmeta.com> at work, <hpa@zytor.com> in private! "Unix gives you enough rope to shoot yourself in the foot." Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/