X-Git-Url: http://git.vrable.net/?p=cumulus.git;a=blobdiff_plain;f=scandir.cc;h=f902fa09330f6a791541889bde7551cf186b3558;hp=d7752193b0c13d53e2518f7b72ff6c8cda2e5114;hb=f6d3d525bf2c0afa0190e767f6de575cdbd5bcfd;hpb=41bf14f1d09d9da4d6c4df6795d2cf7a48a39ba7 diff --git a/scandir.cc b/scandir.cc index d775219..f902fa0 100644 --- a/scandir.cc +++ b/scandir.cc @@ -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) + ")"; }