From owner-freebsd-scsi@FreeBSD.ORG Thu Oct 7 11:32:54 2010 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29175106566C for ; Thu, 7 Oct 2010 11:32:54 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id B63C28FC1E for ; Thu, 7 Oct 2010 11:32:53 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id BE9E2E6141 for ; Thu, 7 Oct 2010 12:32:52 +0100 (BST) Received: from core.nessbank (client-82-31-12-174.midd.adsl.virginmedia.com [82.31.12.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA for ; Thu, 7 Oct 2010 12:32:52 +0100 (BST) From: Bruce Cran To: freebsd-scsi@freebsd.org Date: Thu, 7 Oct 2010 12:32:51 +0100 User-Agent: KMail/1.13.5 (FreeBSD/9.0-CURRENT; KDE/4.5.1; amd64; ; ) MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_j/arMWt9TpdESy5" Message-Id: <201010071232.51676.bruce@cran.org.uk> Subject: camcontrol patch to allow users to specify device node names X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 11:32:54 -0000 --Boundary-00=_j/arMWt9TpdESy5 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In camcontrol, there's code to check that a device hasn't been specified as "/dev/daX" - in this case, an error is printed and it exits. However, a plain device name is already allowed and I've checked that passing a device node does work. I've attached a patch which removes this restriction and allows people to use "camcontrol tur /dev/da0" if they want to. Is there a reason for disallowing people to specify the device node, or could this patch be committed with an update to the man page to remove the sentence about character device node names not being allowed? -- Bruce Cran --Boundary-00=_j/arMWt9TpdESy5 Content-Type: text/x-patch; charset="ISO-8859-1"; name="camcontrol.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="camcontrol.c.diff" Index: camcontrol.c =================================================================== --- camcontrol.c (revision 213462) +++ camcontrol.c (working copy) @@ -4605,15 +4605,7 @@ char name[30]; int rv; - /* - * First catch people who try to do things like: - * camcontrol tur /dev/da0 - * camcontrol doesn't take device nodes as arguments. - */ - if (argv[2][0] == '/') { - warnx("%s is not a valid device identifier", argv[2]); - errx(1, "please read the camcontrol(8) man page"); - } else if (isdigit(argv[2][0])) { + if (isdigit(argv[2][0])) { /* device specified as bus:target[:lun] */ rv = parse_btl(argv[2], &bus, &target, &lun, &arglist); if (rv < 2) --Boundary-00=_j/arMWt9TpdESy5--