Lines Matching refs:attr
57 func (attr *Launcher) Callback(fn func(*syscall.ProcAttr, interface{}) error) {
58 attr.callbackFn = fn
62 func (attr *Launcher) SetUID(uid int) {
63 attr.changeUIDs = true
64 attr.uid = uid
69 func (attr *Launcher) SetGroups(gid int, groups []int) {
70 attr.changeGIDs = true
71 attr.gid = gid
72 attr.groups = groups
76 func (attr *Launcher) SetMode(mode Mode) {
77 attr.changeMode = true
78 attr.mode = mode
84 func (attr *Launcher) SetIAB(iab *IAB) {
85 attr.iab = iab
90 func (attr *Launcher) SetChroot(root string) {
91 attr.chroot = root
132 func launch(result chan<- lResult, attr *Launcher, data interface{}, quit chan<- struct{}) {
146 go launch(result, attr, data, quit)
172 if len(attr.env) != 0 {
173 pa.Env = attr.env
178 if attr.callbackFn != nil {
179 if err = attr.callbackFn(pa, data); err != nil {
184 if needChroot, err = validatePA(pa, attr.chroot); err != nil {
187 if attr.changeUIDs {
188 if err = singlesc.setUID(attr.uid); err != nil {
192 if attr.changeGIDs {
193 if err = singlesc.setGroups(attr.gid, attr.groups); err != nil {
197 if attr.changeMode {
198 if err = singlesc.setMode(attr.mode); err != nil {
202 if attr.iab != nil {
203 if err = singlesc.iabSetProc(attr.iab); err != nil {
217 pid, err = syscall.ForkExec(attr.path, attr.args, pa)
228 func (attr *Launcher) Launch(data interface{}) (int, error) {
229 if attr.path == "" || len(attr.args) == 0 {
240 go launch(result, attr, data, nil)