MCPcopy Index your code
hub / github.com/1Panel-dev/1Panel / SetPath

Method SetPath

agent/utils/toolbox/pure-ftpd.go:188–199  ·  view source on GitHub ↗
(username, path string)

Source from the content-addressed store, hash-verified

186}
187
188func (f *Ftp) SetPath(username, path string) error {
189 if cmd.CheckIllegal(username, path) {
190 return buserr.New("ErrCmdIllegal")
191 }
192 if err := cmd.NewCommandMgr().Run("pure-pw", "usermod", username, "-d", path); err != nil {
193 return err
194 }
195 if err := cmd.NewCommandMgr().Run("chown", "-R", f.DefaultUser+":"+f.DefaultGroup, path); err != nil {
196 return err
197 }
198 return nil
199}
200
201func (f *Ftp) SetStatus(username, status string) error {
202 if cmd.CheckIllegal(username, status) {

Callers 1

UpdateMethod · 0.80

Calls 1

RunMethod · 0.65

Tested by

no test coverage detected