misc/157286: showmount omits white space when exported directory name is long

Marcus Reid marcus at blazingdot.com
Tue May 24 05:20:08 UTC 2011


>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 at 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 at 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:


More information about the freebsd-bugs mailing list