2 * $Id: quota.c,v 1.35 2010-04-03 07:11:35 franklahm Exp $
4 * Copyright (c) 1990,1993 Regents of The University of Michigan.
5 * All Rights Reserved. See COPYRIGHT.
10 #endif /* HAVE_CONFIG_H */
12 #ifndef NO_QUOTA_SUPPORT
17 #include <sys/types.h>
21 #include <sys/param.h>
25 #include <atalk/logger.h>
26 #include <atalk/afp.h>
27 #include <atalk/compat.h>
28 #include <atalk/unix.h>
29 #include <atalk/util.h>
36 #include <quota/quota.h>
39 getfreespace(const AFPObj *obj, struct vol *vol, VolSpace *bfree, VolSpace *btotal,
40 uid_t uid, const char *classq)
43 struct ufs_quota_entry ufsq[QUOTA_NLIMITS];
46 if (time(&now) == -1) {
47 LOG(log_info, logtype_afpd, "time(): %s",
54 if ((retq = getfsquota(obj, vol, ufsq, uid, classq)) < 0) {
55 LOG(log_info, logtype_afpd, "getfsquota(%s, %s): %s",
56 vol->v_path, classq, strerror(errno));
64 switch(QL_STATUS(quota_check_limit(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur, 1,
65 ufsq[QUOTA_LIMIT_BLOCK].ufsqe_softlimit,
66 ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit,
67 ufsq[QUOTA_LIMIT_BLOCK].ufsqe_time, now))) {
71 *btotal = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur);
74 *bfree = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit -
75 ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur);
76 *btotal = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit);
82 int uquota_getvolspace(const AFPObj *obj, struct vol *vol, VolSpace *bfree, VolSpace *btotal, const u_int32_t bsize)
85 VolSpace ubfree, ubtotal;
86 VolSpace gbfree, gbtotal;
88 uretq = getfreespace(obj, vol, &ubfree, &ubtotal,
89 uuid, QUOTADICT_CLASS_USER);
90 LOG(log_info, logtype_afpd, "getfsquota(%s): %d %d",
91 vol->v_path, (int)ubfree, (int)ubtotal);
92 if (obj->ngroups >= 1) {
93 gretq = getfreespace(vol, &ubfree, &ubtotal,
94 obj->groups[0], QUOTADICT_CLASS_GROUP);
97 if (uretq < 1 && gretq < 1) { /* no quota for this fs */
101 /* use group quotas */
104 } else if (gretq < 1) {
105 /* use user quotas */
109 /* return smallest remaining space of user and group */
110 if (ubfree < gbfree) {
122 #else /* HAVE_LIBQUOTA */
125 #define DEBUG_QUOTA 0
128 #define WANT_USER_QUOTA 0
129 #define WANT_GROUP_QUOTA 1
131 #ifdef NEED_QUOTACTL_WRAPPER
132 int quotactl(int cmd, const char *special, int id, caddr_t addr)
134 return syscall(__NR_quotactl, cmd, special, id, addr);
136 #endif /* NEED_QUOTACTL_WRAPPER */
138 static int overquota( struct dqblk *);
142 #ifdef HAVE_LINUX_XQM_H
143 #include <linux/xqm.h>
145 #ifdef HAVE_XFS_XQM_H
147 #define HAVE_LINUX_XQM_H
149 #ifdef HAVE_LINUX_DQBLK_XFS_H
150 #include <linux/dqblk_xfs.h>
151 #define HAVE_LINUX_XQM_H
152 #endif /* HAVE_LINUX_DQBLK_XFS_H */
153 #endif /* HAVE_XFS_XQM_H */
154 #endif /* HAVE_LINUX_XQM_H */
156 #include <linux/unistd.h>
158 static int is_xfs = 0;
160 static int get_linux_xfs_quota(int, char*, uid_t, struct dqblk *);
161 static int get_linux_fs_quota(int, char*, uid_t, struct dqblk *);
163 /* format supported by current kernel */
164 static int kernel_iface = IFACE_UNSET;
167 ** Check kernel quota version
168 ** Taken from quota-tools 3.08 by Jan Kara <jack@suse.cz>
170 static void linuxquota_get_api( void )
172 #ifndef LINUX_API_VERSION
175 if (stat("/proc/sys/fs/quota", &st) == 0) {
176 kernel_iface = IFACE_GENERIC;
179 struct dqstats_v2 v2_stats;
180 struct sigaction sig;
181 struct sigaction oldsig;
183 /* This signal handling is needed because old kernels send us SIGSEGV as they try to resolve the device */
184 sig.sa_handler = SIG_IGN;
185 sig.sa_sigaction = NULL;
187 sigemptyset(&sig.sa_mask);
188 if (sigaction(SIGSEGV, &sig, &oldsig) < 0) {
189 LOG( log_error, logtype_afpd, "cannot set SEGV signal handler: %s", strerror(errno));
192 if (quotactl(QCMD(Q_V2_GETSTATS, 0), NULL, 0, (void *)&v2_stats) >= 0) {
193 kernel_iface = IFACE_VFSV0;
195 else if (errno != ENOSYS && errno != ENOTSUP) {
196 /* RedHat 7.1 (2.4.2-2) newquota check
197 * Q_V2_GETSTATS in it's old place, Q_GETQUOTA in the new place
198 * (they haven't moved Q_GETSTATS to its new value) */
201 char tmp[1024]; /* Just temporary buffer */
203 if (quotactl(QCMD(Q_V1_GETSTATS, 0), NULL, 0, tmp))
205 if (quotactl(QCMD(Q_V1_GETQUOTA, 0), "/dev/null", 0, tmp))
208 /* On a RedHat 2.4.2-2 we expect 0, EINVAL
209 * On a 2.4.x we expect 0, ENOENT
210 * On a 2.4.x-ac we wont get here */
211 if (err_stat == 0 && err_quota == EINVAL) {
212 kernel_iface = IFACE_VFSV0;
215 kernel_iface = IFACE_VFSOLD;
219 /* This branch is *not* in quota-tools 3.08
220 ** but without it quota version is not correctly
221 ** identified for the original SuSE 8.0 kernel */
222 unsigned int vers_no;
225 if ((qf = fopen("/proc/fs/quota", "r"))) {
226 if (fscanf(qf, "Version %u", &vers_no) == 1) {
227 if ( (vers_no == (6*10000 + 5*100 + 0)) ||
228 (vers_no == (6*10000 + 5*100 + 1)) ) {
229 kernel_iface = IFACE_VFSV0;
235 if (sigaction(SIGSEGV, &oldsig, NULL) < 0) {
236 LOG(log_error, logtype_afpd, "cannot reset signal handler: %s", strerror(errno));
242 if (kernel_iface == IFACE_UNSET)
243 kernel_iface = IFACE_VFSOLD;
245 #else /* defined LINUX_API_VERSION */
246 kernel_iface = LINUX_API_VERSION;
250 /****************************************************************************/
252 static int get_linux_quota(int what, char *path, uid_t euser_id, struct dqblk *dp)
257 r=get_linux_xfs_quota(what, path, euser_id, dp);
259 r=get_linux_fs_quota(what, path, euser_id, dp);
264 /****************************************************************************
265 Abstract out the XFS Quota Manager quota get call.
266 ****************************************************************************/
268 static int get_linux_xfs_quota(int what, char *path, uid_t euser_id, struct dqblk *dqb)
271 #ifdef HAVE_LINUX_XQM_H
272 struct fs_disk_quota D;
274 memset (&D, 0, sizeof(D));
276 if ((ret = quotactl(QCMD(Q_XGETQUOTA,(what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t)&D)))
279 dqb->bsize = (uint64_t)512;
280 dqb->dqb_bsoftlimit = (uint64_t)D.d_blk_softlimit;
281 dqb->dqb_bhardlimit = (uint64_t)D.d_blk_hardlimit;
282 dqb->dqb_ihardlimit = (uint64_t)D.d_ino_hardlimit;
283 dqb->dqb_isoftlimit = (uint64_t)D.d_ino_softlimit;
284 dqb->dqb_curinodes = (uint64_t)D.d_icount;
285 dqb->dqb_curblocks = (uint64_t)D.d_bcount;
291 ** Wrapper for the quotactl(GETQUOTA) call.
292 ** For API v2 the results are copied back into a v1 structure.
293 ** Taken from quota-1.4.8 perl module
295 static int get_linux_fs_quota(int what, char *path, uid_t euser_id, struct dqblk *dqb)
299 if (kernel_iface == IFACE_UNSET)
300 linuxquota_get_api();
302 if (kernel_iface == IFACE_GENERIC)
304 struct dqblk_v3 dqb3;
306 ret = quotactl(QCMD(Q_V3_GETQUOTA, (what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t) &dqb3);
309 dqb->dqb_bhardlimit = dqb3.dqb_bhardlimit;
310 dqb->dqb_bsoftlimit = dqb3.dqb_bsoftlimit;
311 dqb->dqb_curblocks = dqb3.dqb_curspace / DEV_QBSIZE;
312 dqb->dqb_ihardlimit = dqb3.dqb_ihardlimit;
313 dqb->dqb_isoftlimit = dqb3.dqb_isoftlimit;
314 dqb->dqb_curinodes = dqb3.dqb_curinodes;
315 dqb->dqb_btime = dqb3.dqb_btime;
316 dqb->dqb_itime = dqb3.dqb_itime;
317 dqb->bsize = DEV_QBSIZE;
320 else if (kernel_iface == IFACE_VFSV0)
322 struct dqblk_v2 dqb2;
324 ret = quotactl(QCMD(Q_V2_GETQUOTA, (what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t) &dqb2);
327 dqb->dqb_bhardlimit = dqb2.dqb_bhardlimit;
328 dqb->dqb_bsoftlimit = dqb2.dqb_bsoftlimit;
329 dqb->dqb_curblocks = dqb2.dqb_curspace / DEV_QBSIZE;
330 dqb->dqb_ihardlimit = dqb2.dqb_ihardlimit;
331 dqb->dqb_isoftlimit = dqb2.dqb_isoftlimit;
332 dqb->dqb_curinodes = dqb2.dqb_curinodes;
333 dqb->dqb_btime = dqb2.dqb_btime;
334 dqb->dqb_itime = dqb2.dqb_itime;
335 dqb->bsize = DEV_QBSIZE;
338 else /* if (kernel_iface == IFACE_VFSOLD) */
340 struct dqblk_v1 dqb1;
342 ret = quotactl(QCMD(Q_V1_GETQUOTA, (what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t) &dqb1);
345 dqb->dqb_bhardlimit = dqb1.dqb_bhardlimit;
346 dqb->dqb_bsoftlimit = dqb1.dqb_bsoftlimit;
347 dqb->dqb_curblocks = dqb1.dqb_curblocks;
348 dqb->dqb_ihardlimit = dqb1.dqb_ihardlimit;
349 dqb->dqb_isoftlimit = dqb1.dqb_isoftlimit;
350 dqb->dqb_curinodes = dqb1.dqb_curinodes;
351 dqb->dqb_btime = dqb1.dqb_btime;
352 dqb->dqb_itime = dqb1.dqb_itime;
353 dqb->bsize = DEV_QBSIZE;
361 #if defined(HAVE_SYS_MNTTAB_H) || defined(__svr4__)
363 * Return the mount point associated with the filesystem
364 * on which "file" resides. Returns NULL on failure.
367 mountp( char *file, int *nfs)
372 static struct mnttab mnt;
374 if (stat(file, &sb) < 0) {
379 if (( mtab = fopen( "/etc/mnttab", "r" )) == NULL ) {
383 while ( getmntent( mtab, &mnt ) == 0 ) {
385 if ( (stat( mnt.mnt_special, &sb ) == 0) && (devno == sb.st_rdev)) {
387 return mnt.mnt_mountp;
390 /* check for nfs. we probably should use
391 * strcmp(mnt.mnt_fstype, MNTTYPE_NFS), but that's not as fast. */
392 if ((stat(mnt.mnt_mountp, &sb) == 0) && (devno == sb.st_dev) &&
393 strchr(mnt.mnt_special, ':')) {
396 return mnt.mnt_special;
407 * Return the block-special device name associated with the filesystem
408 * on which "file" resides. Returns NULL on failure.
412 special( char *file, int *nfs)
414 static struct fs_data fsd;
416 if ( getmnt(0, &fsd, 0, STAT_ONE, file ) < 0 ) {
417 LOG(log_info, logtype_afpd, "special: getmnt %s: %s", file, strerror(errno) );
421 /* XXX: does this really detect an nfs mounted fs? */
422 if (strchr(fsd.fd_req.devname, ':'))
424 return( fsd.fd_req.devname );
428 #if (defined(HAVE_SYS_MOUNT_H) && !defined(__linux__)) || defined(BSD4_4) || defined(_IBMR2)
431 special(char *file, int *nfs)
433 static struct statfs sfs;
435 if ( statfs( file, &sfs ) < 0 ) {
440 /* Digital UNIX: The struct sfs contains a field sfs.f_type,
441 * the MOUNT_* constants are defined in <sys/mount.h> */
442 if ((sfs.f_type == MOUNT_NFS)||(sfs.f_type == MOUNT_NFS3))
444 /* XXX: make sure this really detects an nfs mounted fs */
445 if (strchr(sfs.f_mntfromname, ':'))
448 return( sfs.f_mntfromname );
454 special(char *file, int *nfs)
462 if (stat(file, &sb) < 0 ) {
467 if (( mtab = setmntent( "/etc/mtab", "r" )) == NULL ) {
471 while (( mnt = getmntent( mtab )) != NULL ) {
472 /* check for local fs */
473 if ( (stat( mnt->mnt_fsname, &sb ) == 0) && devno == sb.st_rdev) {
478 /* check for an nfs mount entry. the alternative is to use
479 * strcmp(mnt->mnt_type, MNTTYPE_NFS) instead of the strchr. */
480 if ((stat(mnt->mnt_dir, &sb) == 0) && (devno == sb.st_dev) &&
481 strchr(mnt->mnt_fsname, ':')) {
493 if (strcmp(mnt->mnt_type, "xfs") == 0)
497 return( mnt->mnt_fsname );
502 #endif /* __svr4__ */
505 static int getfsquota(const AFPObj *obj, struct vol *vol, const int uid, struct dqblk *dq)
514 memset(&dqg, 0, sizeof(dqg));
519 qc.addr = (caddr_t)dq;
520 if ( ioctl( vol->v_qfd, Q_QUOTACTL, &qc ) < 0 ) {
521 return( AFPERR_PARAM );
526 if ( quota( Q_GETDLIM, uid, vol->v_gvs, dq ) != 0 ) {
527 return( AFPERR_PARAM );
536 #define QCMD(a,b) (a)
540 /* for group quotas. we only use these if the user belongs
546 if ( quotactl( vol->v_path, QCMD(Q_GETQUOTA,USRQUOTA),
547 uid, (char *)dq ) != 0 ) {
548 /* try group quotas */
549 if (obj->ngroups >= 1) {
550 if ( quotactl(vol->v_path, QCMD(Q_GETQUOTA, GRPQUOTA),
551 obj->groups[0], (char *) &dqg) != 0 ) {
553 return( AFPERR_PARAM );
561 if (get_linux_quota (WANT_USER_QUOTA, vol->v_gvs, uid, dq) !=0) {
562 return( AFPERR_PARAM );
565 if (get_linux_quota(WANT_GROUP_QUOTA, vol->v_gvs, getegid(), &dqg) != 0) {
567 LOG(log_debug, logtype_afpd, "group quota did not work!" );
568 #endif /* DEBUG_QUOTA */
570 return AFP_OK; /* no need to check user vs group quota */
576 /* return either the group quota entry or user quota entry,
577 whichever has the least amount of space remaining
580 /* if user space remaining > group space remaining */
582 /* if overquota, free space is 0 otherwise hard-current */
583 ( overquota( dq ) ? 0 : ( dq->dqb_bhardlimit ? dq->dqb_bhardlimit -
584 dq->dqb_curblocks : ~((uint64_t) 0) ) )
588 ( overquota( &dqg ) ? 0 : ( dqg.dqb_bhardlimit ? dqg.dqb_bhardlimit -
589 dqg.dqb_curblocks : ~((uint64_t) 0) ) )
593 /* use group quota limits rather than user limits */
594 dq->dqb_curblocks = dqg.dqb_curblocks;
595 dq->dqb_bhardlimit = dqg.dqb_bhardlimit;
596 dq->dqb_bsoftlimit = dqg.dqb_bsoftlimit;
597 dq->dqb_btimelimit = dqg.dqb_btimelimit;
603 #endif /* __svr4__ */
609 static int getquota(const AFPObj *obj, struct vol *vol, struct dqblk *dq, const uint32_t bsize)
614 char buf[ MAXPATHLEN + 1];
616 if ( vol->v_qfd == -1 && vol->v_gvs == NULL) {
617 if (( p = mountp( vol->v_path, &vol->v_nfs)) == NULL ) {
618 LOG(log_info, logtype_afpd, "getquota: mountp %s fails", vol->v_path );
619 return( AFPERR_PARAM );
623 if (( vol->v_gvs = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
624 LOG(log_error, logtype_afpd, "getquota: malloc: %s", strerror(errno) );
627 strcpy( vol->v_gvs, p );
630 sprintf( buf, "%s/quotas", p );
631 if (( vol->v_qfd = open( buf, O_RDONLY, 0 )) < 0 ) {
632 LOG(log_info, logtype_afpd, "open %s: %s", buf, strerror(errno) );
633 return( AFPERR_PARAM );
639 if ( vol->v_gvs == NULL ) {
640 if (( p = special( vol->v_path, &vol->v_nfs )) == NULL ) {
641 LOG(log_info, logtype_afpd, "getquota: special %s fails", vol->v_path );
642 return( AFPERR_PARAM );
645 if (( vol->v_gvs = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
646 LOG(log_error, logtype_afpd, "getquota: malloc: %s", strerror(errno) );
649 strcpy( vol->v_gvs, p );
654 /* Digital UNIX: Two forms of specifying an NFS filesystem are possible,
655 either 'hostname:path' or 'path@hostname' (Ultrix heritage) */
658 char pathstring[MNAMELEN];
659 /* MNAMELEN ist defined in <sys/mount.h> */
662 if ((hostpath = strchr(vol->v_gvs,'@')) != NULL ) {
663 /* convert 'path@hostname' to 'hostname:path',
664 * call getnfsquota(),
665 * convert 'hostname:path' back to 'path@hostname' */
667 sprintf(pathstring,"%s:%s",hostpath+1,vol->v_gvs);
668 strcpy(vol->v_gvs,pathstring);
670 result = getnfsquota(vol, uuid, bsize, dq);
672 hostpath = strchr(vol->v_gvs,':');
674 sprintf(pathstring,"%s@%s",hostpath+1,vol->v_gvs);
675 strcpy(vol->v_gvs,pathstring);
680 /* vol->v_gvs is of the form 'hostname:path' */
681 return getnfsquota(vol, uuid, bsize, dq);
683 /* local filesystem */
684 return getfsquota(obj, vol, obj->uid, dq);
687 return vol->v_nfs ? getnfsquota(vol, obj->uid, bsize, dq) :
688 getfsquota(obj, vol, obj->uid, dq);
692 static int overquota( struct dqblk *dqblk)
696 if ( dqblk->dqb_curblocks > dqblk->dqb_bhardlimit &&
697 dqblk->dqb_bhardlimit != 0 ) {
701 if ( dqblk->dqb_curblocks < dqblk->dqb_bsoftlimit ||
702 dqblk->dqb_bsoftlimit == 0 ) {
706 if ( dqblk->dqb_bwarn ) {
710 if ( gettimeofday( &tv, NULL ) < 0 ) {
711 LOG(log_error, logtype_afpd, "overquota: gettimeofday: %s", strerror(errno) );
712 return( AFPERR_PARAM );
714 if ( dqblk->dqb_btimelimit && dqblk->dqb_btimelimit > tv.tv_sec ) {
722 * This next bit is basically for linux -- everything is fine
723 * if you use 1k blocks... but if you try (for example) to mount
724 * a volume via nfs from a netapp (which might use 4k blocks) everything
725 * gets reported improperly. I have no idea about dbtob on other
729 #ifdef HAVE_BROKEN_DBTOB
731 #define dbtob(a, b) ((VolSpace)((VolSpace)(a) * (VolSpace)(b)))
732 #define HAVE_2ARG_DBTOB
736 #define dbtob(a) ((a) << 10)
739 /* i do the cast to VolSpace here to make sure that 64-bit shifts
741 #ifdef HAVE_2ARG_DBTOB
742 #define tobytes(a, b) dbtob((VolSpace) (a), (VolSpace) (b))
744 #define tobytes(a, b) dbtob((VolSpace) (a))
747 int uquota_getvolspace(const AFPObj *obj, struct vol *vol, VolSpace *bfree, VolSpace *btotal, const uint32_t bsize)
754 if (getquota(obj, vol, &dqblk, bsize) != 0 ) {
755 return( AFPERR_PARAM );
759 this_bsize = dqblk.bsize;
763 LOG(log_debug, logtype_afpd, "after calling getquota in uquota_getvolspace!" );
764 LOG(log_debug, logtype_afpd, "dqb_ihardlimit: %u", dqblk.dqb_ihardlimit );
765 LOG(log_debug, logtype_afpd, "dqb_isoftlimit: %u", dqblk.dqb_isoftlimit );
766 LOG(log_debug, logtype_afpd, "dqb_curinodes : %u", dqblk.dqb_curinodes );
767 LOG(log_debug, logtype_afpd, "dqb_bhardlimit: %u", dqblk.dqb_bhardlimit );
768 LOG(log_debug, logtype_afpd, "dqb_bsoftlimit: %u", dqblk.dqb_bsoftlimit );
769 LOG(log_debug, logtype_afpd, "dqb_curblocks : %u", dqblk.dqb_curblocks );
770 LOG(log_debug, logtype_afpd, "dqb_btime : %u", dqblk.dqb_btime );
771 LOG(log_debug, logtype_afpd, "dqb_itime : %u", dqblk.dqb_itime );
772 LOG(log_debug, logtype_afpd, "bsize/this_bsize : %u/%u", bsize, this_bsize );
773 LOG(log_debug, logtype_afpd, "dqblk.dqb_bhardlimit size: %u", tobytes( dqblk.dqb_bhardlimit, this_bsize ));
774 LOG(log_debug, logtype_afpd, "dqblk.dqb_bsoftlimit size: %u", tobytes( dqblk.dqb_bsoftlimit, this_bsize ));
775 LOG(log_debug, logtype_afpd, "dqblk.dqb_curblocks size: %u", tobytes( dqblk.dqb_curblocks, this_bsize ));
776 #endif /* DEBUG_QUOTA */
778 /* no limit set for this user. it might be set in the future. */
779 if (dqblk.dqb_bsoftlimit == 0 && dqblk.dqb_bhardlimit == 0) {
780 *btotal = *bfree = ~((VolSpace) 0);
781 } else if ( overquota( &dqblk )) {
782 if ( tobytes( dqblk.dqb_curblocks, this_bsize ) > tobytes( dqblk.dqb_bsoftlimit, this_bsize ) ) {
783 *btotal = tobytes( dqblk.dqb_curblocks, this_bsize );
787 *btotal = tobytes( dqblk.dqb_bsoftlimit, this_bsize );
788 *bfree = tobytes( dqblk.dqb_bsoftlimit, this_bsize ) -
789 tobytes( dqblk.dqb_curblocks, this_bsize );
792 *btotal = tobytes( dqblk.dqb_bhardlimit, this_bsize );
793 *bfree = tobytes( dqblk.dqb_bhardlimit, this_bsize ) -
794 tobytes( dqblk.dqb_curblocks, this_bsize );
798 LOG(log_debug, logtype_afpd, "bfree : %u", *bfree );
799 LOG(log_debug, logtype_afpd, "btotal : %u", *btotal );
800 LOG(log_debug, logtype_afpd, "bfree : %uKB", *bfree/1024 );
801 LOG(log_debug, logtype_afpd, "btotal : %uKB", *btotal/1024 );
806 #endif /* HAVE_LIBQUOTA */