mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
setusercontext(): Set umask in a separate function, setclassumask()
Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40686
This commit is contained in:
parent
97256feb7a
commit
0dd1705f58
|
@ -380,20 +380,12 @@ setclasscontext(const char *classname, unsigned int flags)
|
|||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Private function which takes care of processing
|
||||
* Private function setting umask from the login class.
|
||||
*/
|
||||
|
||||
static void
|
||||
setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags)
|
||||
setclassumask(login_cap_t *lc, const struct passwd *pwd)
|
||||
{
|
||||
if (lc) {
|
||||
/* Set resources */
|
||||
if (flags & LOGIN_SETRESOURCES)
|
||||
setclassresources(lc);
|
||||
/* See if there's a umask override */
|
||||
if (flags & LOGIN_SETUMASK) {
|
||||
/*
|
||||
* Make it unlikely that someone would input our default sentinel
|
||||
* indicating no specification.
|
||||
|
@ -419,6 +411,21 @@ setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Private function which takes care of processing
|
||||
*/
|
||||
|
||||
static void
|
||||
setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags)
|
||||
{
|
||||
if (lc) {
|
||||
/* Set resources */
|
||||
if (flags & LOGIN_SETRESOURCES)
|
||||
setclassresources(lc);
|
||||
/* See if there's a umask override */
|
||||
if (flags & LOGIN_SETUMASK)
|
||||
setclassumask(lc, pwd);
|
||||
/* Set paths */
|
||||
if (flags & LOGIN_SETPATH)
|
||||
setclassenvironment(lc, pwd, 1);
|
||||
|
|
Loading…
Reference in a new issue