mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	When initialising repositories ensure that the user doing the creation is the initializer (#11601)
Fix #10760 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		@@ -47,7 +47,7 @@ func CreateRepository(doer, u *models.User, opts models.CreateRepoOptions) (_ *m
 | 
				
			|||||||
		// No need for init mirror.
 | 
							// No need for init mirror.
 | 
				
			||||||
		if !opts.IsMirror {
 | 
							if !opts.IsMirror {
 | 
				
			||||||
			repoPath := models.RepoPath(u.Name, repo.Name)
 | 
								repoPath := models.RepoPath(u.Name, repo.Name)
 | 
				
			||||||
			if err = initRepository(ctx, repoPath, u, repo, opts); err != nil {
 | 
								if err = initRepository(ctx, repoPath, doer, repo, opts); err != nil {
 | 
				
			||||||
				if err2 := os.RemoveAll(repoPath); err2 != nil {
 | 
									if err2 := os.RemoveAll(repoPath); err2 != nil {
 | 
				
			||||||
					log.Error("initRepository: %v", err)
 | 
										log.Error("initRepository: %v", err)
 | 
				
			||||||
					return fmt.Errorf(
 | 
										return fmt.Errorf(
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user