Introduce UserID, GroupID for snapshot

Use the fields UID and GID for Unix user and group ID, and the fields
UserID and GroupID for Windows user and group strings.
This commit is contained in:
Alexander Neumann
2015-02-03 22:04:09 +01:00
parent d1fee28ae5
commit bb777d9a58
4 changed files with 77 additions and 16 deletions

16
snapshot_windows.go Normal file
View File

@@ -0,0 +1,16 @@
package restic
import "os/user"
func (sn *Snapshot) fillUserInfo() error {
usr, err := user.Current()
if err != nil {
return err
}
sn.Username = usr.Username
sn.UserID = usr.Uid
sn.GroupID = usr.Gid
return nil
}