From owner-freebsd-hackers@freebsd.org Wed Aug 21 19:32:35 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1DBDD1BEB for ; Wed, 21 Aug 2019 19:32:35 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46DHql0qCPz4QG1 for ; Wed, 21 Aug 2019 19:32:34 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb1-xb30.google.com with SMTP id x10so1478400ybs.13 for ; Wed, 21 Aug 2019 12:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YT/6mb6tJWBmxoOl4DW/FkfKl7ON6xh4FMzePrnR4Ak=; b=UEhseOH+AIF5X/B3Zz5aGBQPK1gRBlPpjfVlje2vwuzDzqEBq8aMOyEO/BAKiQ11JU rMZcTUfZxuosZfW2S7D/9CU3jHD5V1cfx9Sckdfpgw5mGs6PyeJ44jP9CkgSMWbA84mi nQnKvxXMquKNW56nzm6lKG4ov8S1PjLu+0zVqH8RHzWNucFQMsCz+mCOR7hk+vzMs3yZ YVxJIg3reQeDXPw1R2KDLwPWINCosondKKyVcj71Nac+/CKGJTnDXhaPAiXtpaylw5QD UkiO5IufyZWk5l4063tt4RDx5ujmHmnZsuCHk7gyX/i8Qb3QvoJbrNsT3koHNcqLpCC8 qLWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YT/6mb6tJWBmxoOl4DW/FkfKl7ON6xh4FMzePrnR4Ak=; b=X6TElxvQYe/+X7Oc2lNJAV5UR6oxkibPH2w1mze749vN69Ubkz1itOM0ER2JjnWLYj MLR0v9xotTUPggEUCAXiTgvfK6YyrVffYDCCtYgVB/HMn8pJhNx+AaK+WATWmZ0JLLmk Ugsn6i+vMwurHVwPYCt3LfW2NSJj+7/+l0vVFUz9JQe+5lgWW6w+IutJz4ntSjc+jFtd Cl2y76PIKKDr6DXlSb5GXJYMKe1RyvHU1MsPjGfP4LICIt8EZUQhQoqhTs4Xmb22pQ5l hARPt5EJpy53rRjngpEY8VDDI4fv2llaNUw3QRd2BSyi+xirNzIi1ZOGyu/OOm3DObW/ yQAQ== X-Gm-Message-State: APjAAAVkmhcn7uL8Tdl7WgYUaGik/2amrCpSX5FBo/U8GETRXe+k3T42 QDedGzEWhSmQju2uvKfPtDiV0KBXGN6rX/OgDwTIDg== X-Google-Smtp-Source: APXvYqw/NfWzGYkb4CscEcef5adptzPcSY6IbHdEFTrrCfDxtsp2eryTZWsZ3+ObnHHf0HWBFICpqzN3p8Z0xF9a8d0= X-Received: by 2002:a25:c486:: with SMTP id u128mr24970828ybf.428.1566415953803; Wed, 21 Aug 2019 12:32:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:1003:0:0:0:0:0 with HTTP; Wed, 21 Aug 2019 12:32:33 -0700 (PDT) In-Reply-To: <67A10C58-7A1A-4E8E-A567-6A2AD3E195B1@gmail.com> References: <201908171616.x7HGGhpK036345@gndrsh.dnsmgr.net> <67A10C58-7A1A-4E8E-A567-6A2AD3E195B1@gmail.com> From: Oliver Pinter Date: Wed, 21 Aug 2019 21:32:33 +0200 Message-ID: Subject: Re: uname -a default options To: Gordon Bergling Cc: "Rodney W. Grimes" , "freebsd-hackers@freebsd.org" , Ian Lepore X-Rspamd-Queue-Id: 46DHql0qCPz4QG1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=UEhseOH+; dmarc=none; spf=pass (mx1.freebsd.org: domain of oliver.pinter@hardenedbsd.org designates 2607:f8b0:4864:20::b30 as permitted sender) smtp.mailfrom=oliver.pinter@hardenedbsd.org X-Spamd-Result: default: False [-6.44 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-1.00)[-0.997,0]; RCVD_IN_DNSWL_NONE(0.00)[0.3.b.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.94)[ip: (-9.41), ipnet: 2607:f8b0::/32(-2.90), asn: 15169(-2.35), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2019 19:32:35 -0000 On Wednesday, August 21, 2019, Gordon Bergling wrote: > Hi Rod, > > after reading the POSIX spec [1] I agree that the default options behind > =E2=80=9E-a" can not be changed. > > While reading the source of usr.bin/uname/uname.c I recognized that > FreeBSD=E2=80=99s uname is getting its information from sysctl calls. Can= you point > me to right direction where in sys/ the sysctl =E2=80=9Ekern.version=E2= =80=9C (KERN_VERSION > internally) is set? > > I would like create a small patch that changes =E2=80=9E-v=E2=80=9C > from "FreeBSD 12.0-STABLE r351343 GENERIC=E2=80=9C > to =E2=80=9Er351343 GENERIC=E2=80=9C for a further discussion. Please no. Keep them at the current behavior. > > Kind Regards, > > Gordon > > [1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/uname.html > > > Am 17.08.2019 um 18:16 schrieb Rodney W. Grimes < > freebsd-rwg@gndrsh.dnsmgr.net>: > > > >> On Sat, 2019-08-17 at 15:08 +0200, Gordon Bergling wrote: > >>> Hello List, > >>> > >>> "uname -a" is currently mapping the -a option to ?-mnrsv?, which > >>> results in something similar like > >>> > >>> $ uname -a > >>> FreeBSD lion.0xfce3.net 12.0-STABLE FreeBSD > >>> 12.0-STABLE r350835 GENERIC amd64 > >>> > >>> What would you think about reducing the option mapping for ?-a? to ?- > >>> vmn? , which would result in a less repetitive version string like > >>> the one below. > >>> > >>> $ uname -vmn > >>> lion.0xfce3.net FreeBSD 12.0-STABLE r350835 > >>> GENERIC amd64 > >>> > >>> Adapting this would be trivial, but before I hack something together, > >>> I would like to get some feedback if such a change would be welcomed? > >>> > >>> Best regards, > >>> > >>> Gordon > >>> > >> > >> I think there are likely very many existing scripts in the world that > >> parse the output of uname -a and would break if the fields moved aroun= d > >> or disappeared. > > > > I agree that we should not change the output of uname -a, for one > > it is a POSIX spec'ed command, though I would not expect scripts > > to be parsing the output of -a, they should actually invoke the > > more specific item(s) they need and parse those, a much less error > > prone methods. > > > > I would however like to note that Linux (or atleast Ubuntu 19.04) > > has a man page that -a says "All of the below" and are infact returning > > more info than the Posix man page which says -a is -mnrsv > > > > rgrimes@mgmt:~$ uname -a > > Linux mgmt 5.1.0-rc2+ #14 SMP Sun Aug 4 09:23:12 UTC 2019 x86_64 x86_64 > x86_64 GNU/Linux > > rgrimes@mgmt:~$ man uname > > rgrimes@mgmt:~$ uname -mnrsv > > Linux mgmt 5.1.0-rc2+ #14 SMP Sun Aug 4 09:23:12 UTC 2019 x86_64 > > rgrimes@mgmt:~$ uname -m > > x86_64 > > rgrimes@mgmt:~$ uname -n > > mgmt > > rgrimes@mgmt:~$ uname -r > > 5.1.0-rc2+ > > rgrimes@mgmt:~$ uname -s > > Linux > > rgrimes@mgmt:~$ uname -v > > #14 SMP Sun Aug 4 09:23:12 UTC 2019 > > > > FreeBSD: > > root {1003}# uname -a > > FreeBSD w530a.dnsmgr.net 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 > GENERIC amd64 > > root {1004}# uname -m > > amd64 > > root {1005}# uname -n > > w530a.dnsmgr.net > > root {1006}# uname -r > > 12.0-RELEASE > > root {1007}# uname -s > > FreeBSD > > root {1008}# uname -v > > FreeBSD 12.0-RELEASE r341666 GENERIC > > > > So it is really our -v string that is full of redundant > > data that MAY want to be evaluated for trimming. > > > > -- > > Rod Grimes > rgrimes@freebsd.org > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " >