goftp/ftpd

How get file owner and group?

Closed this issue · 3 comments

	if cfg.MustValue("perm", "type") == "leveldb" {
		perm = ldbperm.NewLDBPerm(db, "root", "root", os.ModePerm)
	} else {
		perm = server.NewSimplePerm("root", "root")
	}

In main.go file,It's assign all files owner and group by "root", can get file self owner and group?

lunny commented

This is only a demo program. You can use yourself Perm implementations.

@lunny can you give me some tips?
for example,

func (s *SimplePerm) GetOwner(string) (string, error) {
	return s.owner, nil
}

In GetOwner function, I want get file self owner, but i don't see any other params, it's only string, and this string params is relative path, so i don't get file owner.

Need change other file? driver?

I find my problem, should change driver file. Thanks