From nobody Sun Oct 27 16:37:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xc2HM0v37z5bByN; Sun, 27 Oct 2024 16:37:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xc2HL70jHz4R63; Sun, 27 Oct 2024 16:37:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730047039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SF873R3JgL6jtFrSvsFSnlF58mpgOjonGTGhwTCDJeA=; b=FkeIHzeVE5+N3CtWLO04S23iQ642YPc031t9++JD6wOnv5rlE9o5gMya89nunzQ8u249yi wQ252UmvLqMmp8y8eOIxnUu0vqwv6YpsJsSv0zwfWFchuD1MhbXoQy1bdFf6waAPlGkYSp ourqKbrlY8xUFckAoSpb6wQeu3eZMdRVFkmTj5XgwMmhTtRoSU+xGy1HHsDUrM4N04ieYH lYmgRhQwlVKznHi453APKg55pF3rjGORpASIYFPoW9ME+jYA5k6yLs4LDgm5Y9z+3MyKwJ 40PKcAxUOhTVbXG7LavFSNyeWdYZC86CHYBr3G7c8duSZu3FYK9Q/zCGwwy91A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730047039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SF873R3JgL6jtFrSvsFSnlF58mpgOjonGTGhwTCDJeA=; b=TlmQx4/lapRGSN94wwioA96/F51yt8HxjOwu+zNqtYs4E2hUj+V3rfSu6PY9uxsA8juP8n R2BjqnmBUi5MxSok2dNUFgZOvAFNdwrF14gg0ZJELgYWGXVGQ0DiXRzuMprsur5iWQx8l4 v20ZE1Qs+eRqhMTC4nHy1HsfAe4Ra8jffJG2zCe9wYso1Pas9MLQQPn3mG8r+R3j6H7EUT WU48TacUXy6SnkpZXj02pm/mwEsyGziUmLvoxiLUnpZ0ZjlhMOHFNxpiRjq4FwXKXQZowm WssgmurHeWqJF9oc9lwnXARjD0IdFp8gDhJDshyvBjl+3xUtBiu8W1pvjEh+Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730047039; a=rsa-sha256; cv=none; b=CMMREIwDrg75noOdFyh4BDKJlJIs+LEfLB0fYJ4SZKpG1WFOHyU32j6O7dyDmCIj4TPaV1 XnR97X/IVOxsFOyVCsBpJm7kYJ1j4k8V0PHXLeUFmO9d/iIHPWVCKNGeFpl65nJusr4oQr MtGhHtnn6itedPGbbzp34CTlavm3J4KvYkarvtZrZb5rTNndxIAmRHd09Eqti7DaWf5ur4 Fz1kzxEr9J2w7LRVZJ+uKwW54gu67NTL9u3hPhFi2+LGiwHX2x1KqN6lGnZFenqoEIFxsH T+IWK/mWYBQsAygCVXzX1eezPrXcFY+h85+kSEdjHAg6ik1K9WjHmdjijRSyDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xc2HL6V2Xz12MM; Sun, 27 Oct 2024 16:37:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49RGbIuo037116; Sun, 27 Oct 2024 16:37:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49RGbIXQ037113; Sun, 27 Oct 2024 16:37:18 GMT (envelope-from git) Date: Sun, 27 Oct 2024 16:37:18 GMT Message-Id: <202410271637.49RGbIXQ037113@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: 93181e38342f - main - mktemp(1): bring the documentation up to date with best practice List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93181e38342fc48eb95f83842156be478a4a6f01 Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=93181e38342fc48eb95f83842156be478a4a6f01 commit 93181e38342fc48eb95f83842156be478a4a6f01 Author: Wolfram Schneider AuthorDate: 2024-10-27 16:33:39 +0000 Commit: Wolfram Schneider CommitDate: 2024-10-27 16:36:31 +0000 mktemp(1): bring the documentation up to date with best practice Using short temp filenames as /tmp/temp.XXXX (4 or 6 X) was probably ok 20 years ago, but not anymore. Best practice is to use 10 X. Given that our users often copy & paste examples from our manual pages we need to update the documentation. PR: 261437 --- usr.bin/mktemp/mktemp.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/mktemp/mktemp.1 b/usr.bin/mktemp/mktemp.1 index 68a5a54aa5c5..063f25f216dc 100644 --- a/usr.bin/mktemp/mktemp.1 +++ b/usr.bin/mktemp/mktemp.1 @@ -59,7 +59,7 @@ any file name with some number of .Ql X Ns s appended to it, for example -.Pa /tmp/temp.XXXX . +.Pa /tmp/temp.XXXXXXXXXX . The trailing .Ql X Ns s are replaced with the current process number and/or a @@ -196,7 +196,7 @@ where the script should quit if it cannot get a safe temporary file. .Bd -literal -offset indent tempfoo=`basename $0` -TMPFILE=`mktemp /tmp/${tempfoo}.XXXXXX` || exit 1 +TMPFILE=`mktemp /tmp/${tempfoo}.XXXXXXXXXX` || exit 1 echo "program output" >> $TMPFILE .Ed .Pp @@ -210,7 +210,7 @@ echo "program output" >> $TMPFILE In this case, we want the script to catch the error itself. .Bd -literal -offset indent tempfoo=`basename $0` -TMPFILE=`mktemp -q /tmp/${tempfoo}.XXXXXX` +TMPFILE=`mktemp -q /tmp/${tempfoo}.XXXXXXXXXX` if [ $? -ne 0 ]; then echo "$0: Can't create temp file, exiting..." exit 1