Lines Matching refs:lc
74 setclassresources(login_cap_t *lc) in setclassresources() argument
78 if (lc == NULL) in setclassresources()
107 rcur = (*lr->who)(lc, lr->what, rcur, rcur); in setclassresources()
108 rmax = (*lr->who)(lc, lr->what, rmax, rmax); in setclassresources()
109 rlim.rlim_cur = (*lr->who)(lc, name_cur, rcur, rcur); in setclassresources()
110 rlim.rlim_max = (*lr->who)(lc, name_max, rmax, rmax); in setclassresources()
113 syslog(LOG_WARNING, "set class '%s' resource limit %s: %m", lc->lc_class, lr->what); in setclassresources()
197 setclassenvironment(login_cap_t *lc, const struct passwd * pwd, int paths) in setclassenvironment() argument
208 const char * var = paths ? login_getpath(lc, vars->tag, NULL) in setclassenvironment()
209 : login_getcapstr(lc, vars->tag, NULL, NULL); in setclassenvironment()
227 const char **set_env = login_getcaplist(lc, "setenv", ","); in setclassenvironment()
326 setclasscpumask(login_cap_t *lc) in setclasscpumask() argument
332 maskstr = login_getcapstr(lc, "cpumask", NULL, NULL); in setclasscpumask()
371 login_cap_t *lc; in setclasscontext() local
373 lc = login_getclassbyname(classname, NULL); in setclasscontext()
378 rc = lc ? setusercontext(lc, NULL, 0, flags) : -1; in setclasscontext()
379 login_close(lc); in setclasscontext()
393 setclassumask(login_cap_t *lc, const struct passwd *pwd) in setclassumask() argument
403 if (login_getcapenum(lc, "umask", inherit_enum) == 0) in setclassumask()
406 val = login_getcapnum(lc, "umask", def_val, err_val); in setclassumask()
417 lc->lc_class, in setclassumask()
418 login_getcapstr(lc, "umask", "", "")); in setclassumask()
432 setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags) in setlogincontext() argument
434 if (lc == NULL) in setlogincontext()
439 setclassresources(lc); in setlogincontext()
443 setclassumask(lc, pwd); in setlogincontext()
447 setclassenvironment(lc, pwd, 1); in setlogincontext()
451 setclassenvironment(lc, pwd, 0); in setlogincontext()
455 setclasscpumask(lc); in setlogincontext()
463 setclasspriority(login_cap_t * const lc, struct passwd const * const pwd) in setclasspriority() argument
470 if (login_getcapenum(lc, "priority", inherit_enum) == 0) in setclasspriority()
473 p = login_getcapnum(lc, "priority", def_val, err_val); in setclasspriority()
483 lc->lc_class, in setclasspriority()
484 login_getcapstr(lc, "priority", "", "")); in setclasspriority()
513 lc ? lc->lc_class : "<none>"); in setclasspriority()
531 setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned int flags) in setusercontext() argument
536 if (lc == NULL) { in setusercontext()
537 if (pwd != NULL && (lc = login_getpwclass(pwd)) != NULL) in setusercontext()
538 llc = lc; /* free this when we're done */ in setusercontext()
550 setclasspriority(lc, pwd); in setusercontext()
572 label_string = login_getcapstr(lc, "label", NULL, NULL); in setusercontext()
600 if (lc != NULL && lc->lc_class != NULL && (flags & LOGIN_SETLOGINCLASS)) { in setusercontext()
601 error = setloginclass(lc->lc_class); in setusercontext()
603 syslog(LOG_ERR, "setloginclass(%s): %m", lc->lc_class); in setusercontext()
611 setlogincontext(lc, pwd, flags); in setusercontext()
623 if (geteuid() == uid && (lc = login_getuserclass(pwd)) != NULL) { in setusercontext()
624 setlogincontext(lc, pwd, flags); in setusercontext()
626 setclasspriority(lc, pwd); in setusercontext()
627 login_close(lc); in setusercontext()