From owner-freebsd-bugs@FreeBSD.ORG Tue May 24 05:20:08 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FEF81065674 for ; Tue, 24 May 2011 05:20:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0B82C8FC16 for ; Tue, 24 May 2011 05:20:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p4O5K74p059358 for ; Tue, 24 May 2011 05:20:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p4O5K7fw059357; Tue, 24 May 2011 05:20:07 GMT (envelope-from gnats) Resent-Date: Tue, 24 May 2011 05:20:07 GMT Resent-Message-Id: <201105240520.p4O5K7fw059357@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Marcus Reid Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29D63106564A for ; Tue, 24 May 2011 05:14:44 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 1A6D98FC14 for ; Tue, 24 May 2011 05:14:44 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p4O5EhEm020506 for ; Tue, 24 May 2011 05:14:43 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p4O5EhjH020505; Tue, 24 May 2011 05:14:43 GMT (envelope-from nobody) Message-Id: <201105240514.p4O5EhjH020505@red.freebsd.org> Date: Tue, 24 May 2011 05:14:43 GMT From: Marcus Reid To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/157286: showmount omits white space when exported directory name is long X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2011 05:20:08 -0000 >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: