]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/rquotad/hasquota.c
Updates from Kevin Coffman at UMich
[nfs-utils.git] / utils / rquotad / hasquota.c
index 008a93f7462ffc1ed1e6d9d61e5f66d1bb8bf19b..f93e90ab479189abf9422a0aa5ad7dce25504932 100644 (file)
@@ -20,6 +20,7 @@
  *          2 of the License, or (at your option) any later version.
  */
 #include "config.h"
+#define _LINUX_QUOTA_VERSION 1
 
 #include <sys/types.h>
 #include <sys/quota.h>
@@ -32,7 +33,7 @@
 #define min(x,y) ((x) < (y)) ? (x) : (y)
 
 #define CORRECT_FSTYPE(type) \
-(!strcmp(type,MNTTYPE_EXT2))
+((!strcmp(type,MNTTYPE_EXT2)) || (!strcmp(type,MNTTYPE_EXT3)))
 
 char *qfextension[] = INITQFNAMES;
 
@@ -51,7 +52,7 @@ hasquota(struct mntent *mnt, int type, char **qfnamep)
    if (((type == USRQUOTA) && (option = hasmntopt(mnt, MNTOPT_USRQUOTA)) != (char *)0) ||
        ((type == GRPQUOTA) && (option = hasmntopt(mnt, MNTOPT_GRPQUOTA)) != (char *)0)) {
       if ((pathname = strchr(option, '=')) == (char *)0) {
-         *qfnamep=xmalloc(strlen(mnt->mnt_dir)+strlen(qfname)+strlen(qfextension[type])+2);
+         *qfnamep=xmalloc(strlen(mnt->mnt_dir)+strlen(qfname)+strlen(qfextension[type])+3);
          (void) sprintf(*qfnamep, "%s%s%s.%s", mnt->mnt_dir,
                        (mnt->mnt_dir[strlen(mnt->mnt_dir) - 1] == '/') ? "" : "/",
                        qfname, qfextension[type]);