| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| "v.io/x/ref/internal/logger" |
| vsecurity "v.io/x/ref/lib/security" |
| func newLogfile(prefix, name string) (*os.File, error) { |
| nameHash := adler32.Checksum([]byte(name)) |
| f, err := ioutil.TempFile("", fmt.Sprintf("__modules__%s-%x-", prefix, nameHash)) |
| func outputFromFile(f *os.File, out io.Writer) { |
| if f, err = os.Open(fName); err != nil { |
| logger.Global().VI(1).Infof("failed to open %q: %s\n", fName, err) |
| func principalFromDir(dir string) (security.Principal, error) { |
| p, err := vsecurity.LoadPersistentPrincipal(dir, nil) |
| p, err = vsecurity.CreatePersistentPrincipal(dir, nil) |
| if err := vsecurity.InitDefaultBlessings(p, shellBlessingExtension); err != nil { |