]> git.hungrycats.org Git - linux/commitdiff
[PATCH] 2.5.6-pre3 Fix BSD accounting rlimit
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Mon, 11 Mar 2002 05:57:35 +0000 (21:57 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Mon, 11 Mar 2002 05:57:35 +0000 (21:57 -0800)
Fix rlimit on accounting file.

kernel/acct.c

index 99f44df17b49f34554264854819e5883c54457d9..a2787eb242a11d87a254e5c8ace9125220784bab 100644 (file)
@@ -311,6 +311,7 @@ static void do_acct_process(long exitcode, struct file *file)
        struct acct ac;
        mm_segment_t fs;
        unsigned long vsize;
+       unsigned long flim;
 
        /*
         * First check to see if there is enough free_space to continue
@@ -372,8 +373,14 @@ static void do_acct_process(long exitcode, struct file *file)
          */
        fs = get_fs();
        set_fs(KERNEL_DS);
+       /*
+        * Accounting records are not subject to resource limits.
+        */
+       flim = current->rlim[RLIMIT_FSIZE].rlim_cur;
+       current->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
        file->f_op->write(file, (char *)&ac,
                               sizeof(struct acct), &file->f_pos);
+       current->rlim[RLIMIT_FSIZE].rlim_cur = flim;
        set_fs(fs);
 }