r23779: Change from v2 or later to v3 or later.
[gd/samba/.git] / source3 / lib / sysquotas_linux.c
index 3867c1b0f9b5b5e42d4167f994b192e105418e53..b593102966be2cdf4251ad9b9fab4b554fa6204e 100644 (file)
@@ -5,7 +5,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_QUOTA
 
+#ifndef HAVE_SYS_QUOTAS
+#ifdef HAVE_QUOTACTL_LINUX
+#undef HAVE_QUOTACTL_LINUX
+#endif
+#endif
+
 #ifdef HAVE_QUOTACTL_LINUX 
 
 #include "samba_linux_quota.h"
@@ -388,6 +394,7 @@ static int sys_set_linux_gen_quota(const char *path, const char *bdev, enum SMB_
                D.dqb_ihardlimit = (dp->ihardlimit*dp->bsize)/bsize;
                D.dqb_isoftlimit = (dp->isoftlimit*dp->bsize)/bsize;
        }
+       D.dqb_valid = QIF_LIMITS;
 
        qflags = dp->qflags;
 
@@ -519,9 +526,9 @@ int sys_set_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
                case SMB_USER_FS_QUOTA_TYPE:
                        id.uid = getuid();
 
-                       if ((ret=sys_get_linux_gen_quota(path, bdev, qtype, id, dp))) {
-                               if ((ret=sys_get_linux_v2_quota(path, bdev, qtype, id, dp))) {
-                                       ret=sys_get_linux_v1_quota(path, bdev, qtype, id, dp);
+                       if ((ret=sys_set_linux_gen_quota(path, bdev, qtype, id, dp))) {
+                               if ((ret=sys_set_linux_v2_quota(path, bdev, qtype, id, dp))) {
+                                       ret=sys_set_linux_v1_quota(path, bdev, qtype, id, dp);
                                }
                        }
 
@@ -534,9 +541,9 @@ int sys_set_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
                case SMB_GROUP_FS_QUOTA_TYPE:
                        id.gid = getgid();
 
-                       if ((ret=sys_get_linux_gen_quota(path, bdev, qtype, id, dp))) {
-                               if ((ret=sys_get_linux_v2_quota(path, bdev, qtype, id, dp))) {
-                                       ret=sys_get_linux_v1_quota(path, bdev, qtype, id, dp);
+                       if ((ret=sys_set_linux_gen_quota(path, bdev, qtype, id, dp))) {
+                               if ((ret=sys_set_linux_v2_quota(path, bdev, qtype, id, dp))) {
+                                       ret=sys_set_linux_v1_quota(path, bdev, qtype, id, dp);
                                }
                        }
 
@@ -556,5 +563,7 @@ int sys_set_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
 }
 
 #else /* HAVE_QUOTACTL_LINUX */
+ void dummy_sysquotas_linux(void);
+
  void dummy_sysquotas_linux(void){}
 #endif /* HAVE_QUOTACTL_LINUX */