1 diff -ur knfsd-1.5.2.orig/utils/rquotad/hasquota.c knfsd-1.5.2/utils/rquotad/hasquota.c
2 --- knfsd-1.5.2.orig/utils/rquotad/hasquota.c Sat Sep 25 02:49:36 1999
3 +++ knfsd-1.5.2/utils/rquotad/hasquota.c Sun Nov 21 00:09:06 1999
5 if (((type == USRQUOTA) && (option = hasmntopt(mnt, MNTOPT_USRQUOTA)) != (char *)0) ||
6 ((type == GRPQUOTA) && (option = hasmntopt(mnt, MNTOPT_GRPQUOTA)) != (char *)0)) {
7 if ((pathname = strchr(option, '=')) == (char *)0) {
8 - *qfnamep=xmalloc(strlen(mnt->mnt_dir)+strlen(qfname)+strlen(qfextension[type])+2);
9 + *qfnamep=xmalloc(strlen(mnt->mnt_dir)+strlen(qfname)+strlen(qfextension[type])+3);
10 (void) sprintf(*qfnamep, "%s%s%s.%s", mnt->mnt_dir,
11 (mnt->mnt_dir[strlen(mnt->mnt_dir) - 1] == '/') ? "" : "/",
12 qfname, qfextension[type]);
13 diff -ur knfsd-1.5.2.orig/utils/rquotad/rquota_server.c knfsd-1.5.2/utils/rquotad/rquota_server.c
14 --- knfsd-1.5.2.orig/utils/rquotad/rquota_server.c Sat Sep 25 02:49:38 1999
15 +++ knfsd-1.5.2/utils/rquotad/rquota_server.c Sat Nov 20 19:40:15 1999
18 char *nfsmount_to_devname(char *pathname, int *blksize)
26 static char *devicename = NULL;
27 static int devicelen = 0;
31 *blksize = st.st_blksize;
34 - * search for devicename in _PATH_DEV_DSK dir.
36 - if ((dp = opendir(_PATH_DEV_DSK)) == (DIR *)0)
39 - while ((de = readdir(dp)) != (struct dirent *)0) {
40 - if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, ".."))
43 - if (devicelen == 0) {
44 - devicelen = sizeof (_PATH_DEV_DSK) + strlen (de->d_name) + 1;
45 - devicename = (char *) xmalloc (devicelen);
48 - int newlen = sizeof (_PATH_DEV_DSK) + strlen (de->d_name) + 1;
49 - if (newlen > devicelen) {
51 - devicename = (char *) xrealloc (devicename, devicelen);
55 - strcpy(devicename, _PATH_DEV_DSK);
56 - strcat(devicename, de->d_name);
57 - if (stat(devicename, &st) == -1)
58 + fp = setmntent(MNTTAB, "r");
59 + while ((mnt = getmntent(fp)) != (struct mntent *)0) {
60 + if (stat(mnt->mnt_fsname, &st) == -1)
63 - if (!S_ISBLK(st.st_mode))
66 - if ((device == st.st_rdev) && S_ISBLK(st.st_mode))
67 + if ((device == st.st_rdev) && S_ISBLK(st.st_mode)) {
68 + if (devicelen == 0) {
69 + devicelen = strlen (mnt->mnt_fsname) + 1;
70 + devicename = (char *) xmalloc (devicelen);
72 + int newlen = strlen (mnt->mnt_fsname) + 1;
73 + if (newlen > devicelen) {
75 + devicename = (char *) xrealloc (devicename, devicelen);
78 + strcpy(devicename, mnt->mnt_fsname);
85 - if (de != (struct dirent *)0) {
86 + if (mnt != (struct mntent *)0) {