summaryrefslogtreecommitdiffstats
path: root/move/tools/kernel-nfsd.patch
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-10-30 16:06:45 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-10-30 16:06:45 +0000
commit3eed8bae6bd38f56995e6f4a7d2d92940c7b80f3 (patch)
tree949b47e63858255b5037b74a1c07511d73584ae1 /move/tools/kernel-nfsd.patch
parentc01090f52218db71959b80870b2e5a5b339d4c8e (diff)
downloaddrakx-3eed8bae6bd38f56995e6f4a7d2d92940c7b80f3.tar
drakx-3eed8bae6bd38f56995e6f4a7d2d92940c7b80f3.tar.gz
drakx-3eed8bae6bd38f56995e6f4a7d2d92940c7b80f3.tar.bz2
drakx-3eed8bae6bd38f56995e6f4a7d2d92940c7b80f3.tar.xz
drakx-3eed8bae6bd38f56995e6f4a7d2d92940c7b80f3.zip
kernel patch that allows logging file accesses via nfs
Diffstat (limited to 'move/tools/kernel-nfsd.patch')
-rw-r--r--move/tools/kernel-nfsd.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/move/tools/kernel-nfsd.patch b/move/tools/kernel-nfsd.patch
new file mode 100644
index 000000000..8f56eb697
--- /dev/null
+++ b/move/tools/kernel-nfsd.patch
@@ -0,0 +1,61 @@
+--- linux-2.4.22/fs/nfsd/vfs.c.pix 2003-10-17 16:27:36.000000000 +0200
++++ linux-2.4.22/fs/nfsd/vfs.c 2003-10-24 17:36:58.000000000 +0200
+@@ -418,6 +418,41 @@
+
+
+
++static unsigned int i2a(char* dest,unsigned int x) {
++ register unsigned int tmp=x;
++ register unsigned int len=0;
++ if (x>=100) { *dest++=tmp/100+'0'; tmp=tmp%100; ++len; }
++ if (x>=10) { *dest++=tmp/10+'0'; tmp=tmp%10; ++len; }
++ *dest++=tmp+'0';
++ return len+1;
++}
++
++static char *inet_ntoa_r(struct in_addr in,char* buf) {
++ unsigned int len;
++ unsigned char *ip=(unsigned char*)&in;
++ len=i2a(buf,ip[0]); buf[len]='.'; ++len;
++ len+=i2a(buf+ len,ip[1]); buf[len]='.'; ++len;
++ len+=i2a(buf+ len,ip[2]); buf[len]='.'; ++len;
++ len+=i2a(buf+ len,ip[3]); buf[len]=0;
++ return buf;
++}
++
++static char *inet_ntoa(struct in_addr in) {
++ static char buf[20];
++ return inet_ntoa_r(in,buf);
++}
++
++static void printk_debug_file_access(struct svc_rqst *rqstp, struct dentry *dentry) {
++ printk("nfsd (%s): ", inet_ntoa(rqstp->rq_addr.sin_addr));
++ while (1) {
++ if (dentry == dentry->d_parent) break;
++ printk("%s/", dentry->d_name.name);
++ dentry = dentry->d_parent;
++ }
++ printk("\n");
++}
++
++
+ /*
+ * Open an existing file or directory.
+ * The access argument indicates the type of open (read/write/lock)
+@@ -489,6 +524,8 @@
+ atomic_dec(&filp->f_count);
+ }
+ }
++ if (err == 0) printk_debug_file_access(rqstp, dentry);
++
+ out_nfserr:
+ if (err)
+ err = nfserrno(err);
+@@ -1101,6 +1138,7 @@
+ goto out_nfserr;
+ *lenp = err;
+ err = 0;
++ printk_debug_file_access(rqstp, dentry);
+ out:
+ return err;
+