From patchwork Tue Oct 25 16:49:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 121752 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from acsinet14.oracle.com (acsinet14.oracle.com [141.146.126.236]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "acsinet14.oracle.com", Issuer "VeriSign Class 3 International Server CA - G3" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 11202B6F70 for ; Wed, 26 Oct 2011 03:49:54 +1100 (EST) Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by acsinet14.oracle.com (Switch-3.4.4/Switch-3.4.1) with ESMTP id p9PGnqTL024953 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 25 Oct 2011 16:49:52 GMT Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p9PGnmKk007792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 25 Oct 2011 16:49:48 GMT Received: from oss.oracle.com (oss.oracle.com [141.146.12.120]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p9PGnlEx001697 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 25 Oct 2011 16:49:47 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1RIkC6-00048E-If; Tue, 25 Oct 2011 09:49:42 -0700 Received: from rcsinet12.oracle.com ([148.87.113.124]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1RIkC4-000487-7g for fedfs-utils-devel@oss.oracle.com; Tue, 25 Oct 2011 09:49:40 -0700 Received: from mail-iy0-f171.google.com (mail-iy0-f171.google.com [209.85.210.171]) by rcsinet12.oracle.com (Sentrion-MTA-4.2.0/Sentrion-MTA-4.2.0) with ESMTP id p9PGmm2B017534 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 25 Oct 2011 16:49:39 GMT Received: by mail-iy0-f171.google.com with SMTP id n33so975196iae.2 for ; Tue, 25 Oct 2011 09:49:39 -0700 (PDT) Received: by 10.231.5.23 with SMTP id 23mr604313ibt.46.1319561379357; Tue, 25 Oct 2011 09:49:39 -0700 (PDT) Received: from seurat.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net. [99.26.161.222]) by mx.google.com with ESMTPS id el2sm59868518ibb.10.2011.10.25.09.49.37 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Oct 2011 09:49:38 -0700 (PDT) From: Chuck Lever To: fedfs-utils-devel@oss.oracle.com Date: Tue, 25 Oct 2011 12:49:36 -0400 Message-ID: <20111025164936.18584.81728.stgit@seurat.1015granger.net> In-Reply-To: <20111025163952.18584.51838.stgit@seurat.1015granger.net> References: <20111025163952.18584.51838.stgit@seurat.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Subject: [fedfs-utils] [PATCH 09/15] nsdbc: nsdb-list displays "(null)" for the NCE X-BeenThere: fedfs-utils-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: fedfs-utils Developers List-Id: fedfs-utils Developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: fedfs-utils-devel-bounces@oss.oracle.com Errors-To: fedfs-utils-devel-bounces@oss.oracle.com X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-CT-RefId: str=0001.0A090207.4EA6E8AD.0030:SCFSTAT1119972, ss=1, re=-4.000, fgs=0 X-Auth-Type: Internal IP If no NCE is specified on the command line, the user wants the command to hunt for any NCE on the NSDB. However, nsdb-list displays this: $ ./nsdb-list NSDB: nsdb.nfs4bat.org:389, (null) FSN UUID: d3af69ba-f90e-11e0-9390-000c2979d1f3 FSL UUID: 4c054068-f911-11e0-ac05-000c2979d1f3 The "(null)" is unhelpful. In the future, it would be nice to display the NCE under which FSNs were found. That might be quite a bit of work, as it would require bringing the loop that walks through the naming contexts out of the library and adding it to the nsdb-list command. So I'm going to put that off for now. Signed-off-by: Chuck Lever --- src/nsdbc/nsdb-list.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/src/nsdbc/nsdb-list.c b/src/nsdbc/nsdb-list.c index 1ac04b0..77f0567 100644 --- a/src/nsdbc/nsdb-list.c +++ b/src/nsdbc/nsdb-list.c @@ -251,7 +251,12 @@ main(int argc, char **argv) retval = nsdb_list_s(host, nce, &fsns, &ldap_err); switch (retval) { case FEDFS_OK: - printf("NSDB: %s:%u, %s\n", nsdbname, nsdbport, nce); + if (nce == NULL) + printf("NSDB: %s:%u\n", + nsdbname, nsdbport); + else + printf("NSDB: %s:%u, %s\n", + nsdbname, nsdbport, nce); for (i = 0; fsns[i] != NULL; i++) nsdb_list_resolve_and_display_fsn(host, nce, fsns[i]); nsdb_free_string_array(fsns);