View | Details | Raw Unified | Return to bug 54537 | Differences between
and this patch

Collapse All | Expand All

(-)a/base/univention-quota/files/univention-group-quota (-2 / +2 lines)
 Lines 89-101   setQuotaForUserOnFilesystem () { # USER FILESYSTEM BSL BHL Link Here 
89
	local ISL=$(quota -wulv "$USER"|tr -s '\t' ' '|grep "^ *$FILESYSTEM "|cut -d' ' -f6)
89
	local ISL=$(quota -wulv "$USER"|tr -s '\t' ' '|grep "^ *$FILESYSTEM "|cut -d' ' -f6)
90
	local IHL=$(quota -wulv "$USER"|tr -s '\t' ' '|grep "^ *$FILESYSTEM "|cut -d' ' -f7)
90
	local IHL=$(quota -wulv "$USER"|tr -s '\t' ' '|grep "^ *$FILESYSTEM "|cut -d' ' -f7)
91
	verbose "Setting quota $BSL/$BHL ($ISL/$IHL) for $USER on $FILESYSTEM"
91
	verbose "Setting quota $BSL/$BHL ($ISL/$IHL) for $USER on $FILESYSTEM"
92
	setquota -u "$USER" "$BSL" "$BHL" "$ISL" "$IHL" "$FILESYSTEM"
92
	setquota --always-resolve -u "$USER" "$BSL" "$BHL" "$ISL" "$IHL" "$FILESYSTEM"
93
}
93
}
94
94
95
userHasQuotaOnFilesystem () { # USER FILESYSTEM
95
userHasQuotaOnFilesystem () { # USER FILESYSTEM
96
	local USER="$1"
96
	local USER="$1"
97
	local FILESYSTEM="$2"
97
	local FILESYSTEM="$2"
98
	quota -wul "$USER"|tr -s '\t' ' '|grep -qs "^ *$FILESYSTEM "
98
	quota --always-resolve -wul "$USER"|tr -s '\t' ' '|grep -qs "^ *$FILESYSTEM "
99
}
99
}
100
100
101
usage () {
101
usage () {
(-)a/base/univention-quota/files/univention-setquota (-2 / +2 lines)
 Lines 76-83   len=0 Link Here 
76
#search for mountpoint
76
#search for mountpoint
77
for mpoint in `cat /etc/mtab | awk '{print $2}'`; do if [ "`echo "$share" | sed -e "s|^$mpoint||"`" != "$share" -a $len -lt `echo $mpoint | wc -m` ]; then len=`echo $mpoint | wc -m`; filesystem=$mpoint; fi; done
77
for mpoint in `cat /etc/mtab | awk '{print $2}'`; do if [ "`echo "$share" | sed -e "s|^$mpoint||"`" != "$share" -a $len -lt `echo $mpoint | wc -m` ]; then len=`echo $mpoint | wc -m`; filesystem=$mpoint; fi; done
78
78
79
echo "/usr/sbin/setquota $type $sid $blocksoft $blockhard $inodesoft $inodehard $filesystem" >> $LOGFILE
79
echo "/usr/sbin/setquota --always-resolve $type $sid $blocksoft $blockhard $inodesoft $inodehard $filesystem" >> $LOGFILE
80
if /usr/sbin/setquota $type $sid $blocksoft $blockhard $inodesoft $inodehard $filesystem >>  /dev/null 2>&1
80
if /usr/sbin/setquota --always-resolve $type $sid $blocksoft $blockhard $inodesoft $inodehard $filesystem >>  /dev/null 2>&1
81
	then
81
	then
82
	echo "univention-setquota: done"
82
	echo "univention-setquota: done"
83
else
83
else
(-)a/base/univention-quota/files/univention-user-quota (-2 / +2 lines)
 Lines 236-243   if __name__ == '__main__': Link Here 
236
		log.write('Found %i shares and %i mountpoints\n' % (len(shares), len(mountpoints)))
236
		log.write('Found %i shares and %i mountpoints\n' % (len(shares), len(mountpoints)))
237
		for mountpoint_path, attrs in mountpoints.iteritems():
237
		for mountpoint_path, attrs in mountpoints.iteritems():
238
			if attrs['reapplyQuota']:
238
			if attrs['reapplyQuota']:
239
				log.write('Set quota on mountpoint "%s": /usr/sbin/setquota -u %s %s %s %s %s %s\n' % (mountpoint_path, user, attrs['spaceSoftLimit'], attrs['spaceHardLimit'], attrs['inodeSoftLimit'], attrs['inodeHardLimit'], mountpoint_path))
239
				log.write('Set quota on mountpoint "%s": /usr/sbin/setquota --always-resolve -u %s %s %s %s %s %s\n' % (mountpoint_path, user, attrs['spaceSoftLimit'], attrs['spaceHardLimit'], attrs['inodeSoftLimit'], attrs['inodeHardLimit'], mountpoint_path))
240
				command = ['/usr/sbin/setquota', '-u', user, str(attrs['spaceSoftLimit']), str(attrs['spaceHardLimit']), str(attrs['inodeSoftLimit']), str(attrs['inodeHardLimit']), mountpoint_path]
240
				command = ['/usr/sbin/setquota', '--always-resolve', '-u', user, str(attrs['spaceSoftLimit']), str(attrs['spaceHardLimit']), str(attrs['inodeSoftLimit']), str(attrs['inodeHardLimit']), mountpoint_path]
241
				set_quota = subprocess.Popen(command, stderr=log)
241
				set_quota = subprocess.Popen(command, stderr=log)
242
				set_quota.wait()
242
				set_quota.wait()
243
			else:
243
			else:
(-)a/base/univention-quota/test/quotatest (-1 / +1 lines)
 Lines 208-214   _quota() { Link Here 
208
	case "$mtype" in
208
	case "$mtype" in
209
		local)
209
		local)
210
			if [[ "$qtype" == "local" ]]; then
210
			if [[ "$qtype" == "local" ]]; then
211
				setquota -u "$user" "$soft" "$limit" 0 0 "$fs"
211
				setquota --always-resolve -u "$user" "$soft" "$limit" 0 0 "$fs"
212
			fi
212
			fi
213
			__quota "$user" "$fs/$file" "$limit"
213
			__quota "$user" "$fs/$file" "$limit"
214
			rc=$?
214
			rc=$?
(-)a/base/univention-quota/umc/python/quota/tools.py (-1 / +1 lines)
 Lines 117-123   def repquota_parse(partition, output): Link Here 
117
117
118
118
119
def setquota(partition, user, bsoft, bhard, fsoft, fhard):
119
def setquota(partition, user, bsoft, bhard, fsoft, fhard):
120
	cmd = ('/usr/sbin/setquota', '-u', user, str(bsoft), str(bhard), str(fsoft), str(fhard), partition)
120
	cmd = ('/usr/sbin/setquota', '--always-resolve', '-u', user, str(bsoft), str(bhard), str(fsoft), str(fhard), partition)
121
	return subprocess.call(cmd)
121
	return subprocess.call(cmd)
122
122
123
123

Return to bug 54537