sysquota_linux: fix querying of group quotas
authorBjörn Jacke <bj@sernet.de>
Wed, 30 Jan 2019 16:00:36 +0000 (17:00 +0100)
committerUri Simchoni <uri@samba.org>
Sun, 3 Feb 2019 08:54:56 +0000 (09:54 +0100)
for gids we need to get/set the effective gids, same like for the uids already

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13768

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Sun Feb  3 09:54:56 CET 2019 on sn-devel-144

source3/lib/sysquotas_linux.c

index c0987de9299913740f9c1d31c72c5c898311ca48..eebb1ad1f8c442ec4dc41450e59e4be250b83563 100644 (file)
@@ -92,10 +92,10 @@ int sys_get_vfs_quota(const char *path, const char *bdev,
                case SMB_GROUP_FS_QUOTA_TYPE:
                        DEBUG(10, ("sys_get_vfs_quota: path[%s] bdev[%s] "
                                   "SMB_GROUP_FS_QUOTA_TYPE (gid[%u])\n",
-                                  path, bdev, (unsigned)getgid()));
+                                  path, bdev, (unsigned)getegid()));
 
                        if ((ret = quotactl(QCMD(Q_GETQUOTA, GRPQUOTA), bdev,
-                                           getgid(), (caddr_t)&D)) == 0) {
+                                           getegid(), (caddr_t)&D)) == 0) {
                                qflags |= QUOTAS_DENY_DISK;
                        }
 
@@ -189,10 +189,10 @@ int sys_set_vfs_quota(const char *path, const char *bdev,
                case SMB_GROUP_FS_QUOTA_TYPE:
                        DEBUG(10, ("sys_set_vfs_quota: path[%s] bdev[%s] "
                                   "SMB_GROUP_FS_QUOTA_TYPE (gid[%u])\n",
-                                  path, bdev, (unsigned)getgid()));
+                                  path, bdev, (unsigned)getegid()));
 
                        ret = quotactl(QCMD(Q_GETQUOTA, GRPQUOTA), bdev,
-                                      getgid(), (caddr_t)&D);
+                                      getegid(), (caddr_t)&D);
                        cur_enf = (ret == 0);
                        new_enf = ((dp->qflags & QUOTAS_DENY_DISK) != 0);
                        /* We're not changing quota enforcement, so return