Merge pull request #4 from xnox/master

Make shadow more robust in hostile environments
This commit is contained in:
Serge Hallyn
2015-11-12 23:07:29 -06:00
30 changed files with 141 additions and 87 deletions

View File

@@ -968,11 +968,10 @@ int commonio_close (struct commonio_db *db)
} else {
/*
* Default permissions for new [g]shadow files.
* (passwd and group always exist...)
*/
sb.st_mode = 0400;
sb.st_uid = 0;
sb.st_gid = 0;
sb.st_mode = db->st_mode;
sb.st_uid = db->st_uid;
sb.st_gid = db->st_gid;
}
snprintf (buf, sizeof buf, "%s+", db->filename);