/*
- * $Id: quota.c,v 1.35 2010-04-03 07:11:35 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#include <atalk/afp.h>
#include <atalk/compat.h>
#include <atalk/unix.h>
+#include <atalk/util.h>
#include "auth.h"
#include "volume.h"
dev_t devno;
static struct mnttab mnt;
- if ( lstat( file, &sb ) < 0 ) {
+ if (stat(file, &sb) < 0) {
return( NULL );
}
devno = sb.st_dev;
while ( getmntent( mtab, &mnt ) == 0 ) {
/* local fs */
- if ( (lstat( mnt.mnt_special, &sb ) == 0) && (devno == sb.st_rdev)) {
+ if ( (stat( mnt.mnt_special, &sb ) == 0) && (devno == sb.st_rdev)) {
fclose( mtab );
return mnt.mnt_mountp;
}
/* check for nfs. we probably should use
* strcmp(mnt.mnt_fstype, MNTTYPE_NFS), but that's not as fast. */
- if ((lstat(mnt.mnt_mountp, &sb) == 0) && (devno == sb.st_dev) &&
+ if ((stat(mnt.mnt_mountp, &sb) == 0) && (devno == sb.st_dev) &&
strchr(mnt.mnt_special, ':')) {
*nfs = 1;
fclose( mtab );
struct mntent *mnt;
int found=0;
- if ( lstat( file, &sb ) < 0 ) {
+ if (stat(file, &sb) < 0 ) {
return( NULL );
}
devno = sb.st_dev;
while (( mnt = getmntent( mtab )) != NULL ) {
/* check for local fs */
- if ( (lstat( mnt->mnt_fsname, &sb ) == 0) && devno == sb.st_rdev) {
+ if ( (stat( mnt->mnt_fsname, &sb ) == 0) && devno == sb.st_rdev) {
found = 1;
break;
}
/* check for an nfs mount entry. the alternative is to use
* strcmp(mnt->mnt_type, MNTTYPE_NFS) instead of the strchr. */
- if ((lstat(mnt->mnt_dir, &sb) == 0) && (devno == sb.st_dev) &&
+ if ((stat(mnt->mnt_dir, &sb) == 0) && (devno == sb.st_dev) &&
strchr(mnt->mnt_fsname, ':')) {
*nfs = 1;
found = 1;
struct quotctl qc;
#endif
+ memset(dq, 0, sizeof(struct dqblk));
memset(&dqg, 0, sizeof(dqg));
#ifdef __svr4__
#else /* BSD4_4 */
if (get_linux_quota (WANT_USER_QUOTA, vol->v_gvs, uid, dq) !=0) {
- return( AFPERR_PARAM );
+#ifdef DEBUG_QUOTA
+ LOG(log_debug, logtype_afpd, "user quota did not work!" );
+#endif /* DEBUG_QUOTA */
}
if (get_linux_quota(WANT_GROUP_QUOTA, vol->v_gvs, getegid(), &dqg) != 0) {
) /* if */
{
/* use group quota limits rather than user limits */
- dq->dqb_curblocks = dqg.dqb_curblocks;
dq->dqb_bhardlimit = dqg.dqb_bhardlimit;
dq->dqb_bsoftlimit = dqg.dqb_bsoftlimit;
- dq->dqb_btimelimit = dqg.dqb_btimelimit;
+ dq->dqb_curblocks = dqg.dqb_curblocks;
+ dq->dqb_ihardlimit = dqg.dqb_ihardlimit;
+ dq->dqb_isoftlimit = dqg.dqb_isoftlimit;
+ dq->dqb_curinodes = dqg.dqb_curinodes;
+ dq->dqb_btime = dqg.dqb_btime;
+ dq->dqb_itime = dqg.dqb_itime;
+ dq->bsize = dqg.bsize;
} /* if */
#endif /* TRU64 */