diff --git a/quota-4.00_pre1-Make-RPC-handle-properly-host-names-with-colons.patch b/quota-4.00_pre1-Make-RPC-handle-properly-host-names-with-colons.patch new file mode 100644 index 0000000..32bb15e --- /dev/null +++ b/quota-4.00_pre1-Make-RPC-handle-properly-host-names-with-colons.patch @@ -0,0 +1,91 @@ +From b8ab76ad19e3c284ac14bd0450662bfc41719e03 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Wed, 16 Feb 2011 22:19:55 +0100 +Subject: [PATCH 2/2] Make RPC handle properly host names with colons + +NFS handles server names with colons (usually IPv6 addresses) by encapsulating +them in brackets. Handle this properly. + +Signed-off-by: Jan Kara +--- + rquota_client.c | 48 +++++++++++++++++++++++++++++++++--------------- + 1 files changed, 33 insertions(+), 15 deletions(-) + +diff --git a/rquota_client.c b/rquota_client.c +index cc1d623..53e0579 100644 +--- a/rquota_client.c ++++ b/rquota_client.c +@@ -104,6 +104,35 @@ int rquota_err(int stat) + } + } + ++static int split_nfs_mount(char *devname, char **host, char **path) ++{ ++ char *pathname; ++ ++ /* NFS server name contained in brackets? */ ++ if (*devname == '[') { ++ *host = devname + 1; ++ pathname = strchr(devname, ']'); ++ if (!pathname || pathname[1] != ':') ++ return 0; ++ /* Autofs? */ ++ if (pathname[2] == '(') ++ return 0; ++ *pathname = 0; ++ *path = pathname + 2; ++ return 1; ++ } ++ *host = devname; ++ pathname = strchr(devname, ':'); ++ if (!pathname) ++ return 0; ++ /* Autofs? */ ++ if (pathname[1] == '(') ++ return 0; ++ *pathname = 0; ++ *path = pathname + 1; ++ return 1; ++} ++ + /* + * Collect the requested quota information from a remote host. + */ +@@ -128,13 +157,7 @@ int rpc_rquota_get(struct dquot *dquot) + */ + fsname_tmp = (char *)smalloc(strlen(dquot->dq_h->qh_quotadev) + 1); + strcpy(fsname_tmp, dquot->dq_h->qh_quotadev); +- host = fsname_tmp; +- +- /* +- * Strip off pathname on nfs mounted dir. Ignore entries of any +- * automounter. +- */ +- if ((pathname = strchr(fsname_tmp, ':')) == (char *)0 || *(pathname + 1) == '(') { ++ if (!split_nfs_mount(fsname_tmp, &host, &pathname)) { + free(fsname_tmp); + return -ENOENT; + } +@@ -247,16 +270,11 @@ int rpc_rquota_set(int qcmd, struct dquot *dquot) + */ + fsname_tmp = (char *)smalloc(strlen(dquot->dq_h->qh_quotadev) + 1); + strcpy(fsname_tmp, dquot->dq_h->qh_quotadev); +- host = fsname_tmp; +- +- /* +- * Strip off pathname on nfs mounted dir. Ignore entries of any +- * automounter. +- */ +- if ((pathname = strchr(fsname_tmp, ':')) == (char *)0 || *(pathname + 1) == '(') ++ if (!split_nfs_mount(fsname_tmp, &host, &pathname)) { ++ free(fsname_tmp); + return -ENOENT; ++ } + +- *pathname++ = '\0'; + /* For NFSv4, we send the filesystem path without initial /. Server prepends proper + * NFS pseudoroot automatically and uses this for detection of NFSv4 mounts. */ + if ((dquot->dq_h->qh_io_flags & IOFL_NFS_MIXED_PATHS) && +-- +1.7.4 + diff --git a/quota.spec b/quota.spec index 528d02b..4ddda60 100644 --- a/quota.spec +++ b/quota.spec @@ -62,6 +62,8 @@ Patch21: quota-4.00_pre1-Implement-quotacheck-for-GFS2.patch Patch22: quota-4.00_pre1-Initialize-vfsold-block-and-inode-value-boundries-fo.patch # In upstream 4.00_pre2 Patch23: quota-4.00_pre1-Explain-meaning-of-the-second-column-in-repquota-out.patch +# In upstream 4.00_pre2 +Patch24: quota-4.00_pre1-Make-RPC-handle-properly-host-names-with-colons.patch %description The quota package contains system administration tools for monitoring @@ -155,6 +157,7 @@ Linux/UNIX environment. %patch21 -p1 -b .gfs2_quotacheck %patch22 -p1 -b .inizialize_vfsold_boundries %patch23 -p1 -b .explain_second_column_of_repquota +%patch24 -p1 -b .hostnames_with_columns # quotactl(2) moved into `man-pages' package (bug #640590) rm -f quotactl.2 # remove VCS files @@ -279,6 +282,7 @@ rm -rf %{buildroot} %changelog * Thu Feb 17 2011 Petr Pisar - 1:4.00-0.9.pre1 - Explain meaning of the second column in repquota output +- Make RPC handle properly host names with colons (i.e. IPv6 server host name) * Wed Feb 09 2011 Petr Pisar - 1:4.00-0.8.pre1 - Initialize vfsold block and inode value boundries for new quota file