Create dbs with correct permissions.
This commit is contained in:
parent
46a72bc342
commit
bab349b46e
@ -968,11 +968,10 @@ int commonio_close (struct commonio_db *db)
|
|||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Default permissions for new [g]shadow files.
|
* Default permissions for new [g]shadow files.
|
||||||
* (passwd and group always exist...)
|
|
||||||
*/
|
*/
|
||||||
sb.st_mode = 0400;
|
sb.st_mode = db->st_mode;
|
||||||
sb.st_uid = 0;
|
sb.st_uid = db->st_uid;
|
||||||
sb.st_gid = 0;
|
sb.st_gid = db->st_gid;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf (buf, sizeof buf, "%s+", db->filename);
|
snprintf (buf, sizeof buf, "%s+", db->filename);
|
||||||
|
@ -123,6 +123,12 @@ struct commonio_db {
|
|||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
/*@null@*/security_context_t scontext;
|
/*@null@*/security_context_t scontext;
|
||||||
#endif
|
#endif
|
||||||
|
/*
|
||||||
|
* Default permissions and owner for newly created data file.
|
||||||
|
*/
|
||||||
|
mode_t st_mode;
|
||||||
|
uid_t st_uid;
|
||||||
|
gid_t st_gid;
|
||||||
/*
|
/*
|
||||||
* Head, tail, current position in linked list.
|
* Head, tail, current position in linked list.
|
||||||
*/
|
*/
|
||||||
|
@ -130,6 +130,9 @@ static /*@owned@*/struct commonio_db group_db = {
|
|||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
NULL, /* scontext */
|
NULL, /* scontext */
|
||||||
#endif
|
#endif
|
||||||
|
0644, /* st_mode */
|
||||||
|
0, /* st_uid */
|
||||||
|
0, /* st_gid */
|
||||||
NULL, /* head */
|
NULL, /* head */
|
||||||
NULL, /* tail */
|
NULL, /* tail */
|
||||||
NULL, /* cursor */
|
NULL, /* cursor */
|
||||||
|
@ -105,6 +105,9 @@ static struct commonio_db passwd_db = {
|
|||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
NULL, /* scontext */
|
NULL, /* scontext */
|
||||||
#endif
|
#endif
|
||||||
|
0644, /* st_mode */
|
||||||
|
0, /* st_uid */
|
||||||
|
0, /* st_gid */
|
||||||
NULL, /* head */
|
NULL, /* head */
|
||||||
NULL, /* tail */
|
NULL, /* tail */
|
||||||
NULL, /* cursor */
|
NULL, /* cursor */
|
||||||
|
@ -228,6 +228,9 @@ static struct commonio_db gshadow_db = {
|
|||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
NULL, /* scontext */
|
NULL, /* scontext */
|
||||||
#endif
|
#endif
|
||||||
|
0400, /* st_mode */
|
||||||
|
0, /* st_uid */
|
||||||
|
0, /* st_gid */
|
||||||
NULL, /* head */
|
NULL, /* head */
|
||||||
NULL, /* tail */
|
NULL, /* tail */
|
||||||
NULL, /* cursor */
|
NULL, /* cursor */
|
||||||
|
@ -104,6 +104,9 @@ static struct commonio_db shadow_db = {
|
|||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
NULL, /* scontext */
|
NULL, /* scontext */
|
||||||
#endif /* WITH_SELINUX */
|
#endif /* WITH_SELINUX */
|
||||||
|
0400, /* st_mode */
|
||||||
|
0, /* st_uid */
|
||||||
|
0, /* st_gid */
|
||||||
NULL, /* head */
|
NULL, /* head */
|
||||||
NULL, /* tail */
|
NULL, /* tail */
|
||||||
NULL, /* cursor */
|
NULL, /* cursor */
|
||||||
|
@ -541,6 +541,9 @@ static struct commonio_db subordinate_uid_db = {
|
|||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
NULL, /* scontext */
|
NULL, /* scontext */
|
||||||
#endif
|
#endif
|
||||||
|
0644, /* st_mode */
|
||||||
|
0, /* st_uid */
|
||||||
|
0, /* st_gid */
|
||||||
NULL, /* head */
|
NULL, /* head */
|
||||||
NULL, /* tail */
|
NULL, /* tail */
|
||||||
NULL, /* cursor */
|
NULL, /* cursor */
|
||||||
@ -619,6 +622,9 @@ static struct commonio_db subordinate_gid_db = {
|
|||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
NULL, /* scontext */
|
NULL, /* scontext */
|
||||||
#endif
|
#endif
|
||||||
|
0644, /* st_mode */
|
||||||
|
0, /* st_uid */
|
||||||
|
0, /* st_gid */
|
||||||
NULL, /* head */
|
NULL, /* head */
|
||||||
NULL, /* tail */
|
NULL, /* tail */
|
||||||
NULL, /* cursor */
|
NULL, /* cursor */
|
||||||
|
Loading…
Reference in New Issue
Block a user