Check for and handle errors from getgrnam()
--- 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);