patch: fix in lib/sysquotas_linux.c

Michael Adam ma at sernet.de
Fri Dec 1 13:10:18 GMT 2006


Hi list!

Metze: as noted by "shattered" and discussed on the irc,
here is a patch to lib/sysquotas_linux.c replacing some
"get"s by "set"s. The other lib/sysquotas*.c files look
ok to me. But in the linux variant, the problem is not
in the actual call of quotactl but in the preparation of
the respective "D" structs. This makes the difference
between the get and set calls for SMB_USER_FS_QUOTA_TYPE
and SMB_GROUP_FS_QUOTA_TYPE. 

Cheers, Michael 

-- 
Michael Adam,  SerNet Service Network GmbH
phone: +49-551-370000-0,  fax: +49-551-370000-9

-------------- next part --------------
Index: lib/sysquotas_linux.c
===================================================================
--- lib/sysquotas_linux.c	(revision 19975)
+++ lib/sysquotas_linux.c	(working copy)
@@ -526,9 +526,9 @@
 		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);
 				}
 			}
 
@@ -541,9 +541,9 @@
 		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);
 				}
 			}
 


More information about the samba-technical mailing list