[darwinbuild-changes] [831] branches/PR-7872907/darwinup/Depot.cpp

source_changes at macosforge.org source_changes at macosforge.org
Wed Jun 9 11:53:24 PDT 2010


Revision: 831
          http://trac.macosforge.org/projects/darwinbuild/changeset/831
Author:   wsiegrist at apple.com
Date:     2010-06-09 11:53:19 -0700 (Wed, 09 Jun 2010)
Log Message:
-----------
Check for and handle errors from getgrnam()

Modified Paths:
--------------
    branches/PR-7872907/darwinup/Depot.cpp

Modified: branches/PR-7872907/darwinup/Depot.cpp
===================================================================
--- branches/PR-7872907/darwinup/Depot.cpp	2010-06-09 18:23:53 UTC (rev 830)
+++ branches/PR-7872907/darwinup/Depot.cpp	2010-06-09 18:53:19 UTC (rev 831)
@@ -107,8 +107,11 @@
 
 int Depot::create_storage() {
 	uid_t uid = getuid();
+	gid_t gid = 0;
 	struct group *gs = getgrnam("admin");
-	gid_t gid = gs->gr_gid;
+	if (gs) {
+		gid = gs->gr_gid;
+	}
 	
 	int res = mkdir(m_depot_path, m_depot_mode);
 	res = chmod(m_depot_path, m_depot_mode);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20100609/e2748dc8/attachment.html>


More information about the darwinbuild-changes mailing list