The map::at method does not always exist, so instead use map::find.
[cumulus.git] / scandir.cc
index d775219..8af3175 100644 (file)
@@ -357,12 +357,12 @@ void dump_inode(const string& path,         // Path within snapshot
             file_info["volatile"] = "1";
 
     struct passwd *pwd = getpwuid(stat_buf.st_uid);
-    if (pwd != NULL) {
+    if (pwd != NULL && pwd->pw_name != NULL) {
         file_info["user"] += " (" + uri_encode(pwd->pw_name) + ")";
     }
 
     struct group *grp = getgrgid(stat_buf.st_gid);
-    if (pwd != NULL) {
+    if (grp != NULL && grp->gr_name != NULL) {
         file_info["group"] += " (" + uri_encode(grp->gr_name) + ")";
     }
 
@@ -804,8 +804,7 @@ int main(int argc, char *argv[])
                     tmp_dir.c_str());
             return 1;
         }
-        remote = new RemoteStore(tmp_dir);
-        remote->set_script(backup_script);
+        remote = new RemoteStore(tmp_dir, backup_script=backup_script);
     } else {
         remote = new RemoteStore(backup_dest);
     }