From owner-freebsd-ports@FreeBSD.ORG Mon Aug 13 03:38:56 2012 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27D92106564A for ; Mon, 13 Aug 2012 03:38:56 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: from mail-gh0-f182.google.com (mail-gh0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6E6E68FC12 for ; Mon, 13 Aug 2012 03:38:54 +0000 (UTC) Received: by ghrr13 with SMTP id r13so3112968ghr.13 for ; Sun, 12 Aug 2012 20:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dataix.net; s=rsa; h=date:from:to:cc:subject:message-id:reply-to:mime-version :content-type:content-disposition; bh=mOtSBxoOpgUmpKAFEyPbPEmICJr5YSDx/hczz2HmsgM=; b=WzxGssnIq7BwOu7x1VtTsHx14dRqQ0AbCE8mO06LoBpev49zDhH3bth/56BzY0+yBF afGdC2lA8v2GwSaey/ueFlSjYoRusnRZ3evQrbw29NZeg4llPpCQ+t25FLcG9d1+V5lg CuYHz2/f8eq5ijM6RBWTQdtRwCEumAaI0AuOM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:reply-to:mime-version :content-type:content-disposition:x-gm-message-state; bh=mOtSBxoOpgUmpKAFEyPbPEmICJr5YSDx/hczz2HmsgM=; b=K6x42+m3SYMogf6kqmxC7IDxnyZNI8jsU4RYDlqz5k95u3hVO91f2mBjahY4Ly0TkB G3CQHEL2qHXoE4qRCrQbk5pFvRDk5aWCx36dgXL/XimKKoVo9vSW8UGYhO56OTZNDkRU 0uaxka6ZpzG5aLtuuSiKfsPfPZvVsei7h5NnyVI18CQgsL0e/iISy97c4phEr28lOGPF B1YjHCzxWJ0PSfN25EqcZQBPrjKJ8M4U1s8x1kvTZdoDQUT2S0uKFN7zZyxToWtL725v PLQ17owbEn/Gx2V+sTID2oakeg9KPBqCcpJZmwfHsTVoVVGcChkZur9RRdS84Rsjggnv nd+A== Received: by 10.50.193.201 with SMTP id hq9mr3951425igc.48.1344829134002; Sun, 12 Aug 2012 20:38:54 -0700 (PDT) Received: from DataIX.net (24-247-252-47.dhcp.aldl.mi.charter.com. [24.247.252.47]) by mx.google.com with ESMTPS id ud8sm11869546igb.4.2012.08.12.20.38.47 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 12 Aug 2012 20:38:53 -0700 (PDT) Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q7D3cahA037384 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 12 Aug 2012 23:38:36 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Received: (from jh@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q7D3cNfb037383; Sun, 12 Aug 2012 23:38:23 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Date: Sun, 12 Aug 2012 23:38:22 -0400 From: Jason Hellenthal To: ports@freebsd.org Message-ID: <20120813033822.GA37015@DataIX.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline X-Gm-Message-State: ALoCoQlsKdt9DYly7wwvxUbGXeXfNIpMPTpotqIUfc4vYme8bq8tm8MHHxGRqMVxhlWhx4smjy35 Cc: Julien Laffaye Subject: line 91 of [github] pkgng libpkg/update.c (use: mkstemp inplace of mktemp) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ports@freebsd.org List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2012 03:38:56 -0000 --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Yeah yeah I know mkstemp instead of mkstemp ??? we already do strlcpy in place. But why not DTRT... On the same subject of /tmp As well should we not be attempting to get environ(7) TMPDIR and honor it throughout all of pkgng ? Added verbage: (off topic) Also line 4 & 14 have an extra space after the asterisks(*) Anyway... nice work on pkgng folks, keep up the AWESOME! work. -- - (2^(N-1)) JJH48-ARIN --VS++wcV0S1rZb1Fb Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="mkstemp.diff" diff --git a/libpkg/update.c b/libpkg/update.c index 0ede23c..942b6b7 100644 --- a/libpkg/update.c +++ b/libpkg/update.c @@ -88,7 +88,7 @@ pkg_update(const char *name, const char *packagesite, bool force) snprintf(url, MAXPATHLEN, "%s/repo.txz", packagesite); (void)strlcpy(tmp, "/tmp/repo.txz.XXXXXX", sizeof(tmp)); - if (mktemp(tmp) == NULL) { + if (mkstemp(tmp) == -1) { pkg_emit_error("Could not create temporary file %s, " "aborting update.\n", tmp); return (EPKG_FATAL); --VS++wcV0S1rZb1Fb--