diff options
author | jkar8572 <jkar8572> | 2009-09-21 15:14:48 +0000 |
---|---|---|
committer | jkar8572 <jkar8572> | 2009-09-21 15:14:48 +0000 |
commit | 56d2188a6c8e7c4b251502f1ad6cb9d4f7aff1b4 (patch) | |
tree | 3f4480cc6020d5d78bf5b735982d04c647b108e9 | |
parent | 4912763906509753a3cf43ec76cd80e2d7965605 (diff) | |
download | linuxquota-56d2188a6c8e7c4b251502f1ad6cb9d4f7aff1b4.tar.gz |
Fixed mountpoint scanning when NFS mountpoint is specified on command line (Jan Kara)
-rw-r--r-- | Changelog | 3 | ||||
-rw-r--r-- | quotasys.c | 8 | ||||
-rw-r--r-- | rquota_server.c | 6 |
3 files changed, 12 insertions, 5 deletions
@@ -1,3 +1,6 @@ +Changes in quota-tools from 3.16 to 3.18 +* Fixed mountpoint scanning when NFS mountpoint is specified on command line (Jan Kara) + Changes in quota-tools from 3.16 to 3.17 * Updated quotactl(2) manpage to mention possible ERANGE error (Jan Kara) * Fix hostname checking of rpc.rquotad. It could allow access even though hostname was in /etc/hosts.deny (Jan Kara) @@ -606,6 +606,10 @@ struct quota_handle **create_handle_list(int count, char **mntpoints, int type, hlist_allocated = START_MNT_POINTS; } + /* If directories are specified, cache all NFS mountpoints */ + if (count && !(mntflags & MS_LOCALONLY)) + mntflags |= MS_NFS_ALL; + if (init_mounts_scan(count, mntpoints, mntflags) < 0) die(2, _("Cannot initialize mountpoint scan.\n")); while ((mnt = get_next_mount())) { @@ -987,9 +991,9 @@ static int cache_mnt_table(int flags) continue; } if (nfs_fstype(mnt->mnt_type)) { + /* For network filesystems we must get device from root */ + dev = st.st_dev; if (!(flags & MS_NFS_ALL)) { - /* For network filesystems we must get device from root */ - dev = st.st_dev; for (i = 0; i < mnt_entries_cnt && mnt_entries[i].me_dev != dev; i++); } else /* Always behave as if the device was unique */ diff --git a/rquota_server.c b/rquota_server.c index c610636..ae45da3 100644 --- a/rquota_server.c +++ b/rquota_server.c @@ -9,7 +9,7 @@ * * This part does the lookup of the info. * - * Version: $Id: rquota_server.c,v 1.19 2007/08/27 12:32:57 jkar8572 Exp $ + * Version: $Id: rquota_server.c,v 1.20 2009/09/21 15:14:48 jkar8572 Exp $ * * Author: Marco van Wieringen <mvw@planets.elm.net> * @@ -167,7 +167,7 @@ setquota_rslt *setquotainfo(int lflags, caddr_t * argp, struct svc_req *rqstp) result.status = Q_NOQUOTA; result.setquota_rslt_u.sqr_rquota.rq_bsize = RPC_DQBLK_SIZE; - if (init_mounts_scan(1, &pathp, MS_QUIET | MS_NO_MNTPOINT | ((flags & FL_AUTOFS) ? 0 : MS_NO_AUTOFS)) < 0) + if (init_mounts_scan(1, &pathp, MS_QUIET | MS_NO_MNTPOINT | MS_NFS_ALL | ((flags & FL_AUTOFS) ? 0 : MS_NO_AUTOFS)) < 0) goto out; if (!(mnt = get_next_mount())) { end_mounts_scan(); @@ -259,7 +259,7 @@ getquota_rslt *getquotainfo(int lflags, caddr_t * argp, struct svc_req * rqstp) result.status = Q_NOQUOTA; result.getquota_rslt_u.gqr_rquota.rq_bsize = RPC_DQBLK_SIZE; - if (init_mounts_scan(1, &pathp, MS_QUIET | MS_NO_MNTPOINT | ((flags & FL_AUTOFS) ? 0 : MS_NO_AUTOFS)) < 0) + if (init_mounts_scan(1, &pathp, MS_QUIET | MS_NO_MNTPOINT | MS_NFS_ALL | ((flags & FL_AUTOFS) ? 0 : MS_NO_AUTOFS)) < 0) goto out; if (!(mnt = get_next_mount())) { end_mounts_scan(); |