Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Kernel v2.1.100 /fs/dquot.c

Filename:/fs/dquot.c
Lines Added:15
Lines Deleted:8
Also changed in: (Previous) 2.1.89  2.1.79  2.1.69  2.1.62  2.1.55  2.1.48 
(Following) 2.1.101  2.1.103  2.1.104  2.1.107  2.1.115  2.1.118 

Location
[  2.1.100
  [  fs
     o  dquot.c

Patch

diff -u --recursive --new-file v2.1.99/linux/fs/dquot.c linux/fs/dquot.c
--- v2.1.99/linux/fs/dquot.c   Tue Mar 10 10:03:33 1998
+++ linux/fs/dquot.c   Wed May  6 10:56:05 1998
@@ -375,7 +375,8 @@
    if (inodes <= 0 || dquot->dq_flags & DQ_FAKE)
       return(QUOTA_OK);
    if (dquot->dq_ihardlimit &&
-      (dquot->dq_curinodes + inodes) > dquot->dq_ihardlimit && !fsuser()) {
+      (dquot->dq_curinodes + inodes) > dquot->dq_ihardlimit && 
+       !capable(CAP_SYS_RESOURCE)) {
       if ((dquot->dq_flags & DQ_INODES) == 0 &&
                      need_print_warning(type, dquot)) {
          sprintf(quotamessage, "%s: write failed, %s file limit reached\r\n",
@@ -387,7 +388,8 @@
    }
    if (dquot->dq_isoftlimit &&
       (dquot->dq_curinodes + inodes) > dquot->dq_isoftlimit &&
-       dquot->dq_itime && CURRENT_TIME >= dquot->dq_itime && !fsuser()) {
+       dquot->dq_itime && CURRENT_TIME >= dquot->dq_itime && 
+       !capable(CAP_SYS_RESOURCE)) {
                 if (need_print_warning(type, dquot)) {
          sprintf(quotamessage, "%s: warning, %s file quota exceeded too long.\r\n",
                  dquot->dq_mnt->mnt_dirname, quotatypes[type]);
@@ -397,7 +399,8 @@
    }
    if (dquot->dq_isoftlimit &&
       (dquot->dq_curinodes + inodes) > dquot->dq_isoftlimit &&
-       dquot->dq_itime == 0 && !fsuser()) {
+       dquot->dq_itime == 0 && 
+       !capable(CAP_SYS_RESOURCE)) {
                 if (need_print_warning(type, dquot)) {
          sprintf(quotamessage, "%s: warning, %s file quota exceeded\r\n",
                  dquot->dq_mnt->mnt_dirname, quotatypes[type]);
@@ -413,7 +416,8 @@
    if (blocks <= 0 || dquot->dq_flags & DQ_FAKE)
       return(QUOTA_OK);
    if (dquot->dq_bhardlimit &&
-      (dquot->dq_curblocks + blocks) > dquot->dq_bhardlimit && !fsuser()) {
+      (dquot->dq_curblocks + blocks) > dquot->dq_bhardlimit && 
+       !capable(CAP_SYS_RESOURCE)) {
       if ((dquot->dq_flags & DQ_BLKS) == 0 &&
                      need_print_warning(type, dquot)) {
          sprintf(quotamessage, "%s: write failed, %s disk limit reached.\r\n",
@@ -425,7 +429,8 @@
    }
    if (dquot->dq_bsoftlimit &&
       (dquot->dq_curblocks + blocks) > dquot->dq_bsoftlimit &&
-       dquot->dq_btime && CURRENT_TIME >= dquot->dq_btime && !fsuser()) {
+       dquot->dq_btime && CURRENT_TIME >= dquot->dq_btime && 
+       !capable(CAP_SYS_RESOURCE)) {
                 if (need_print_warning(type, dquot)) {
          sprintf(quotamessage, "%s: write failed, %s disk quota exceeded too long.\r\n",
                  dquot->dq_mnt->mnt_dirname, quotatypes[type]);
@@ -435,7 +440,8 @@
    }
    if (dquot->dq_bsoftlimit &&
       (dquot->dq_curblocks + blocks) > dquot->dq_bsoftlimit &&
-       dquot->dq_btime == 0 && !fsuser()) {
+       dquot->dq_btime == 0 && 
+       !capable(CAP_SYS_RESOURCE)) {
                 if (need_print_warning(type, dquot)) {
          sprintf(quotamessage, "%s: warning, %s disk quota exceeded\r\n",
                  dquot->dq_mnt->mnt_dirname, quotatypes[type]);
@@ -1039,11 +1045,12 @@
          break;
       case Q_GETQUOTA:
          if (((type == USRQUOTA && current->uid != id) ||
-              (type == GRPQUOTA && in_group_p(id))) && !fsuser())
+              (type == GRPQUOTA && in_group_p(id))) && 
+             !capable(CAP_SYS_ADMIN))
             goto out;
          break;
       default:
-         if (!fsuser())
+         if (!capable(CAP_SYS_ADMIN))
             goto out;
    }
 


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.