Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 May 2017 08:35:46 +0000 (UTC)
From:      Peter Holm <pho@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r318234 - user/pho/stress2/lib
Message-ID:  <201705120835.v4C8ZkKX022382@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pho
Date: Fri May 12 08:35:46 2017
New Revision: 318234
URL: https://svnweb.freebsd.org/changeset/base/318234

Log:
  Added access check to work directory.
  
  Sponsored by:	Dell EMC Isilon

Modified:
  user/pho/stress2/lib/main.c

Modified: user/pho/stress2/lib/main.c
==============================================================================
--- user/pho/stress2/lib/main.c	Fri May 12 08:32:26 2017	(r318233)
+++ user/pho/stress2/lib/main.c	Fri May 12 08:35:46 2017	(r318234)
@@ -199,7 +199,8 @@ main(int argc, char **argv)
 		if (mkdir(op->wd, 0770) == -1)
 			if (errno != EEXIST)
 				err(1, "mkdir(%s) %s:%d", op->wd, __FILE__, __LINE__);
-	}
+	} else if ((sb.st_mode & S_IRWXU) == 0)
+		errx(1, "No RWX access to %s", op->wd);
 	if (stat(op->cd, &sb) == -1) {
 		if (mkdir(op->cd, 0770) == -1)
 			if (errno != EEXIST)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705120835.v4C8ZkKX022382>