From owner-svn-src-stable@freebsd.org Sat Jan 6 22:59:12 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CFF0DF8179; Sat, 6 Jan 2018 22:59:12 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D91DA3785; Sat, 6 Jan 2018 22:59:11 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16F9418BD9; Sat, 6 Jan 2018 22:59:11 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w06MxAFb001697; Sat, 6 Jan 2018 22:59:10 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w06MxAjp001695; Sat, 6 Jan 2018 22:59:10 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201801062259.w06MxAjp001695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 6 Jan 2018 22:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327652 - stable/11/usr.sbin/nandtool X-SVN-Group: stable-11 X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: stable/11/usr.sbin/nandtool X-SVN-Commit-Revision: 327652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jan 2018 22:59:12 -0000 Author: jilles Date: Sat Jan 6 22:59:10 2018 New Revision: 327652 URL: https://svnweb.freebsd.org/changeset/base/327652 Log: MFC r327211: nandtool: Add missing mode for open() with O_CREAT If O_CREAT is given, open() needs a mode argument. Follow the umask by passing 0666. Modified: stable/11/usr.sbin/nandtool/nand_read.c stable/11/usr.sbin/nandtool/nand_readoob.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/nandtool/nand_read.c ============================================================================== --- stable/11/usr.sbin/nandtool/nand_read.c Sat Jan 6 22:56:48 2018 (r327651) +++ stable/11/usr.sbin/nandtool/nand_read.c Sat Jan 6 22:59:10 2018 (r327652) @@ -50,7 +50,7 @@ int nand_read(struct cmd_param *params) } if ((out = param_get_string(params, "out"))) { - out_fd = open(out, O_WRONLY|O_CREAT); + out_fd = open(out, O_WRONLY|O_CREAT, 0666); if (out_fd == -1) { perrorf("Cannot open %s for writing", out); return (1); Modified: stable/11/usr.sbin/nandtool/nand_readoob.c ============================================================================== --- stable/11/usr.sbin/nandtool/nand_readoob.c Sat Jan 6 22:56:48 2018 (r327651) +++ stable/11/usr.sbin/nandtool/nand_readoob.c Sat Jan 6 22:59:10 2018 (r327652) @@ -57,7 +57,7 @@ int nand_read_oob(struct cmd_param *params) } if ((out = param_get_string(params, "out"))) { - if ((fd_out = open(out, O_WRONLY | O_CREAT)) == -1) { + if ((fd_out = open(out, O_WRONLY | O_CREAT, 0666)) == -1) { perrorf("Cannot open %s", out); ret = 1; goto out;