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>
35 #include <quota/quota.h>
38 getfreespace(const AFPObj *obj, struct vol *vol, VolSpace *bfree, VolSpace *btotal,
39 uid_t uid, const char *classq)
42 struct ufs_quota_entry ufsq[QUOTA_NLIMITS];
45 if (time(&now) == -1) {
46 LOG(log_info, logtype_afpd, "time(): %s",
53 if ((retq = getfsquota(obj, vol, ufsq, uid, classq)) < 0) {
54 LOG(log_info, logtype_afpd, "getfsquota(%s, %s): %s",
55 vol->v_path, classq, strerror(errno));
63 switch(QL_STATUS(quota_check_limit(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur, 1,
64 ufsq[QUOTA_LIMIT_BLOCK].ufsqe_softlimit,
65 ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit,
66 ufsq[QUOTA_LIMIT_BLOCK].ufsqe_time, now))) {
70 *btotal = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur);
73 *bfree = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit -
74 ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur);
75 *btotal = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit);
81 int uquota_getvolspace(const AFPObj *obj, struct vol *vol, VolSpace *bfree, VolSpace *btotal, const u_int32_t bsize)
84 VolSpace ubfree, ubtotal;
85 VolSpace gbfree, gbtotal;
87 uretq = getfreespace(obj, vol, &ubfree, &ubtotal,
88 uuid, QUOTADICT_CLASS_USER);
89 LOG(log_info, logtype_afpd, "getfsquota(%s): %d %d",
90 vol->v_path, (int)ubfree, (int)ubtotal);
91 if (obj->ngroups >= 1) {
92 gretq = getfreespace(vol, &ubfree, &ubtotal,
93 obj->groups[0], QUOTADICT_CLASS_GROUP);
96 if (uretq < 1 && gretq < 1) { /* no quota for this fs */
100 /* use group quotas */
103 } else if (gretq < 1) {
104 /* use user quotas */
108 /* return smallest remaining space of user and group */
109 if (ubfree < gbfree) {
121 #else /* HAVE_LIBQUOTA */
124 #define DEBUG_QUOTA 0
127 #define WANT_USER_QUOTA 0
128 #define WANT_GROUP_QUOTA 1
130 #ifdef NEED_QUOTACTL_WRAPPER
131 int quotactl(int cmd, const char *special, int id, caddr_t addr)
133 return syscall(__NR_quotactl, cmd, special, id, addr);
135 #endif /* NEED_QUOTACTL_WRAPPER */
137 static int overquota( struct dqblk *);
141 #ifdef HAVE_LINUX_XQM_H
142 #include <linux/xqm.h>
144 #ifdef HAVE_XFS_XQM_H
146 #define HAVE_LINUX_XQM_H
148 #ifdef HAVE_LINUX_DQBLK_XFS_H
149 #include <linux/dqblk_xfs.h>
150 #define HAVE_LINUX_XQM_H
151 #endif /* HAVE_LINUX_DQBLK_XFS_H */
152 #endif /* HAVE_XFS_XQM_H */
153 #endif /* HAVE_LINUX_XQM_H */
155 #include <linux/unistd.h>
157 static int is_xfs = 0;
159 static int get_linux_xfs_quota(int, char*, uid_t, struct dqblk *);
160 static int get_linux_fs_quota(int, char*, uid_t, struct dqblk *);
162 /* format supported by current kernel */
163 static int kernel_iface = IFACE_UNSET;
166 ** Check kernel quota version
167 ** Taken from quota-tools 3.08 by Jan Kara <jack@suse.cz>
169 static void linuxquota_get_api( void )
171 #ifndef LINUX_API_VERSION
174 if (stat("/proc/sys/fs/quota", &st) == 0) {
175 kernel_iface = IFACE_GENERIC;
178 struct dqstats_v2 v2_stats;
179 struct sigaction sig;
180 struct sigaction oldsig;
182 /* This signal handling is needed because old kernels send us SIGSEGV as they try to resolve the device */
183 sig.sa_handler = SIG_IGN;
184 sig.sa_sigaction = NULL;
186 sigemptyset(&sig.sa_mask);
187 if (sigaction(SIGSEGV, &sig, &oldsig) < 0) {
188 LOG( log_error, logtype_afpd, "cannot set SEGV signal handler: %s", strerror(errno));
191 if (quotactl(QCMD(Q_V2_GETSTATS, 0), NULL, 0, (void *)&v2_stats) >= 0) {
192 kernel_iface = IFACE_VFSV0;
194 else if (errno != ENOSYS && errno != ENOTSUP) {
195 /* RedHat 7.1 (2.4.2-2) newquota check
196 * Q_V2_GETSTATS in it's old place, Q_GETQUOTA in the new place
197 * (they haven't moved Q_GETSTATS to its new value) */
200 char tmp[1024]; /* Just temporary buffer */
202 if (quotactl(QCMD(Q_V1_GETSTATS, 0), NULL, 0, tmp))
204 if (quotactl(QCMD(Q_V1_GETQUOTA, 0), "/dev/null", 0, tmp))
207 /* On a RedHat 2.4.2-2 we expect 0, EINVAL
208 * On a 2.4.x we expect 0, ENOENT
209 * On a 2.4.x-ac we wont get here */
210 if (err_stat == 0 && err_quota == EINVAL) {
211 kernel_iface = IFACE_VFSV0;
214 kernel_iface = IFACE_VFSOLD;
218 /* This branch is *not* in quota-tools 3.08
219 ** but without it quota version is not correctly
220 ** identified for the original SuSE 8.0 kernel */
221 unsigned int vers_no;
224 if ((qf = fopen("/proc/fs/quota", "r"))) {
225 if (fscanf(qf, "Version %u", &vers_no) == 1) {
226 if ( (vers_no == (6*10000 + 5*100 + 0)) ||
227 (vers_no == (6*10000 + 5*100 + 1)) ) {
228 kernel_iface = IFACE_VFSV0;
234 if (sigaction(SIGSEGV, &oldsig, NULL) < 0) {
235 LOG(log_error, logtype_afpd, "cannot reset signal handler: %s", strerror(errno));
241 if (kernel_iface == IFACE_UNSET)
242 kernel_iface = IFACE_VFSOLD;
244 #else /* defined LINUX_API_VERSION */
245 kernel_iface = LINUX_API_VERSION;
249 /****************************************************************************/
251 static int get_linux_quota(int what, char *path, uid_t euser_id, struct dqblk *dp)
256 r=get_linux_xfs_quota(what, path, euser_id, dp);
258 r=get_linux_fs_quota(what, path, euser_id, dp);
263 /****************************************************************************
264 Abstract out the XFS Quota Manager quota get call.
265 ****************************************************************************/
267 static int get_linux_xfs_quota(int what, char *path, uid_t euser_id, struct dqblk *dqb)
270 #ifdef HAVE_LINUX_XQM_H
271 struct fs_disk_quota D;
273 memset (&D, 0, sizeof(D));
275 if ((ret = quotactl(QCMD(Q_XGETQUOTA,(what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t)&D)))
278 dqb->bsize = (uint64_t)512;
279 dqb->dqb_bsoftlimit = (uint64_t)D.d_blk_softlimit;
280 dqb->dqb_bhardlimit = (uint64_t)D.d_blk_hardlimit;
281 dqb->dqb_ihardlimit = (uint64_t)D.d_ino_hardlimit;
282 dqb->dqb_isoftlimit = (uint64_t)D.d_ino_softlimit;
283 dqb->dqb_curinodes = (uint64_t)D.d_icount;
284 dqb->dqb_curblocks = (uint64_t)D.d_bcount;
290 ** Wrapper for the quotactl(GETQUOTA) call.
291 ** For API v2 the results are copied back into a v1 structure.
292 ** Taken from quota-1.4.8 perl module
294 static int get_linux_fs_quota(int what, char *path, uid_t euser_id, struct dqblk *dqb)
298 if (kernel_iface == IFACE_UNSET)
299 linuxquota_get_api();
301 if (kernel_iface == IFACE_GENERIC)
303 struct dqblk_v3 dqb3;
305 ret = quotactl(QCMD(Q_V3_GETQUOTA, (what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t) &dqb3);
308 dqb->dqb_bhardlimit = dqb3.dqb_bhardlimit;
309 dqb->dqb_bsoftlimit = dqb3.dqb_bsoftlimit;
310 dqb->dqb_curblocks = dqb3.dqb_curspace / DEV_QBSIZE;
311 dqb->dqb_ihardlimit = dqb3.dqb_ihardlimit;
312 dqb->dqb_isoftlimit = dqb3.dqb_isoftlimit;
313 dqb->dqb_curinodes = dqb3.dqb_curinodes;
314 dqb->dqb_btime = dqb3.dqb_btime;
315 dqb->dqb_itime = dqb3.dqb_itime;
316 dqb->bsize = DEV_QBSIZE;
319 else if (kernel_iface == IFACE_VFSV0)
321 struct dqblk_v2 dqb2;
323 ret = quotactl(QCMD(Q_V2_GETQUOTA, (what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t) &dqb2);
326 dqb->dqb_bhardlimit = dqb2.dqb_bhardlimit;
327 dqb->dqb_bsoftlimit = dqb2.dqb_bsoftlimit;
328 dqb->dqb_curblocks = dqb2.dqb_curspace / DEV_QBSIZE;
329 dqb->dqb_ihardlimit = dqb2.dqb_ihardlimit;
330 dqb->dqb_isoftlimit = dqb2.dqb_isoftlimit;
331 dqb->dqb_curinodes = dqb2.dqb_curinodes;
332 dqb->dqb_btime = dqb2.dqb_btime;
333 dqb->dqb_itime = dqb2.dqb_itime;
334 dqb->bsize = DEV_QBSIZE;
337 else /* if (kernel_iface == IFACE_VFSOLD) */
339 struct dqblk_v1 dqb1;
341 ret = quotactl(QCMD(Q_V1_GETQUOTA, (what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t) &dqb1);
344 dqb->dqb_bhardlimit = dqb1.dqb_bhardlimit;
345 dqb->dqb_bsoftlimit = dqb1.dqb_bsoftlimit;
346 dqb->dqb_curblocks = dqb1.dqb_curblocks;
347 dqb->dqb_ihardlimit = dqb1.dqb_ihardlimit;
348 dqb->dqb_isoftlimit = dqb1.dqb_isoftlimit;
349 dqb->dqb_curinodes = dqb1.dqb_curinodes;
350 dqb->dqb_btime = dqb1.dqb_btime;
351 dqb->dqb_itime = dqb1.dqb_itime;
352 dqb->bsize = DEV_QBSIZE;
360 #if defined(HAVE_SYS_MNTTAB_H) || defined(__svr4__)
362 * Return the mount point associated with the filesystem
363 * on which "file" resides. Returns NULL on failure.
366 mountp( char *file, int *nfs)
371 static struct mnttab mnt;
373 if ( lstat( file, &sb ) < 0 ) {
378 if (( mtab = fopen( "/etc/mnttab", "r" )) == NULL ) {
382 while ( getmntent( mtab, &mnt ) == 0 ) {
384 if ( (lstat( mnt.mnt_special, &sb ) == 0) && (devno == sb.st_rdev)) {
386 return mnt.mnt_mountp;
389 /* check for nfs. we probably should use
390 * strcmp(mnt.mnt_fstype, MNTTYPE_NFS), but that's not as fast. */
391 if ((lstat(mnt.mnt_mountp, &sb) == 0) && (devno == sb.st_dev) &&
392 strchr(mnt.mnt_special, ':')) {
395 return mnt.mnt_special;
406 * Return the block-special device name associated with the filesystem
407 * on which "file" resides. Returns NULL on failure.
411 special( char *file, int *nfs)
413 static struct fs_data fsd;
415 if ( getmnt(0, &fsd, 0, STAT_ONE, file ) < 0 ) {
416 LOG(log_info, logtype_afpd, "special: getmnt %s: %s", file, strerror(errno) );
420 /* XXX: does this really detect an nfs mounted fs? */
421 if (strchr(fsd.fd_req.devname, ':'))
423 return( fsd.fd_req.devname );
427 #if (defined(HAVE_SYS_MOUNT_H) && !defined(__linux__)) || defined(BSD4_4) || defined(_IBMR2)
430 special(char *file, int *nfs)
432 static struct statfs sfs;
434 if ( statfs( file, &sfs ) < 0 ) {
439 /* Digital UNIX: The struct sfs contains a field sfs.f_type,
440 * the MOUNT_* constants are defined in <sys/mount.h> */
441 if ((sfs.f_type == MOUNT_NFS)||(sfs.f_type == MOUNT_NFS3))
443 /* XXX: make sure this really detects an nfs mounted fs */
444 if (strchr(sfs.f_mntfromname, ':'))
447 return( sfs.f_mntfromname );
453 special(char *file, int *nfs)
461 if ( lstat( file, &sb ) < 0 ) {
466 if (( mtab = setmntent( "/etc/mtab", "r" )) == NULL ) {
470 while (( mnt = getmntent( mtab )) != NULL ) {
471 /* check for local fs */
472 if ( (lstat( mnt->mnt_fsname, &sb ) == 0) && devno == sb.st_rdev) {
477 /* check for an nfs mount entry. the alternative is to use
478 * strcmp(mnt->mnt_type, MNTTYPE_NFS) instead of the strchr. */
479 if ((lstat(mnt->mnt_dir, &sb) == 0) && (devno == sb.st_dev) &&
480 strchr(mnt->mnt_fsname, ':')) {
492 if (strcmp(mnt->mnt_type, "xfs") == 0)
496 return( mnt->mnt_fsname );
501 #endif /* __svr4__ */
504 static int getfsquota(const AFPObj *obj, struct vol *vol, const int uid, struct dqblk *dq)
513 memset(&dqg, 0, sizeof(dqg));
518 qc.addr = (caddr_t)dq;
519 if ( ioctl( vol->v_qfd, Q_QUOTACTL, &qc ) < 0 ) {
520 return( AFPERR_PARAM );
525 if ( quota( Q_GETDLIM, uid, vol->v_gvs, dq ) != 0 ) {
526 return( AFPERR_PARAM );
535 #define QCMD(a,b) (a)
539 /* for group quotas. we only use these if the user belongs
545 if ( quotactl( vol->v_path, QCMD(Q_GETQUOTA,USRQUOTA),
546 uid, (char *)dq ) != 0 ) {
547 /* try group quotas */
548 if (obj->ngroups >= 1) {
549 if ( quotactl(vol->v_path, QCMD(Q_GETQUOTA, GRPQUOTA),
550 obj->groups[0], (char *) &dqg) != 0 ) {
552 return( AFPERR_PARAM );
560 if (get_linux_quota (WANT_USER_QUOTA, vol->v_gvs, uid, dq) !=0) {
561 return( AFPERR_PARAM );
564 if (get_linux_quota(WANT_GROUP_QUOTA, vol->v_gvs, getegid(), &dqg) != 0) {
566 LOG(log_debug, logtype_afpd, "group quota did not work!" );
567 #endif /* DEBUG_QUOTA */
569 return AFP_OK; /* no need to check user vs group quota */
575 /* return either the group quota entry or user quota entry,
576 whichever has the least amount of space remaining
579 /* if user space remaining > group space remaining */
581 /* if overquota, free space is 0 otherwise hard-current */
582 ( overquota( dq ) ? 0 : ( dq->dqb_bhardlimit ? dq->dqb_bhardlimit -
583 dq->dqb_curblocks : ~((uint64_t) 0) ) )
587 ( overquota( &dqg ) ? 0 : ( dqg.dqb_bhardlimit ? dqg.dqb_bhardlimit -
588 dqg.dqb_curblocks : ~((uint64_t) 0) ) )
592 /* use group quota limits rather than user limits */
593 dq->dqb_curblocks = dqg.dqb_curblocks;
594 dq->dqb_bhardlimit = dqg.dqb_bhardlimit;
595 dq->dqb_bsoftlimit = dqg.dqb_bsoftlimit;
596 dq->dqb_btimelimit = dqg.dqb_btimelimit;
602 #endif /* __svr4__ */
608 static int getquota(const AFPObj *obj, struct vol *vol, struct dqblk *dq, const uint32_t bsize)
613 char buf[ MAXPATHLEN + 1];
615 if ( vol->v_qfd == -1 && vol->v_gvs == NULL) {
616 if (( p = mountp( vol->v_path, &vol->v_nfs)) == NULL ) {
617 LOG(log_info, logtype_afpd, "getquota: mountp %s fails", vol->v_path );
618 return( AFPERR_PARAM );
622 if (( vol->v_gvs = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
623 LOG(log_error, logtype_afpd, "getquota: malloc: %s", strerror(errno) );
626 strcpy( vol->v_gvs, p );
629 sprintf( buf, "%s/quotas", p );
630 if (( vol->v_qfd = open( buf, O_RDONLY, 0 )) < 0 ) {
631 LOG(log_info, logtype_afpd, "open %s: %s", buf, strerror(errno) );
632 return( AFPERR_PARAM );
638 if ( vol->v_gvs == NULL ) {
639 if (( p = special( vol->v_path, &vol->v_nfs )) == NULL ) {
640 LOG(log_info, logtype_afpd, "getquota: special %s fails", vol->v_path );
641 return( AFPERR_PARAM );
644 if (( vol->v_gvs = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
645 LOG(log_error, logtype_afpd, "getquota: malloc: %s", strerror(errno) );
648 strcpy( vol->v_gvs, p );
653 /* Digital UNIX: Two forms of specifying an NFS filesystem are possible,
654 either 'hostname:path' or 'path@hostname' (Ultrix heritage) */
657 char pathstring[MNAMELEN];
658 /* MNAMELEN ist defined in <sys/mount.h> */
661 if ((hostpath = strchr(vol->v_gvs,'@')) != NULL ) {
662 /* convert 'path@hostname' to 'hostname:path',
663 * call getnfsquota(),
664 * convert 'hostname:path' back to 'path@hostname' */
666 sprintf(pathstring,"%s:%s",hostpath+1,vol->v_gvs);
667 strcpy(vol->v_gvs,pathstring);
669 result = getnfsquota(vol, uuid, bsize, dq);
671 hostpath = strchr(vol->v_gvs,':');
673 sprintf(pathstring,"%s@%s",hostpath+1,vol->v_gvs);
674 strcpy(vol->v_gvs,pathstring);
679 /* vol->v_gvs is of the form 'hostname:path' */
680 return getnfsquota(vol, uuid, bsize, dq);
682 /* local filesystem */
683 return getfsquota(obj, vol, obj->uid, dq);
686 return vol->v_nfs ? getnfsquota(vol, obj->uid, bsize, dq) :
687 getfsquota(obj, vol, obj->uid, dq);
691 static int overquota( struct dqblk *dqblk)
695 if ( dqblk->dqb_curblocks > dqblk->dqb_bhardlimit &&
696 dqblk->dqb_bhardlimit != 0 ) {
700 if ( dqblk->dqb_curblocks < dqblk->dqb_bsoftlimit ||
701 dqblk->dqb_bsoftlimit == 0 ) {
705 if ( dqblk->dqb_bwarn ) {
709 if ( gettimeofday( &tv, NULL ) < 0 ) {
710 LOG(log_error, logtype_afpd, "overquota: gettimeofday: %s", strerror(errno) );
711 return( AFPERR_PARAM );
713 if ( dqblk->dqb_btimelimit && dqblk->dqb_btimelimit > tv.tv_sec ) {
721 * This next bit is basically for linux -- everything is fine
722 * if you use 1k blocks... but if you try (for example) to mount
723 * a volume via nfs from a netapp (which might use 4k blocks) everything
724 * gets reported improperly. I have no idea about dbtob on other
728 #ifdef HAVE_BROKEN_DBTOB
730 #define dbtob(a, b) ((VolSpace)((VolSpace)(a) * (VolSpace)(b)))
731 #define HAVE_2ARG_DBTOB
735 #define dbtob(a) ((a) << 10)
738 /* i do the cast to VolSpace here to make sure that 64-bit shifts
740 #ifdef HAVE_2ARG_DBTOB
741 #define tobytes(a, b) dbtob((VolSpace) (a), (VolSpace) (b))
743 #define tobytes(a, b) dbtob((VolSpace) (a))
746 int uquota_getvolspace(const AFPObj *obj, struct vol *vol, VolSpace *bfree, VolSpace *btotal, const uint32_t bsize)
753 if (getquota(obj, vol, &dqblk, bsize) != 0 ) {
754 return( AFPERR_PARAM );
758 this_bsize = dqblk.bsize;
762 LOG(log_debug, logtype_afpd, "after calling getquota in uquota_getvolspace!" );
763 LOG(log_debug, logtype_afpd, "dqb_ihardlimit: %u", dqblk.dqb_ihardlimit );
764 LOG(log_debug, logtype_afpd, "dqb_isoftlimit: %u", dqblk.dqb_isoftlimit );
765 LOG(log_debug, logtype_afpd, "dqb_curinodes : %u", dqblk.dqb_curinodes );
766 LOG(log_debug, logtype_afpd, "dqb_bhardlimit: %u", dqblk.dqb_bhardlimit );
767 LOG(log_debug, logtype_afpd, "dqb_bsoftlimit: %u", dqblk.dqb_bsoftlimit );
768 LOG(log_debug, logtype_afpd, "dqb_curblocks : %u", dqblk.dqb_curblocks );
769 LOG(log_debug, logtype_afpd, "dqb_btime : %u", dqblk.dqb_btime );
770 LOG(log_debug, logtype_afpd, "dqb_itime : %u", dqblk.dqb_itime );
771 LOG(log_debug, logtype_afpd, "bsize/this_bsize : %u/%u", bsize, this_bsize );
772 LOG(log_debug, logtype_afpd, "dqblk.dqb_bhardlimit size: %u", tobytes( dqblk.dqb_bhardlimit, this_bsize ));
773 LOG(log_debug, logtype_afpd, "dqblk.dqb_bsoftlimit size: %u", tobytes( dqblk.dqb_bsoftlimit, this_bsize ));
774 LOG(log_debug, logtype_afpd, "dqblk.dqb_curblocks size: %u", tobytes( dqblk.dqb_curblocks, this_bsize ));
775 #endif /* DEBUG_QUOTA */
777 /* no limit set for this user. it might be set in the future. */
778 if (dqblk.dqb_bsoftlimit == 0 && dqblk.dqb_bhardlimit == 0) {
779 *btotal = *bfree = ~((VolSpace) 0);
780 } else if ( overquota( &dqblk )) {
781 if ( tobytes( dqblk.dqb_curblocks, this_bsize ) > tobytes( dqblk.dqb_bsoftlimit, this_bsize ) ) {
782 *btotal = tobytes( dqblk.dqb_curblocks, this_bsize );
786 *btotal = tobytes( dqblk.dqb_bsoftlimit, this_bsize );
787 *bfree = tobytes( dqblk.dqb_bsoftlimit, this_bsize ) -
788 tobytes( dqblk.dqb_curblocks, this_bsize );
791 *btotal = tobytes( dqblk.dqb_bhardlimit, this_bsize );
792 *bfree = tobytes( dqblk.dqb_bhardlimit, this_bsize ) -
793 tobytes( dqblk.dqb_curblocks, this_bsize );
797 LOG(log_debug, logtype_afpd, "bfree : %u", *bfree );
798 LOG(log_debug, logtype_afpd, "btotal : %u", *btotal );
799 LOG(log_debug, logtype_afpd, "bfree : %uKB", *bfree/1024 );
800 LOG(log_debug, logtype_afpd, "btotal : %uKB", *btotal/1024 );
805 #endif /* HAVE_LIBQUOTA */