mirror of
https://github.com/restic/restic.git
synced 2025-10-29 13:08:45 +00:00
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:
16
snapshot_windows.go
Normal file
16
snapshot_windows.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user