Date: Tue, 24 May 2011 05:14:43 GMT From: Marcus Reid <marcus@blazingdot.com> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/157286: showmount omits white space when exported directory name is long Message-ID: <201105240514.p4O5EhjH020505@red.freebsd.org> Resent-Message-ID: <201105240520.p4O5K7fw059357@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 157286
>Category: misc
>Synopsis: showmount omits white space when exported directory name is long
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue May 24 05:20:07 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Marcus Reid
>Release: 9.0-CURRENT
>Organization:
>Environment:
FreeBSD austin 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Mon May 9 02:05:32 PDT 2011 root@austin:/usr/obj/usr/src/sys/FARK amd64
>Description:
To put whitespace between the directory and the hostmask, the showmount command uses the following printf:
printf("%-35s", exp->ex_dirp);
This results in no spaces being printed after the path if the path is long. See example.
>How-To-Repeat:
[root@austin /root]# showmount -e
Exports list on localhost:
/long/long/long/long/long/long/long/long/long/long/long/long/pathEveryone
/export Everyone
>Fix:
printf("%-34s ", exp->ex_dirp);
This retains the same output as the original except for the error case. I've attached a small diff with the change.
Patch attached with submission follows:
*** usr.bin/showmount/showmount.c.orig Mon May 23 22:04:09 2011
--- usr.bin/showmount/showmount.c Mon May 23 22:00:23 2011
***************
*** 185,191 ****
printf("Exports list on %s:\n", host);
exp = exportslist;
while (exp) {
! printf("%-35s", exp->ex_dirp);
grp = exp->ex_groups;
if (grp == NULL) {
printf("Everyone\n");
--- 185,191 ----
printf("Exports list on %s:\n", host);
exp = exportslist;
while (exp) {
! printf("%-34s ", exp->ex_dirp);
grp = exp->ex_groups;
if (grp == NULL) {
printf("Everyone\n");
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105240514.p4O5EhjH020505>
