MCPcopy Create free account
hub / github.com/F-Stack/f-stack / setlogincontext

Function setlogincontext

tools/libutil/login_class.c:385–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383 */
384
385static mode_t
386setlogincontext(login_cap_t *lc, const struct passwd *pwd,
387 mode_t mymask, unsigned long flags)
388{
389 if (lc) {
390 /* Set resources */
391 if (flags & LOGIN_SETRESOURCES)
392 setclassresources(lc);
393 /* See if there's a umask override */
394 if (flags & LOGIN_SETUMASK)
395 mymask = (mode_t)login_getcapnum(lc, "umask", mymask, mymask);
396 /* Set paths */
397 if (flags & LOGIN_SETPATH)
398 setclassenvironment(lc, pwd, 1);
399 /* Set environment */
400 if (flags & LOGIN_SETENV)
401 setclassenvironment(lc, pwd, 0);
402 /* Set cpu affinity */
403 if (flags & LOGIN_SETCPUMASK)
404 setclasscpumask(lc);
405 }
406 return (mymask);
407}
408
409
410

Callers 1

setusercontextFunction · 0.85

Calls 4

setclassresourcesFunction · 0.85
login_getcapnumFunction · 0.85
setclassenvironmentFunction · 0.85
setclasscpumaskFunction · 0.85

Tested by

no test coverage detected