From e39c238ef4ad0d3dbf36cdb2026784179bbb1227 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 8 Jan 2020 17:32:25 +0100 Subject: [PATCH 001/200] fix #9648 (#9652) --- modules/setting/queue.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/setting/queue.go b/modules/setting/queue.go index 546802715f..c91ff55acd 100644 --- a/modules/setting/queue.go +++ b/modules/setting/queue.go @@ -7,6 +7,7 @@ package setting import ( "fmt" "path" + "path/filepath" "strconv" "strings" "time" @@ -44,7 +45,7 @@ func GetQueueSettings(name string) QueueSettings { q := QueueSettings{} sec := Cfg.Section("queue." + name) // DataDir is not directly inheritable - q.DataDir = path.Join(Queue.DataDir, name) + q.DataDir = filepath.Join(Queue.DataDir, name) // QueueName is not directly inheritable either q.QueueName = name + Queue.QueueName for _, key := range sec.Keys() { @@ -55,8 +56,8 @@ func GetQueueSettings(name string) QueueSettings { q.QueueName = key.MustString(q.QueueName) } } - if !path.IsAbs(q.DataDir) { - q.DataDir = path.Join(AppDataPath, q.DataDir) + if !filepath.IsAbs(q.DataDir) { + q.DataDir = filepath.Join(AppDataPath, q.DataDir) } sec.Key("DATADIR").SetValue(q.DataDir) // The rest are... @@ -82,8 +83,8 @@ func GetQueueSettings(name string) QueueSettings { func NewQueueService() { sec := Cfg.Section("queue") Queue.DataDir = sec.Key("DATADIR").MustString("queues/") - if !path.IsAbs(Queue.DataDir) { - Queue.DataDir = path.Join(AppDataPath, Queue.DataDir) + if !filepath.IsAbs(Queue.DataDir) { + Queue.DataDir = filepath.Join(AppDataPath, Queue.DataDir) } Queue.Length = sec.Key("LENGTH").MustInt(20) Queue.BatchLength = sec.Key("BATCH_LENGTH").MustInt(20) From f523372d07be0f6556a9b85d4033ded527b17bea Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Wed, 8 Jan 2020 13:42:28 -0600 Subject: [PATCH 002/200] Add PR review webhook to Telegram (#9653) (#9655) Signed-off-by: jolheiser Co-authored-by: Antoine GIRARD Co-authored-by: Antoine GIRARD --- modules/webhook/telegram.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/modules/webhook/telegram.go b/modules/webhook/telegram.go index 42adb40be2..47d54f7cb9 100644 --- a/modules/webhook/telegram.go +++ b/modules/webhook/telegram.go @@ -148,6 +148,25 @@ func getTelegramPullRequestPayload(p *api.PullRequestPayload) (*TelegramPayload, }, nil } +func getTelegramPullRequestApprovalPayload(p *api.PullRequestPayload, event models.HookEventType) (*TelegramPayload, error) { + var text, attachmentText string + switch p.Action { + case api.HookIssueSynchronized: + action, err := parseHookPullRequestEventType(event) + if err != nil { + return nil, err + } + + text = fmt.Sprintf("[%s] Pull request review %s: #%d %s", p.Repository.FullName, action, p.Index, p.PullRequest.Title) + attachmentText = p.Review.Content + + } + + return &TelegramPayload{ + Message: text + "\n" + attachmentText, + }, nil +} + func getTelegramRepositoryPayload(p *api.RepositoryPayload) (*TelegramPayload, error) { var title string switch p.Action { @@ -192,6 +211,8 @@ func GetTelegramPayload(p api.Payloader, event models.HookEventType, meta string return getTelegramPushPayload(p.(*api.PushPayload)) case models.HookEventPullRequest: return getTelegramPullRequestPayload(p.(*api.PullRequestPayload)) + case models.HookEventPullRequestRejected, models.HookEventPullRequestApproved, models.HookEventPullRequestComment: + return getTelegramPullRequestApprovalPayload(p.(*api.PullRequestPayload), event) case models.HookEventRepository: return getTelegramRepositoryPayload(p.(*api.RepositoryPayload)) case models.HookEventRelease: From 04a77b1f42c64baf33388337839f05be63b8bb77 Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Thu, 9 Jan 2020 00:07:21 -0600 Subject: [PATCH 003/200] Add HTML URL to API Issues (#9654) (#9661) * Add HTML URL to API Issues Signed-off-by: jolheiser * Swagger Signed-off-by: jolheiser Co-authored-by: Lauris BH Co-authored-by: Lauris BH --- models/issue.go | 1 + modules/structs/issue.go | 1 + modules/webhook/dingtalk.go | 2 +- modules/webhook/discord.go | 2 +- modules/webhook/msteams.go | 2 +- modules/webhook/slack.go | 2 +- templates/swagger/v1_json.tmpl | 4 ++++ 7 files changed, 10 insertions(+), 4 deletions(-) diff --git a/models/issue.go b/models/issue.go index 485be4baef..3986aeee15 100644 --- a/models/issue.go +++ b/models/issue.go @@ -381,6 +381,7 @@ func (issue *Issue) apiFormat(e Engine) *api.Issue { apiIssue := &api.Issue{ ID: issue.ID, URL: issue.APIURL(), + HTMLURL: issue.HTMLURL(), Index: issue.Index, Poster: issue.Poster.APIFormat(), Title: issue.Title, diff --git a/modules/structs/issue.go b/modules/structs/issue.go index cc640edab0..49a7dc6d6f 100644 --- a/modules/structs/issue.go +++ b/modules/structs/issue.go @@ -38,6 +38,7 @@ type RepositoryMeta struct { type Issue struct { ID int64 `json:"id"` URL string `json:"url"` + HTMLURL string `json:"html_url"` Index int64 `json:"number"` Poster *User `json:"user"` OriginalAuthor string `json:"original_author"` diff --git a/modules/webhook/dingtalk.go b/modules/webhook/dingtalk.go index 0d569f4120..fc99202a70 100644 --- a/modules/webhook/dingtalk.go +++ b/modules/webhook/dingtalk.go @@ -142,7 +142,7 @@ func getDingtalkIssuesPayload(p *api.IssuePayload) (*DingtalkPayload, error) { Title: issueTitle, HideAvatar: "0", SingleTitle: "view issue", - SingleURL: p.Issue.URL, + SingleURL: p.Issue.HTMLURL, }, }, nil } diff --git a/modules/webhook/discord.go b/modules/webhook/discord.go index c1e8421228..732821c183 100644 --- a/modules/webhook/discord.go +++ b/modules/webhook/discord.go @@ -236,7 +236,7 @@ func getDiscordIssuesPayload(p *api.IssuePayload, meta *DiscordMeta) (*DiscordPa { Title: text, Description: attachmentText, - URL: p.Issue.URL, + URL: p.Issue.HTMLURL, Color: color, Author: DiscordEmbedAuthor{ Name: p.Sender.UserName, diff --git a/modules/webhook/msteams.go b/modules/webhook/msteams.go index b47725209d..b9ceb5ee0b 100644 --- a/modules/webhook/msteams.go +++ b/modules/webhook/msteams.go @@ -299,7 +299,7 @@ func getMSTeamsIssuesPayload(p *api.IssuePayload) (*MSTeamsPayload, error) { Targets: []MSTeamsActionTarget{ { Os: "default", - URI: p.Issue.URL, + URI: p.Issue.HTMLURL, }, }, }, diff --git a/modules/webhook/slack.go b/modules/webhook/slack.go index 11ad4c1b8b..74361509d8 100644 --- a/modules/webhook/slack.go +++ b/modules/webhook/slack.go @@ -158,7 +158,7 @@ func getSlackIssuesPayload(p *api.IssuePayload, slack *SlackMeta) (*SlackPayload pl.Attachments = []SlackAttachment{{ Color: fmt.Sprintf("%x", color), Title: issueTitle, - TitleLink: p.Issue.URL, + TitleLink: p.Issue.HTMLURL, Text: attachmentText, }} } diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 45e84d3ed0..519a273b4e 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -10179,6 +10179,10 @@ "format": "date-time", "x-go-name": "Deadline" }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, "id": { "type": "integer", "format": "int64", From a2b7cc1bb1ea3b86e4200b5e0117154295a9a5a4 Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Thu, 9 Jan 2020 10:50:21 -0600 Subject: [PATCH 004/200] Fix nil reference in repo generation (#9660) (#9666) * Fix nil reference Signed-off-by: jolheiser * Tighten Signed-off-by: jolheiser --- models/repo_generate.go | 66 +++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/models/repo_generate.go b/models/repo_generate.go index 556a5fc2f7..1b0466eaa7 100644 --- a/models/repo_generate.go +++ b/models/repo_generate.go @@ -124,41 +124,43 @@ func generateRepoCommit(e Engine, repo, templateRepo, generateRepo *Repository, return fmt.Errorf("checkGiteaTemplate: %v", err) } - if err := os.Remove(gt.Path); err != nil { - return fmt.Errorf("remove .giteatemplate: %v", err) - } + if gt != nil { + if err := os.Remove(gt.Path); err != nil { + return fmt.Errorf("remove .giteatemplate: %v", err) + } - // Avoid walking tree if there are no globs - if len(gt.Globs()) > 0 { - tmpDirSlash := strings.TrimSuffix(filepath.ToSlash(tmpDir), "/") + "/" - if err := filepath.Walk(tmpDirSlash, func(path string, info os.FileInfo, walkErr error) error { - if walkErr != nil { - return walkErr - } - - if info.IsDir() { - return nil - } - - base := strings.TrimPrefix(filepath.ToSlash(path), tmpDirSlash) - for _, g := range gt.Globs() { - if g.Match(base) { - content, err := ioutil.ReadFile(path) - if err != nil { - return err - } - - if err := ioutil.WriteFile(path, - []byte(generateExpansion(string(content), templateRepo, generateRepo)), - 0644); err != nil { - return err - } - break + // Avoid walking tree if there are no globs + if len(gt.Globs()) > 0 { + tmpDirSlash := strings.TrimSuffix(filepath.ToSlash(tmpDir), "/") + "/" + if err := filepath.Walk(tmpDirSlash, func(path string, info os.FileInfo, walkErr error) error { + if walkErr != nil { + return walkErr } + + if info.IsDir() { + return nil + } + + base := strings.TrimPrefix(filepath.ToSlash(path), tmpDirSlash) + for _, g := range gt.Globs() { + if g.Match(base) { + content, err := ioutil.ReadFile(path) + if err != nil { + return err + } + + if err := ioutil.WriteFile(path, + []byte(generateExpansion(string(content), templateRepo, generateRepo)), + 0644); err != nil { + return err + } + break + } + } + return nil + }); err != nil { + return err } - return nil - }); err != nil { - return err } } From 3a00a690c945bc2224d97a8fed00101063b8eda1 Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 9 Jan 2020 21:37:37 +0000 Subject: [PATCH 005/200] Prevent redirect to Host (#9678) (#9679) --- modules/context/context.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/context/context.go b/modules/context/context.go index 4b590a7181..f8663b9c03 100644 --- a/modules/context/context.go +++ b/modules/context/context.go @@ -1,4 +1,5 @@ // Copyright 2014 The Gogs Authors. All rights reserved. +// Copyright 2020 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. @@ -122,7 +123,7 @@ func (ctx *Context) RedirectToFirst(location ...string) { } u, err := url.Parse(loc) - if err != nil || (u.Scheme != "" && !strings.HasPrefix(strings.ToLower(loc), strings.ToLower(setting.AppURL))) { + if err != nil || ((u.Scheme != "" || u.Host != "") && !strings.HasPrefix(strings.ToLower(loc), strings.ToLower(setting.AppURL))) { continue } From 3fb906dc027bc7e688e2b5b39667b3397c693faa Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Thu, 9 Jan 2020 16:40:57 -0500 Subject: [PATCH 006/200] remove google font call (#9668) (#9681) --- public/vendor/plugins/fomantic/semantic.css | 1 - public/vendor/plugins/fomantic/semantic.min.css | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/public/vendor/plugins/fomantic/semantic.css b/public/vendor/plugins/fomantic/semantic.css index bb4ffb4b81..2059e58ca1 100644 --- a/public/vendor/plugins/fomantic/semantic.css +++ b/public/vendor/plugins/fomantic/semantic.css @@ -8,7 +8,6 @@ * http://opensource.org/licenses/MIT * */ -@import url('https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&subset=latin&display=swap'); /*! * # Fomantic-UI - Reset * http://github.com/fomantic/Fomantic-UI/ diff --git a/public/vendor/plugins/fomantic/semantic.min.css b/public/vendor/plugins/fomantic/semantic.min.css index 9f2dab4a36..4d71b4b903 100644 --- a/public/vendor/plugins/fomantic/semantic.min.css +++ b/public/vendor/plugins/fomantic/semantic.min.css @@ -7,8 +7,7 @@ * Released under the MIT license * http://opensource.org/licenses/MIT * - */ -@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&subset=latin&display=swap);/*! + *//*! * # Fomantic-UI - Reset * http://github.com/fomantic/Fomantic-UI/ * From 11bce6fd3df70596b5364a486c55dec904fbdd9a Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 10 Jan 2020 01:45:59 +0100 Subject: [PATCH 007/200] eliminate horizontal scroll caused by footer (#9674) Co-authored-by: zeripath --- web_src/less/_base.less | 1 + 1 file changed, 1 insertion(+) diff --git a/web_src/less/_base.less b/web_src/less/_base.less index 5ed44c5881..068b9e8144 100644 --- a/web_src/less/_base.less +++ b/web_src/less/_base.less @@ -774,6 +774,7 @@ footer { .container { width: 100vw !important; padding: 0 0.5rem; + max-width: calc(100vw - 1rem) !important; .fa { width: 16px; From a516a7ba0f28f8bb5348beecaef38c99d64861cd Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Fri, 10 Jan 2020 21:58:03 -0600 Subject: [PATCH 008/200] Load milestone in API PR list (#9671) (#9700) --- models/issue.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models/issue.go b/models/issue.go index 3986aeee15..8218614edd 100644 --- a/models/issue.go +++ b/models/issue.go @@ -403,11 +403,12 @@ func (issue *Issue) apiFormat(e Engine) *api.Issue { apiIssue.Closed = issue.ClosedUnix.AsTimePtr() } + issue.loadMilestone(e) if issue.Milestone != nil { apiIssue.Milestone = issue.Milestone.APIFormat() } - issue.loadAssignees(e) + issue.loadAssignees(e) if len(issue.Assignees) > 0 { for _, assignee := range issue.Assignees { apiIssue.Assignees = append(apiIssue.Assignees, assignee.APIFormat()) From ff16099c6da1dd83b8de68842216e2294a5e7447 Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Sat, 11 Jan 2020 03:42:11 -0300 Subject: [PATCH 009/200] Don't attempt to close issue if already closed (#9699) --- modules/repofiles/action.go | 8 +++++--- services/pull/merge.go | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/repofiles/action.go b/modules/repofiles/action.go index d207247114..5fe9333591 100644 --- a/modules/repofiles/action.go +++ b/modules/repofiles/action.go @@ -137,9 +137,11 @@ func UpdateIssuesCommit(doer *models.User, repo *models.Repository, commits []*m continue } } - - if err := changeIssueStatus(refRepo, refIssue, doer, ref.Action == references.XRefActionCloses); err != nil { - return err + close := (ref.Action == references.XRefActionCloses) + if close != refIssue.IsClosed { + if err := changeIssueStatus(refRepo, refIssue, doer, close); err != nil { + return err + } } } } diff --git a/services/pull/merge.go b/services/pull/merge.go index 8aa38bf11e..65a781e54c 100644 --- a/services/pull/merge.go +++ b/services/pull/merge.go @@ -374,8 +374,10 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor return err } close := (ref.RefAction == references.XRefActionCloses) - if err = issue_service.ChangeStatus(ref.Issue, doer, close); err != nil { - return err + if close != ref.Issue.IsClosed { + if err = issue_service.ChangeStatus(ref.Issue, doer, close); err != nil { + return err + } } } From 7eaba6ba8ab2d525bf3e90678c7e17d23f695314 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 11 Jan 2020 14:27:03 +0000 Subject: [PATCH 010/200] Never allow an empty password to validate (#9682) (#9683) * Restore IsPasswordSet previous value * Update models/user.go Co-authored-by: Lauris BH --- models/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/user.go b/models/user.go index f2c0a1861e..9ddd262aed 100644 --- a/models/user.go +++ b/models/user.go @@ -503,7 +503,7 @@ func (u *User) ValidatePassword(passwd string) bool { // IsPasswordSet checks if the password is set or left empty func (u *User) IsPasswordSet() bool { - return len(u.Passwd) > 0 + return !u.ValidatePassword("") } // UploadAvatar saves custom avatar for user. From 0e53a16cca32e3750089b9aebf8b62600517c4f4 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 11 Jan 2020 17:05:24 +0000 Subject: [PATCH 011/200] Missed q.lock.Unlock() will cause panic (#9706) --- modules/queue/queue_wrapped.go | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/queue/queue_wrapped.go b/modules/queue/queue_wrapped.go index d0b93b54d0..0e948bae28 100644 --- a/modules/queue/queue_wrapped.go +++ b/modules/queue/queue_wrapped.go @@ -62,7 +62,6 @@ func (q *delayedStarter) setInternal(atShutdown func(context.Context, func()), h queue, err := NewQueue(q.underlying, handle, q.cfg, exemplar) if err == nil { q.internal = queue - q.lock.Unlock() break } if err.Error() != "resource temporarily unavailable" { From f8ea50cc7a8c7d98a1a4089070905f6cbe254e2f Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 11 Jan 2020 19:06:39 +0000 Subject: [PATCH 012/200] Remove unused lock (#9710) --- modules/queue/queue_disk_channel.go | 2 ++ modules/queue/queue_wrapped.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/queue/queue_disk_channel.go b/modules/queue/queue_disk_channel.go index 895c8ce918..6bb5a1be97 100644 --- a/modules/queue/queue_disk_channel.go +++ b/modules/queue/queue_disk_channel.go @@ -6,6 +6,7 @@ package queue import ( "context" + "sync" "time" "code.gitea.io/gitea/modules/log" @@ -33,6 +34,7 @@ type PersistableChannelQueueConfiguration struct { type PersistableChannelQueue struct { *ChannelQueue delayedStarter + lock sync.Mutex closed chan struct{} } diff --git a/modules/queue/queue_wrapped.go b/modules/queue/queue_wrapped.go index 0e948bae28..c52e6e4673 100644 --- a/modules/queue/queue_wrapped.go +++ b/modules/queue/queue_wrapped.go @@ -28,7 +28,6 @@ type WrappedQueueConfiguration struct { } type delayedStarter struct { - lock sync.Mutex internal Queue underlying Type cfg interface{} @@ -89,6 +88,7 @@ func (q *delayedStarter) setInternal(atShutdown func(context.Context, func()), h // WrappedQueue wraps a delayed starting queue type WrappedQueue struct { delayedStarter + lock sync.Mutex handle HandlerFunc exemplar interface{} channel chan Data From fec35440dbba92644ba02c80bb204daa0bf435b5 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 12 Jan 2020 05:20:33 +0100 Subject: [PATCH 013/200] silence fomantic error regarding tabs (#9713) (#9718) Fomantic expects all tabs to have a target element with content as defined by the data-tab attribute. All our usage of the tab module seems to use element tabs that link to new pages so these content elements are never present and fomantic complains about that in the console with an "Activated tab cannot be found" error. This silences that error. --- web_src/js/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web_src/js/index.js b/web_src/js/index.js index b8145fa439..b701da08b1 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -22,6 +22,9 @@ if (typeof (Dropzone) !== 'undefined') { Dropzone.autoDiscover = false; } +// Silence fomantic's error logging when tabs are used without a target content element +$.fn.tab.settings.silent = true; + function initCommentPreviewTab($form) { const $tabMenu = $form.find('.tabular.menu'); $tabMenu.find('.item').tab(); From dbeef6bb0268460f22ed6158704aa88002bf5e0c Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 12 Jan 2020 11:20:49 +0100 Subject: [PATCH 014/200] =?UTF-8?q?[BugFix]=20[API]=20=E2=80=8B/repos?= =?UTF-8?q?=E2=80=8B/issues=E2=80=8B/search=20(#9698)=20(#9724)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix * fix options * add TEST Co-authored-by: Antoine GIRARD Co-authored-by: Antoine GIRARD --- integrations/api_issue_test.go | 45 ++++++++++++++++++++++++++++++++++ routers/api/v1/repo/issue.go | 28 ++++++++++++--------- 2 files changed, 61 insertions(+), 12 deletions(-) diff --git a/integrations/api_issue_test.go b/integrations/api_issue_test.go index 382fe606bf..ce1c4b7d33 100644 --- a/integrations/api_issue_test.go +++ b/integrations/api_issue_test.go @@ -7,6 +7,7 @@ package integrations import ( "fmt" "net/http" + "net/url" "testing" "code.gitea.io/gitea/models" @@ -120,3 +121,47 @@ func TestAPIEditIssue(t *testing.T) { assert.Equal(t, body, issueAfter.Content) assert.Equal(t, title, issueAfter.Title) } + +func TestAPISearchIssue(t *testing.T) { + defer prepareTestEnv(t)() + + session := loginUser(t, "user2") + token := getTokenForLoggedInUser(t, session) + + link, _ := url.Parse("/api/v1/repos/issues/search") + req := NewRequest(t, "GET", link.String()) + resp := session.MakeRequest(t, req, http.StatusOK) + var apiIssues []*api.Issue + DecodeJSON(t, resp, &apiIssues) + + assert.Len(t, apiIssues, 8) + + query := url.Values{} + query.Add("token", token) + link.RawQuery = query.Encode() + req = NewRequest(t, "GET", link.String()) + resp = session.MakeRequest(t, req, http.StatusOK) + DecodeJSON(t, resp, &apiIssues) + assert.Len(t, apiIssues, 8) + + query.Add("state", "closed") + link.RawQuery = query.Encode() + req = NewRequest(t, "GET", link.String()) + resp = session.MakeRequest(t, req, http.StatusOK) + DecodeJSON(t, resp, &apiIssues) + assert.Len(t, apiIssues, 2) + + query.Set("state", "all") + link.RawQuery = query.Encode() + req = NewRequest(t, "GET", link.String()) + resp = session.MakeRequest(t, req, http.StatusOK) + DecodeJSON(t, resp, &apiIssues) + assert.Len(t, apiIssues, 10) //there are more but 10 is page item limit + + query.Add("page", "2") + link.RawQuery = query.Encode() + req = NewRequest(t, "GET", link.String()) + resp = session.MakeRequest(t, req, http.StatusOK) + DecodeJSON(t, resp, &apiIssues) + assert.Len(t, apiIssues, 0) +} diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index ad82d53e7a..69b8a36995 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -67,20 +67,24 @@ func SearchIssues(ctx *context.APIContext) { // find repos user can access (for issue search) repoIDs := make([]int64, 0) + opts := &models.SearchRepoOptions{ + PageSize: 15, + Private: false, + AllPublic: true, + TopicOnly: false, + Collaborate: util.OptionalBoolNone, + UserIsAdmin: ctx.IsUserSiteAdmin(), + OrderBy: models.SearchOrderByRecentUpdated, + } + if ctx.IsSigned { + opts.Private = true + opts.AllLimited = true + opts.UserID = ctx.User.ID + } issueCount := 0 for page := 1; ; page++ { - repos, count, err := models.SearchRepositoryByName(&models.SearchRepoOptions{ - Page: page, - PageSize: 15, - Private: true, - Keyword: "", - OwnerID: ctx.User.ID, - TopicOnly: false, - Collaborate: util.OptionalBoolNone, - UserIsAdmin: ctx.IsUserSiteAdmin(), - UserID: ctx.User.ID, - OrderBy: models.SearchOrderByRecentUpdated, - }) + opts.Page = page + repos, count, err := models.SearchRepositoryByName(opts) if err != nil { ctx.Error(http.StatusInternalServerError, "SearchRepositoryByName", err) return From 4072f28e60dc6bc6ae637e68e31392d28d5cf3f3 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 12 Jan 2020 18:02:36 +0000 Subject: [PATCH 015/200] Make hook status printing configurable with delay (#9641) (#9725) * Delay printing hook statuses until after 1 second * Move to a 5s delay, wrapped writer structure and add config * Update cmd/hook.go * Apply suggestions from code review * Update cmd/hook.go Co-authored-by: Antoine GIRARD Co-authored-by: Antoine GIRARD --- cmd/hook.go | 148 +++++++++++++++--- .../doc/advanced/config-cheat-sheet.en-us.md | 2 + modules/setting/git.go | 4 + 3 files changed, 128 insertions(+), 26 deletions(-) diff --git a/cmd/hook.go b/cmd/hook.go index aabd9637c2..331f6a2d2d 100644 --- a/cmd/hook.go +++ b/cmd/hook.go @@ -8,10 +8,12 @@ import ( "bufio" "bytes" "fmt" + "io" "net/http" "os" "strconv" "strings" + "time" "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/git" @@ -58,6 +60,85 @@ var ( } ) +type delayWriter struct { + internal io.Writer + buf *bytes.Buffer + timer *time.Timer +} + +func newDelayWriter(internal io.Writer, delay time.Duration) *delayWriter { + timer := time.NewTimer(delay) + return &delayWriter{ + internal: internal, + buf: &bytes.Buffer{}, + timer: timer, + } +} + +func (d *delayWriter) Write(p []byte) (n int, err error) { + if d.buf != nil { + select { + case <-d.timer.C: + _, err := d.internal.Write(d.buf.Bytes()) + if err != nil { + return 0, err + } + d.buf = nil + return d.internal.Write(p) + default: + return d.buf.Write(p) + } + } + return d.internal.Write(p) +} + +func (d *delayWriter) WriteString(s string) (n int, err error) { + if d.buf != nil { + select { + case <-d.timer.C: + _, err := d.internal.Write(d.buf.Bytes()) + if err != nil { + return 0, err + } + d.buf = nil + return d.internal.Write([]byte(s)) + default: + return d.buf.WriteString(s) + } + } + return d.internal.Write([]byte(s)) +} + +func (d *delayWriter) Close() error { + if d == nil { + return nil + } + stopped := d.timer.Stop() + if stopped { + return nil + } + select { + case <-d.timer.C: + default: + } + if d.buf == nil { + return nil + } + _, err := d.internal.Write(d.buf.Bytes()) + d.buf = nil + return err +} + +type nilWriter struct{} + +func (n *nilWriter) Write(p []byte) (int, error) { + return len(p), nil +} + +func (n *nilWriter) WriteString(s string) (int, error) { + return len(s), nil +} + func runHookPreReceive(c *cli.Context) error { if os.Getenv(models.EnvIsInternal) == "true" { return nil @@ -101,6 +182,18 @@ Gitea or set your environment appropriately.`, "") total := 0 lastline := 0 + var out io.Writer + out = &nilWriter{} + if setting.Git.VerbosePush { + if setting.Git.VerbosePushDelay > 0 { + dWriter := newDelayWriter(os.Stdout, setting.Git.VerbosePushDelay) + defer dWriter.Close() + out = dWriter + } else { + out = os.Stdout + } + } + for scanner.Scan() { // TODO: support news feeds for wiki if isWiki { @@ -124,12 +217,10 @@ Gitea or set your environment appropriately.`, "") newCommitIDs[count] = newCommitID refFullNames[count] = refFullName count++ - fmt.Fprintf(os.Stdout, "*") - os.Stdout.Sync() + fmt.Fprintf(out, "*") if count >= hookBatchSize { - fmt.Fprintf(os.Stdout, " Checking %d branches\n", count) - os.Stdout.Sync() + fmt.Fprintf(out, " Checking %d branches\n", count) hookOptions.OldCommitIDs = oldCommitIDs hookOptions.NewCommitIDs = newCommitIDs @@ -147,12 +238,10 @@ Gitea or set your environment appropriately.`, "") lastline = 0 } } else { - fmt.Fprintf(os.Stdout, ".") - os.Stdout.Sync() + fmt.Fprintf(out, ".") } if lastline >= hookBatchSize { - fmt.Fprintf(os.Stdout, "\n") - os.Stdout.Sync() + fmt.Fprintf(out, "\n") lastline = 0 } } @@ -162,8 +251,7 @@ Gitea or set your environment appropriately.`, "") hookOptions.NewCommitIDs = newCommitIDs[:count] hookOptions.RefFullNames = refFullNames[:count] - fmt.Fprintf(os.Stdout, " Checking %d branches\n", count) - os.Stdout.Sync() + fmt.Fprintf(out, " Checking %d branches\n", count) statusCode, msg := private.HookPreReceive(username, reponame, hookOptions) switch statusCode { @@ -173,14 +261,11 @@ Gitea or set your environment appropriately.`, "") fail(msg, "") } } else if lastline > 0 { - fmt.Fprintf(os.Stdout, "\n") - os.Stdout.Sync() + fmt.Fprintf(out, "\n") lastline = 0 } - fmt.Fprintf(os.Stdout, "Checked %d references in total\n", total) - os.Stdout.Sync() - + fmt.Fprintf(out, "Checked %d references in total\n", total) return nil } @@ -206,6 +291,19 @@ Gitea or set your environment appropriately.`, "") } } + var out io.Writer + var dWriter *delayWriter + out = &nilWriter{} + if setting.Git.VerbosePush { + if setting.Git.VerbosePushDelay > 0 { + dWriter = newDelayWriter(os.Stdout, setting.Git.VerbosePushDelay) + defer dWriter.Close() + out = dWriter + } else { + out = os.Stdout + } + } + // the environment setted on serv command repoUser := os.Getenv(models.EnvRepoUsername) isWiki := (os.Getenv(models.EnvRepoIsWiki) == "true") @@ -241,7 +339,7 @@ Gitea or set your environment appropriately.`, "") continue } - fmt.Fprintf(os.Stdout, ".") + fmt.Fprintf(out, ".") oldCommitIDs[count] = string(fields[0]) newCommitIDs[count] = string(fields[1]) refFullNames[count] = string(fields[2]) @@ -250,16 +348,15 @@ Gitea or set your environment appropriately.`, "") } count++ total++ - os.Stdout.Sync() if count >= hookBatchSize { - fmt.Fprintf(os.Stdout, " Processing %d references\n", count) - os.Stdout.Sync() + fmt.Fprintf(out, " Processing %d references\n", count) hookOptions.OldCommitIDs = oldCommitIDs hookOptions.NewCommitIDs = newCommitIDs hookOptions.RefFullNames = refFullNames resp, err := private.HookPostReceive(repoUser, repoName, hookOptions) if resp == nil { + _ = dWriter.Close() hookPrintResults(results) fail("Internal Server Error", err) } @@ -277,9 +374,9 @@ Gitea or set your environment appropriately.`, "") fail("Internal Server Error", "SetDefaultBranch failed with Error: %v", err) } } - fmt.Fprintf(os.Stdout, "Processed %d references in total\n", total) - os.Stdout.Sync() + fmt.Fprintf(out, "Processed %d references in total\n", total) + _ = dWriter.Close() hookPrintResults(results) return nil } @@ -288,19 +385,18 @@ Gitea or set your environment appropriately.`, "") hookOptions.NewCommitIDs = newCommitIDs[:count] hookOptions.RefFullNames = refFullNames[:count] - fmt.Fprintf(os.Stdout, " Processing %d references\n", count) - os.Stdout.Sync() + fmt.Fprintf(out, " Processing %d references\n", count) resp, err := private.HookPostReceive(repoUser, repoName, hookOptions) if resp == nil { + _ = dWriter.Close() hookPrintResults(results) fail("Internal Server Error", err) } wasEmpty = wasEmpty || resp.RepoWasEmpty results = append(results, resp.Results...) - fmt.Fprintf(os.Stdout, "Processed %d references in total\n", total) - os.Stdout.Sync() + fmt.Fprintf(out, "Processed %d references in total\n", total) if wasEmpty && masterPushed { // We need to tell the repo to reset the default branch to master @@ -309,7 +405,7 @@ Gitea or set your environment appropriately.`, "") fail("Internal Server Error", "SetDefaultBranch failed with Error: %v", err) } } - + _ = dWriter.Close() hookPrintResults(results) return nil diff --git a/docs/content/doc/advanced/config-cheat-sheet.en-us.md b/docs/content/doc/advanced/config-cheat-sheet.en-us.md index dc6a1ba346..ea17096ea5 100644 --- a/docs/content/doc/advanced/config-cheat-sheet.en-us.md +++ b/docs/content/doc/advanced/config-cheat-sheet.en-us.md @@ -522,6 +522,8 @@ NB: You must `REDIRECT_MACARON_LOG` and have `DISABLE_ROUTER_LOG` set to `false` - `MAX_GIT_DIFF_FILES`: **100**: Max number of files shown in diff view. - `GC_ARGS`: **\**: Arguments for command `git gc`, e.g. `--aggressive --auto`. See more on http://git-scm.com/docs/git-gc/ - `ENABLE_AUTO_GIT_WIRE_PROTOCOL`: **true**: If use git wire protocol version 2 when git version >= 2.18, default is true, set to false when you always want git wire protocol version 1 +- `VERBOSE_PUSH`: **true**: Print status information about pushes as they are being processed. +- `VERBOSE_PUSH_DELAY`: **5s**: Only print verbose information if push takes longer than this delay. ## Git - Timeout settings (`git.timeout`) - `DEFAUlT`: **360**: Git operations default timeout seconds. diff --git a/modules/setting/git.go b/modules/setting/git.go index 8495be8836..8c8179cba6 100644 --- a/modules/setting/git.go +++ b/modules/setting/git.go @@ -21,6 +21,8 @@ var ( MaxGitDiffLines int MaxGitDiffLineCharacters int MaxGitDiffFiles int + VerbosePush bool + VerbosePushDelay time.Duration GCArgs []string `ini:"GC_ARGS" delim:" "` EnableAutoGitWireProtocol bool Timeout struct { @@ -36,6 +38,8 @@ var ( MaxGitDiffLines: 1000, MaxGitDiffLineCharacters: 5000, MaxGitDiffFiles: 100, + VerbosePush: true, + VerbosePushDelay: 5 * time.Second, GCArgs: []string{}, EnableAutoGitWireProtocol: true, Timeout: struct { From b13b9d3dbd8447e2c4949bd2664615471755b68b Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 12 Jan 2020 19:52:40 +0000 Subject: [PATCH 016/200] Move Errored PRs out of StatusChecking (#9675) (#9726) * Move Errored PRs out of StatusChecking (#9675) * Set Errored PRs out of StatusChecking * Ensure that api status is correctly set too * Update models/pull.go Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com> Co-authored-by: John Olheiser <42128690+jolheiser@users.noreply.github.com> * Update services/pull/check.go Co-authored-by: John Olheiser <42128690+jolheiser@users.noreply.github.com> --- models/pull.go | 3 ++- services/pull/check.go | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/models/pull.go b/models/pull.go index f86892cbfc..94cb2a2a03 100644 --- a/models/pull.go +++ b/models/pull.go @@ -35,6 +35,7 @@ const ( PullRequestStatusChecking PullRequestStatusMergeable PullRequestStatusManuallyMerged + PullRequestStatusError ) // PullRequest represents relation between pull request and repositories. @@ -513,7 +514,7 @@ func (pr *PullRequest) apiFormat(e Engine) *api.PullRequest { } if pr.Status != PullRequestStatusChecking { - mergeable := pr.Status != PullRequestStatusConflict && !pr.IsWorkInProgress() + mergeable := !(pr.Status == PullRequestStatusConflict || pr.Status == PullRequestStatusError) && !pr.IsWorkInProgress() apiPullRequest.Mergeable = mergeable } if pr.HasMerged { diff --git a/services/pull/check.go b/services/pull/check.go index 74185b6815..055403d0df 100644 --- a/services/pull/check.go +++ b/services/pull/check.go @@ -194,10 +194,16 @@ func TestPullRequests(ctx context.Context) { if err != nil { log.Error("GetPullRequestByID[%s]: %v", prID, err) continue + } else if pr.Status != models.PullRequestStatusChecking { + continue } else if manuallyMerged(pr) { continue } else if err = TestPatch(pr); err != nil { log.Error("testPatch[%d]: %v", pr.ID, err) + pr.Status = models.PullRequestStatusError + if err := pr.UpdateCols("status"); err != nil { + log.Error("Unable to update status of pr %d: %v", pr.ID, err) + } continue } checkAndUpdateStatus(pr) From 3e23dad075e280ea4e942feea2b2674fa657b828 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 12 Jan 2020 23:43:16 +0100 Subject: [PATCH 017/200] fix webpack polyfills (#9735) (#9738) webpack polyfills did not work because useBuiltIns: 'entry' expects a explicit core-js import. Changed it to 'usage' which does not require these explicit imports and polyfills based on browserslist. As a result, the built index.js now went from 128kB to 192kB. Ref: https://babeljs.io/docs/en/babel-preset-env#usebuiltins --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 7efde9503e..b53934c621 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -36,7 +36,7 @@ module.exports = { [ '@babel/preset-env', { - useBuiltIns: 'entry', + useBuiltIns: 'usage', corejs: 3, } ] From 28508792ba3341a404c070a6e4519d12661caf61 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 15 Jan 2020 00:55:03 +0800 Subject: [PATCH 018/200] Fix missing updated time on migrated issues and comments (#9744) (#9764) * Fix missing updated time on migrated issues and comments * Fix testing and missing updated on migrating pullrequest Co-authored-by: Antoine GIRARD Co-authored-by: Antoine GIRARD --- modules/migrations/base/comment.go | 1 + modules/migrations/base/issue.go | 1 + modules/migrations/base/pullrequest.go | 1 + modules/migrations/gitea.go | 3 +++ modules/migrations/github.go | 3 +++ modules/migrations/github_test.go | 6 ++++++ 6 files changed, 15 insertions(+) diff --git a/modules/migrations/base/comment.go b/modules/migrations/base/comment.go index 38c544d6e0..94cbabaae6 100644 --- a/modules/migrations/base/comment.go +++ b/modules/migrations/base/comment.go @@ -14,6 +14,7 @@ type Comment struct { PosterName string PosterEmail string Created time.Time + Updated time.Time Content string Reactions *Reactions } diff --git a/modules/migrations/base/issue.go b/modules/migrations/base/issue.go index 08d947b05d..b87a7fec62 100644 --- a/modules/migrations/base/issue.go +++ b/modules/migrations/base/issue.go @@ -19,6 +19,7 @@ type Issue struct { State string // closed, open IsLocked bool Created time.Time + Updated time.Time Closed *time.Time Labels []*Label Reactions *Reactions diff --git a/modules/migrations/base/pullrequest.go b/modules/migrations/base/pullrequest.go index 42456fd314..b1602b8218 100644 --- a/modules/migrations/base/pullrequest.go +++ b/modules/migrations/base/pullrequest.go @@ -21,6 +21,7 @@ type PullRequest struct { Milestone string State string Created time.Time + Updated time.Time Closed *time.Time Labels []*Label PatchURL string diff --git a/modules/migrations/gitea.go b/modules/migrations/gitea.go index f52f6c585a..87d5522ae8 100644 --- a/modules/migrations/gitea.go +++ b/modules/migrations/gitea.go @@ -332,6 +332,7 @@ func (g *GiteaLocalUploader) CreateIssues(issues ...*base.Issue) error { MilestoneID: milestoneID, Labels: labels, CreatedUnix: timeutil.TimeStamp(issue.Created.Unix()), + UpdatedUnix: timeutil.TimeStamp(issue.Updated.Unix()), } userid, ok := g.userMap[issue.PosterID] @@ -406,6 +407,7 @@ func (g *GiteaLocalUploader) CreateComments(comments ...*base.Comment) error { Type: models.CommentTypeComment, Content: comment.Content, CreatedUnix: timeutil.TimeStamp(comment.Created.Unix()), + UpdatedUnix: timeutil.TimeStamp(comment.Updated.Unix()), } if userid > 0 { @@ -574,6 +576,7 @@ func (g *GiteaLocalUploader) newPullRequest(pr *base.PullRequest) (*models.PullR IsLocked: pr.IsLocked, Labels: labels, CreatedUnix: timeutil.TimeStamp(pr.Created.Unix()), + UpdatedUnix: timeutil.TimeStamp(pr.Updated.Unix()), } userid, ok := g.userMap[pr.PosterID] diff --git a/modules/migrations/github.go b/modules/migrations/github.go index fabdb4ae44..9183c9318f 100644 --- a/modules/migrations/github.go +++ b/modules/migrations/github.go @@ -385,6 +385,7 @@ func (g *GithubDownloaderV3) GetIssues(page, perPage int) ([]*base.Issue, bool, Milestone: milestone, State: *issue.State, Created: *issue.CreatedAt, + Updated: *issue.UpdatedAt, Labels: labels, Reactions: reactions, Closed: issue.ClosedAt, @@ -428,6 +429,7 @@ func (g *GithubDownloaderV3) GetComments(issueNumber int64) ([]*base.Comment, er PosterEmail: email, Content: *comment.Body, Created: *comment.CreatedAt, + Updated: *comment.UpdatedAt, Reactions: reactions, }) } @@ -523,6 +525,7 @@ func (g *GithubDownloaderV3) GetPullRequests(page, perPage int) ([]*base.PullReq Milestone: milestone, State: *pr.State, Created: *pr.CreatedAt, + Updated: *pr.UpdatedAt, Closed: pr.ClosedAt, Labels: labels, Merged: merged, diff --git a/modules/migrations/github_test.go b/modules/migrations/github_test.go index d2973b7b6c..bf71ab4756 100644 --- a/modules/migrations/github_test.go +++ b/modules/migrations/github_test.go @@ -157,6 +157,7 @@ func TestGitHubDownloadRepo(t *testing.T) { PosterName: "guillep2k", State: "closed", Created: time.Date(2019, 11, 9, 17, 0, 29, 0, time.UTC), + Updated: time.Date(2019, 11, 12, 20, 29, 53, 0, time.UTC), Labels: []*base.Label{ { Name: "bug", @@ -189,6 +190,7 @@ func TestGitHubDownloadRepo(t *testing.T) { PosterName: "mrsdizzie", State: "closed", Created: time.Date(2019, 11, 12, 21, 0, 6, 0, time.UTC), + Updated: time.Date(2019, 11, 12, 22, 7, 14, 0, time.UTC), Labels: []*base.Label{ { Name: "duplicate", @@ -219,6 +221,7 @@ func TestGitHubDownloadRepo(t *testing.T) { PosterID: 1669571, PosterName: "mrsdizzie", Created: time.Date(2019, 11, 12, 21, 0, 13, 0, time.UTC), + Updated: time.Date(2019, 11, 12, 21, 0, 13, 0, time.UTC), Content: "This is a comment", Reactions: &base.Reactions{ TotalCount: 1, @@ -235,6 +238,7 @@ func TestGitHubDownloadRepo(t *testing.T) { PosterID: 1669571, PosterName: "mrsdizzie", Created: time.Date(2019, 11, 12, 22, 7, 14, 0, time.UTC), + Updated: time.Date(2019, 11, 12, 22, 7, 14, 0, time.UTC), Content: "A second comment", Reactions: &base.Reactions{ TotalCount: 0, @@ -266,6 +270,7 @@ func TestGitHubDownloadRepo(t *testing.T) { PosterName: "mrsdizzie", State: "closed", Created: time.Date(2019, 11, 12, 21, 21, 43, 0, time.UTC), + Updated: time.Date(2019, 11, 12, 21, 39, 28, 0, time.UTC), Labels: []*base.Label{ { Name: "documentation", @@ -302,6 +307,7 @@ func TestGitHubDownloadRepo(t *testing.T) { PosterName: "mrsdizzie", State: "open", Created: time.Date(2019, 11, 12, 21, 54, 18, 0, time.UTC), + Updated: time.Date(2020, 1, 4, 11, 30, 1, 0, time.UTC), Labels: []*base.Label{ { Name: "bug", From 1980e59ac2f0a1859783e283afd3d352df8781b5 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 14 Jan 2020 23:33:12 +0100 Subject: [PATCH 019/200] Fix milestones page (#9771) Signed-off-by: jolheiser Co-authored-by: John Olheiser <42128690+jolheiser@users.noreply.github.com> --- templates/user/dashboard/milestones.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/user/dashboard/milestones.tmpl b/templates/user/dashboard/milestones.tmpl index c16527f9f4..98b99c6430 100644 --- a/templates/user/dashboard/milestones.tmpl +++ b/templates/user/dashboard/milestones.tmpl @@ -65,7 +65,7 @@
{{range .Milestones}}
  • -
    {{if not $.RepoIDs}}{{.Repo.FullName}}{{end}}
    +
    {{.Repo.FullName}}
    {{.Name}}
    From 602c5da9530a56e61b76794cbc9af663ef863473 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 15 Jan 2020 01:41:28 +0100 Subject: [PATCH 020/200] Fix #9752 (#9769) (#9775) Co-authored-by: zeripath --- modules/repofiles/delete.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/repofiles/delete.go b/modules/repofiles/delete.go index 43937c49e1..570838bcd3 100644 --- a/modules/repofiles/delete.go +++ b/modules/repofiles/delete.go @@ -46,7 +46,7 @@ func DeleteRepoFile(repo *models.Repository, doer *models.User, opts *DeleteRepo // If we aren't branching to a new branch, make sure user can commit to the given branch if opts.NewBranch != opts.OldBranch { newBranch, err := repo.GetBranch(opts.NewBranch) - if git.IsErrNotExist(err) { + if err != nil && !git.IsErrBranchNotExist(err) { return nil, err } if newBranch != nil { From c579ad92b5a4eab86562ecef9ad7f50bc533bc1b Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Tue, 14 Jan 2020 20:23:55 -0600 Subject: [PATCH 021/200] Fix SimpleMDE quote reply (#9757) (#9768) Signed-off-by: jolheiser Co-authored-by: zeripath Co-authored-by: zeripath Co-authored-by: Antoine GIRARD --- web_src/js/index.js | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/web_src/js/index.js b/web_src/js/index.js index b701da08b1..7c3749c08b 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -323,12 +323,14 @@ function initSimpleMDEImagePaste(simplemde, files) { }); } +let autoSimpleMDE; + function initCommentForm() { if ($('.comment.form').length === 0) { return; } - setCommentSimpleMDE($('.comment.form textarea:not(.review-textarea)')); + autoSimpleMDE = setCommentSimpleMDE($('.comment.form textarea:not(.review-textarea)')); initBranchSelector(); initCommentPreviewTab($('.comment.form')); initImagePaste($('.comment.form textarea')); @@ -826,25 +828,27 @@ function initRepository() { $('.quote-reply').click(function (event) { $(this).closest('.dropdown').find('.menu').toggle('visible'); const target = $(this).data('target'); + const quote = $(`#comment-${target}`).text().replace(/\n/g, '\n> '); + const content = `> ${quote}\n\n`; let $content; if ($(this).hasClass('quote-reply-diff')) { const $parent = $(this).closest('.comment-code-cloud'); $parent.find('button.comment-form-reply').click(); $content = $parent.find('[name="content"]'); - } else { - $content = $('#content'); + if ($content.val() !== '') { + $content.val(`${$content.val()}\n\n${content}`); + } else { + $content.val(`${content}`); + } + $content.focus(); + } else if (autoSimpleMDE !== null) { + if (autoSimpleMDE.value() !== '') { + autoSimpleMDE.value(`${autoSimpleMDE.value()}\n\n${content}`); + } else { + autoSimpleMDE.value(`${content}`); + } } - - const quote = $(`#comment-${target}`).text().replace(/\n/g, '\n> '); - const content = `> ${quote}\n\n`; - - if ($content.val() !== '') { - $content.val(`${$content.val()}\n\n${content}`); - } else { - $content.val(`${content}`); - } - $content.focus(); event.preventDefault(); }); From 73c90c26d4de3a2ca16e394f432c8624d8bca671 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 15 Jan 2020 08:03:38 +0100 Subject: [PATCH 022/200] Backport Locales [2020-01-14] (#9773) * backport state of 2020-01-14 * Apply suggestions from code review Co-Authored-By: 6543 <6543@obermui.de> Co-authored-by: zeripath --- options/locale/locale_cs-CZ.ini | 1 - options/locale/locale_de-DE.ini | 48 ++++++++++++- options/locale/locale_en-US.ini | 6 ++ options/locale/locale_es-ES.ini | 1 - options/locale/locale_fa-IR.ini | 1 - options/locale/locale_fr-FR.ini | 1 - options/locale/locale_id-ID.ini | 115 ++++++++++++++++++++++++++++++++ options/locale/locale_ja-JP.ini | 53 ++++++++++++++- options/locale/locale_lv-LV.ini | 49 +++++++++++++- options/locale/locale_pl-PL.ini | 1 - options/locale/locale_pt-BR.ini | 7 +- options/locale/locale_tr-TR.ini | 1 - options/locale/locale_uk-UA.ini | 1 - options/locale/locale_zh-CN.ini | 1 - 14 files changed, 272 insertions(+), 14 deletions(-) diff --git a/options/locale/locale_cs-CZ.ini b/options/locale/locale_cs-CZ.ini index b55c985570..a1733d002a 100644 --- a/options/locale/locale_cs-CZ.ini +++ b/options/locale/locale_cs-CZ.ini @@ -2035,4 +2035,3 @@ error.probable_bad_default_signature=VAROVÁNÍ! Ačkoli výchozí klíč má to [units] error.no_unit_allowed_repo=Nejste oprávněni přistupovat k žádné části tohoto repozitáře. error.unit_not_allowed=Nejste oprávněni přistupovat k této části repozitáře. - diff --git a/options/locale/locale_de-DE.ini b/options/locale/locale_de-DE.ini index 2b1fcae835..28c9894720 100644 --- a/options/locale/locale_de-DE.ini +++ b/options/locale/locale_de-DE.ini @@ -606,7 +606,7 @@ clone_helper=Benötigst du Hilfe beim Klonen? Öffne die %s? +monitor.queues=Warteschlangen +monitor.queue=Warteschlange: %s +monitor.queue.name=Name +monitor.queue.type=Typ +monitor.queue.numberworkers=Anzahl der Worker +monitor.queue.maxnumberworkers=Maximale Anzahl der Worker +monitor.queue.review=Konfiguration überprüfen +monitor.queue.review_add=Worker hinzufügen/prüfen +monitor.queue.configuration=Erstkonfiguration +monitor.queue.nopool.title=Kein Worker-Pool +monitor.queue.nopool.desc=Diese Warteschlange umgibt andere Warteschlangen und hat selbst keinen Worker-Pool. +monitor.queue.wrapped.desc=Eine Wrapped Queue umfasst eine langsame Start-Warteschlange und puffert die in der Warteschlange stehenden Aufträge in einem Kanal. Sie besitzt selbst keinen Worker-Pool. +monitor.queue.persistable-channel.desc=Ein persistierender Channel umfasst zwei Warteschlangen, eine Channel-Warteschlange mit einem eigenen Worker-Pool und eine Level-Warteschlange für persistente Anfragen aus früheren Shutdowns. Er hat selbst keinen Worker-Pool. +monitor.queue.pool.timeout=Timeout +monitor.queue.pool.addworkers.title=Worker hinzufügen +monitor.queue.pool.addworkers.submit=Worker hinzufügen +monitor.queue.pool.addworkers.numberworkers.placeholder=Anzahl der Worker +monitor.queue.pool.addworkers.timeout.placeholder=Setze auf 0 für keinen Timeout +monitor.queue.pool.addworkers.musttimeoutduration=Timeout muss eine Golang-Dauer sein, z. B. 5m oder 0 +monitor.queue.settings.title=Pool-Einstellungen +monitor.queue.settings.desc=Pools wachsen dynamisch mit einem Boost als Reaktion auf die Blockierung ihrer Workerwarteschlangen. Diese Änderungen wirken sich nicht auf die aktuellen Worker Gruppen aus. +monitor.queue.settings.timeout=Timeout verlängern +monitor.queue.settings.timeout.placeholder=Derzeit %[1]v +monitor.queue.settings.timeout.error=Timeout muss eine Golang-Dauer sein, z.B. 5m oder 0 +monitor.queue.settings.numberworkers=Anzahl der Worker erhöhen +monitor.queue.settings.numberworkers.placeholder=Derzeit %[1]v +monitor.queue.settings.maxnumberworkers.placeholder=Derzeit %[1]v +monitor.queue.settings.maxnumberworkers.error=Die Anzahl der Worker muss eine Zahl sein +monitor.queue.settings.submit=Einstellungen aktualisieren +monitor.queue.settings.changed=Einstellungen aktualisiert +monitor.queue.settings.blocktimeout=Aktuelle Block-Timeout +monitor.queue.settings.blocktimeout.value=%[1]v +monitor.queue.pool.none=Diese Warteschlange hat keinen Pool +monitor.queue.pool.added=Workergruppe hinzugefügt +monitor.queue.pool.workers.title=Aktive Workergruppen +monitor.queue.pool.workers.none=Keine Workergruppen. +monitor.queue.pool.cancel=Workergruppen herunterfahren +monitor.queue.pool.cancelling=Workergruppe fährt herunter +monitor.queue.pool.cancel_notices=Diese Gruppe von %s Workern herunterfahren? notices.system_notice_list=Systemmitteilungen notices.view_detail_header=Meldungsdetails ansehen @@ -2120,4 +2165,3 @@ error.probable_bad_default_signature=WARNHINWEIS! Obwohl der Standardschlüssel [units] error.no_unit_allowed_repo=Du hast keine Berechtigung, um auf irgendeinen Bereich dieses Repositories zuzugreifen. error.unit_not_allowed=Du hast keine Berechtigung, um auf diesen Repository-Bereich zuzugreifen. - diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index f6ff12250a..320d606485 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1063,6 +1063,8 @@ pulls.no_merge_desc = This pull request cannot be merged because all repository pulls.no_merge_helper = Enable merge options in the repository settings or merge the pull request manually. pulls.no_merge_wip = This pull request can not be merged because it is marked as being a work in progress. pulls.no_merge_status_check = This pull request cannot be merged because not all required status checkes are successful. +pulls.no_merge_not_ready = This pull request is not ready to be merged, check review status and status checks. +pulls.no_merge_access = You are not authorized to merge this pull request. pulls.merge_pull_request = Merge Pull Request pulls.rebase_merge_pull_request = Rebase and Merge pulls.rebase_merge_commit_pull_request = Rebase and Merge (--no-ff) @@ -1413,6 +1415,8 @@ settings.protect_approvals_whitelist_enabled = Restrict approvals to whitelisted settings.protect_approvals_whitelist_enabled_desc = Only reviews from whitelisted users or teams will count to the required approvals. Without approval whitelist, reviews from anyone with write access count to the required approvals. settings.protect_approvals_whitelist_users = Whitelisted reviewers: settings.protect_approvals_whitelist_teams = Whitelisted teams for reviews: +settings.dismiss_stale_approvals = Dismiss stale approvals +settings.dismiss_stale_approvals_desc = When new commits that change the content of the pull request are pushed to the branch, old approvals will be dismissed. settings.add_protected_branch = Enable protection settings.delete_protected_branch = Disable protection settings.update_protect_branch_success = Branch protection for branch '%s' has been updated. @@ -1748,6 +1752,7 @@ users.new_account = Create User Account users.name = Username users.activated = Activated users.admin = Admin +users.restricted = Restricted users.repos = Repos users.created = Created users.last_login = Last Sign-In @@ -1766,6 +1771,7 @@ users.max_repo_creation_desc = (Enter -1 to use the global default limit.) users.is_activated = User Account Is Activated users.prohibit_login = Disable Sign-In users.is_admin = Is Administrator +users.is_restricted = Is Restricted users.allow_git_hook = May Create Git Hooks users.allow_import_local = May Import Local Repositories users.allow_create_organization = May Create Organizations diff --git a/options/locale/locale_es-ES.ini b/options/locale/locale_es-ES.ini index f504c80f04..d82d5215b5 100644 --- a/options/locale/locale_es-ES.ini +++ b/options/locale/locale_es-ES.ini @@ -2109,4 +2109,3 @@ error.probable_bad_default_signature=¡ADVERTENCIA! ¡La clave por defecto tiene [units] error.no_unit_allowed_repo=No tiene permisos para acceder a ninguna sección de este repositorio. error.unit_not_allowed=No tiene permisos para acceder a esta sección del repositorio. - diff --git a/options/locale/locale_fa-IR.ini b/options/locale/locale_fa-IR.ini index e9fc99c500..668c376f63 100644 --- a/options/locale/locale_fa-IR.ini +++ b/options/locale/locale_fa-IR.ini @@ -2120,4 +2120,3 @@ error.probable_bad_default_signature=هشدار! اگرچه اینجا یک کل [units] error.no_unit_allowed_repo=شما اجازه دسترسی به هیچ قسمت از این مخزن را ندارید. error.unit_not_allowed=شما اجازه دسترسی به این قسمت مخزن را ندارید. - diff --git a/options/locale/locale_fr-FR.ini b/options/locale/locale_fr-FR.ini index b9a1b579ad..837ef9a3e2 100644 --- a/options/locale/locale_fr-FR.ini +++ b/options/locale/locale_fr-FR.ini @@ -2096,4 +2096,3 @@ error.probable_bad_default_signature=AVERTISSEMENT ! Bien que la clé par défau [units] error.no_unit_allowed_repo=Vous n'êtes pas autorisé à accéder à n'importe quelle section de ce dépôt. error.unit_not_allowed=Vous n'êtes pas autorisé à accéder à cette section du dépôt. - diff --git a/options/locale/locale_id-ID.ini b/options/locale/locale_id-ID.ini index cd49c4133a..3d42d09905 100644 --- a/options/locale/locale_id-ID.ini +++ b/options/locale/locale_id-ID.ini @@ -10,6 +10,7 @@ link_account=Tautan Akun register=Daftar website=Situs Web version=Versi +powered_by=Diberdayakan oleh %s page=Halaman template=Contoh language=Bahasa @@ -29,8 +30,16 @@ twofa_scratch=Kode Awal Dua Faktor passcode=Kode Akses u2f_insert_key=Masukkan kunci keamanan anda +u2f_sign_in=Tekan tombol pada kunci keamanan anda. Jika kunci keamanan anda tidak memiliki tombol, masukkan kembali. u2f_press_button=Silahkan tekan tombol pada kunci keamanan anda… u2f_use_twofa=Menggunakan kode dua faktor dari telepon anda +u2f_error=Tidak dapat membaca kunci keamanan Anda. +u2f_unsupported_browser=Browser Anda tidak mendukung kunci keamanan U2F. +u2f_error_1=Terdapat kesalahan yang tidak diketahui. Mohon coba lagi. +u2f_error_2=Pastikan menggunakan URL yang benar dan terenkripsi (https://). +u2f_error_3=Server tidak bisa memproses permintaan anda. +u2f_error_4=Kunci keamanan tidak diperbolehkan untuk permintaan ini. Pastikan bahwa kunci ini belum terdaftar sebelumnya. +u2f_error_5=Waktu habis sebelum kunci Anda dapat dibaca. Mohon muat ulang halaman ini dan coba lagi. u2f_reload=Muat Ulang repository=Repositori @@ -58,25 +67,51 @@ forks=Garpu activities=Aktivitas pull_requests=Tarik Permintaan issues=Masalah +milestones=Tonggak cancel=Batal +add=Tambah +add_all=Tambah Semua +remove=Buang +remove_all=Buang Semua +write=Tulis +preview=Pratinjau +loading=Memuat… [startpage] +app_desc=Sebuah layanan hosting Git sendiri yang tanpa kesulitan +install=Mudah dipasang +install_desc=Cukup jalankan program biner yang sesuai dengan sistem operasi Anda. Atau jalankan Gitea dengan Docker atau Vagrant, atau install dari paket. +platform=Lintas platform +platform_desc=Gitea bisa digunakan di mana Go bisa dijalankan: Windows, macOS, Linux, ARM, dll. Silahkan pilih yang Anda suka! +lightweight=Ringan +lightweight_desc=Gitea hanya membutuhkan persyaratan minimal dan bisa berjalan pada Raspberry Pi yang murah. Bisa menghemat listrik! +license=Sumber Terbuka +license_desc="Go get" (Dapatkan kode sumber dari) code.gitea.io/gitea! Mari bergabung dengan berkontribusi untuk membuat proyek ini lebih baik. Jangan malu untuk menjadi kontributor! [install] install=Pemasangan title=Konfigurasi Awal +docker_helper=Jika Anda menjalankan Gitea di dalam Docker, baca dokumentasi sebelum mengubah pengaturan. +requite_db_desc=Gitea memerlukan MySQL, PostgreSQL, MSSQL atau SQLite3. db_title=Pengaturan Basis Data db_type=Tipe Basis Data host=Host user=Nama Pengguna password=Kata Sandi db_name=Nama Basis Data +db_helper=Untuk pengguna MySQL: Mohon gunakan mesin penyimpanan InnoDB, dan jika Anda menggunakan enkoding "utf8mb4", versi InnoDB Anda harus diatas 5.6. ssl_mode=SSL +charset=Jenis karakter path=Jalur +sqlite_helper=Jalur berkas untuk basis data SQLite3 atau TiDB.
    Masukkan path absolut jika anda menjalankan Gitea sebagai layanan. +err_empty_db_path=Jalur basis data SQLite3 tidak boleh kosong. no_admin_and_disable_registration=Anda tidak dapat menonaktifkan pendaftaran tanpa membuat akun admin. err_empty_admin_password=Sandi administrator tidak boleh kosong. +err_empty_admin_email=Email administrator tidak boleh kosong. +err_admin_name_is_reserved=Nama pengguna Administrator tidak valid, nama tersebut dicadangkan +err_admin_name_is_invalid=Nama Administrator tidak valid. general_title=Pengaturan Umum app_name=Judul Situs @@ -111,13 +146,20 @@ server_service_title=Server dan Pengaturan Layanan Pihak Ketiga offline_mode=Aktifkan Mode Lokal offline_mode_popup=Non-aktifkan jaringan pengiriman konten dari pihak ketiga dan layani semua sumber daya secara lokal. disable_gravatar=Non-aktifkan Gravatar +federated_avatar_lookup=Aktifkan Avatar Terfederasi federated_avatar_lookup_popup=Mengaktifkan pencarian avatar federasi menggunakan Libravatar. +disable_registration=Matikan Swa-pendaftaran +disable_registration_popup=Nonaktifkan pendaftaran oleh pengguna. Hanya admin yang dapat membuat akun pengguna baru. +allow_only_external_registration_popup=Perbolehkan Pendaftaran Hanya Melalui Layanan External openid_signin=Aktifkan Login OpenID +openid_signin_popup=Aktifkan masuk pengguna lewat OpenID. openid_signup=Aktifkan Pendaftaran OpenID openid_signup_popup=Aktifkan pendaftaran berdasarkan OpenID. enable_captcha=Aktifkan CAPTCHA enable_captcha_popup=Membutukan CAPTCHA untuk pendaftaran. require_sign_in_view=Anda Harus Login untuk Melihat Halaman +require_sign_in_view_popup=Batasi akses halaman hanya pada pengguna yang masuk. Pengunjung hanya dapat melihat halaman masuk dan pendaftaran. +admin_setting_desc=Akun administrator tidak wajib dibuat. Pengguna yang pertama kali mendaftar akan secara otomatis menjadi administrator. admin_title=Pengaturan Akun Admin admin_name=Nama Pengguna Admin admin_password=Kata sandi @@ -127,7 +169,15 @@ install_btn_confirm=Memasang Gitea test_git_failed=Tidak dapat menguji perintah 'git': %v sqlite3_not_available=Gitea versi ini tidak mendukung SQLite3, Silahkan untuh versi biner resmi dari %s (bukan versi 'gobuild'). invalid_db_setting=Pengaturan basis data tidak valid: %v +invalid_repo_path=Lokasi folder repositori tidak valid: %v +run_user_not_match=Nama pengguna 'run as' bukanlah nama pengguna saat ini: %s -> %s save_config_failed=Gagal menyimpan konfigurasi: %v +invalid_admin_setting=Pengaturan akun administrator tidak valid: %v +install_success=Selamat datang! Terimakasih telah memilih Gitea. Selamat bersenang-senang dan hati-hati! +invalid_log_root_path=Jalur folder log tidak valid: %v +default_keep_email_private=Sembunyikan Alamat Email secara Asali +default_keep_email_private_popup=Sembunyikan alamat email pengguna baru secara asali. +default_allow_create_organization_popup=Perbolehkan pengguna baru untuk membuat organisasi. [home] uname_holder=Nama Pengguna atau Alamat Surel @@ -161,36 +211,50 @@ social_register_helper_msg=Sudah memiliki akun? Hubungkan sekarang! remember_me=Ingat Saya forgot_password_title=Lupa Kata Sandi forgot_password=Lupa kata sandi? +sign_up_now=Butuh akun? Daftar sekarang. +sign_up_successful=Akun berhasil dibuat. confirmation_mail_sent_prompt=Surel konfirmasi baru telah dikirim ke %s. Silakan periksa kotak masuk anda dalam %s ke depan untuk menyelesaikan proses pendaftaran. active_your_account=Aktifkan Akun Anda +account_activated=Akun telah diaktifkan +prohibit_login_desc=Akun Anda tidak diperbolehkan untuk masuk, silakan hubungi admin situs. has_unconfirmed_mail=Hai %s, anda memiliki sebuah alamat surel yang belum dikonfirmasi (%s). Jika anda belum menerima surel konfirmasi atau perlu untuk mengirim ulang yang baru, silakan klik pada tombol di bawah. resend_mail=Klik di sini untuk mengirim ulang surel aktivasi anda email_not_associate=Alamat surel tidak terhubung dengan akun apapun. +send_reset_mail=Kirim Surel Pemulihan Akun +reset_password=Pemulihan Akun +password_too_short=Panjang kata sandi tidak boleh kurang dari %d karakter. verify=Verifikasi scratch_code=Kode coretan use_scratch_code=Gunakan kode coretan twofa_scratch_used=Anda telah menggunakan kode coretan anda. Anda telah dialihkan ke halaman pengaturan dua-faktor jadi anda boleh menghapus pendaftaran perangkat anda atau menghasilkan kode coretan yang baru. +twofa_passcode_incorrect=Kata sandi Anda salah. Jika Anda salah tempatkan perangkat Anda, gunakan kode gosok Anda untuk masuk. twofa_scratch_token_incorrect=Kode coretan anda tidak tepat. login_openid=OpenID openid_connect_submit=Sambungkan openid_connect_title=Sambungkan ke akun yang sudah ada openid_register_title=Buat akun baru +openid_signin_desc=Masukkan URI OpenID Anda. Misalnya: https://anne.me, bob.openid.org.cn, atau gnusocial.net/carry. +email_domain_blacklisted=Anda tidak dapat mendaftar dengan alamat email. +authorize_application=Izinkan aplikasi [mail] activate_account=Silakan aktifkan akun anda activate_email=Verifikasi alamat surel anda +reset_password=Pulihkan akun Anda register_success=Pendaftaran berhasil register_notify=Selamat Datang di Gitea [modal] yes=Ya no=Tidak +modify=Perbarui [form] UserName=Nama Pengguna RepoName=Nama repositori Email=Alamat surel Password=Kata Sandi +Retype=Ketik Ulang Kata Sandi SSHTitle=Nama kunci SSH HttpsUrl=HTTPS URL PayloadUrl=Muatan URL @@ -205,6 +269,7 @@ CommitChoice=Pilihan Commit TreeName=Jalur berkas Content=Konten +SSPISeparatorReplacement=Pemisah require_error=` tidak boleh kosong.` size_error=` harus berukuran %s.` @@ -214,53 +279,100 @@ email_error=` bukan alamat surel yang valid. ` url_error=` bukan URL yang valid.` include_error=` harus mengandung substring '%s'.` unknown_error=Kesalahan yang tidak diketahui: +lang_select_error=Pilih bahasa dari daftar. +email_been_used=Alamat email sudah digunakan. +openid_been_used=Alamat OpenID '%s' sudah digunakan. +username_password_incorrect=Nama pengguna atau sandi salah. +password_complexity=Kata sandi tidak memenuhi persyaratan kerumitan: +password_lowercase_one=Sekurang-kurangnya satu karakter kecil +password_uppercase_one=Sekurang-kurangnya satu karakter besar +password_digit_one=Sekurang-kurangnya satu angka +password_special_one=Sekurang-kurangnya satu karater khusus (tanda baca, kurung, kutip, dll.) +enterred_invalid_repo_name=Nama repositori yang Anda masukkan salah. +enterred_invalid_owner_name=Nama pemilik baru salah. +enterred_invalid_password=Kata sandi yang Anda masukkan salah. user_not_exist=Pengguna tidak ada. +team_not_exist=Tim tidak ada. +last_org_owner=Anda tidak dapat menghapus pengguna terakhir dari tim pemilik. Harus ada setidaknya satu pemilik dalam tim yang diberikan. +cannot_add_org_to_team=Sebuah organisasi tidak dapat ditambahkan sebagai anggota tim. +invalid_ssh_key=Tidak dapat memverifikasi kunci SSH Anda: %s +invalid_gpg_key=Tidak dapat memverifikasi kunci GPG Anda: %s +unable_verify_ssh_key=Tidak dapat memverifikasi kunci SSH; periksa kembali bila ada kesalahan. auth_failed=Otentikasi gagal: %v +still_own_repo=Akun anda memiliki satu atau lebih repositori, pindahkan atau transfer terlebih dahulu. +still_has_org=Akun Anda adalah anggota dari satu atau lebih organisasi, tinggalkan terlebih dahulu. +org_still_own_repo=Organisasi ini masih memiliki satu atau lebih repositori; hapus atau transfer terlebih dahulu. target_branch_not_exist=Target cabang tidak ada. [user] +change_avatar=Ganti avatar anda… join_on=Telah bergabung di repositories=Repositori activity=Aktivitas Publik followers=Pengikut +starred=Repositori Terbintang following=Mengikuti follow=Ikuti unfollow=Berhenti Mengikuti +heatmap.loading=Memuat Peta Panas… +user_bio=Biografi form.name_reserved=Nama pengguna '%s' dicadangkan. +form.name_pattern_not_allowed=Pola '%s' tidak diperbolehkan dalam nama pengguna. [settings] profile=Profil +account=Akun password=Kata Sandi security=Keamanan avatar=Avatar ssh_gpg_keys=Kunci SSH / GPG social=Akun Sosial +applications=Aplikasi +orgs=Kelola organisasi repos=Repositori delete=Hapus Akun twofa=Otentikasi Dua-Faktor +account_link=Akun Tertaut +organization=Organisasi uid=Uid +u2f=Kunci keamanan public_profile=Profil Publik +profile_desc=Alamat email Anda akan digunakan untuk notifikasi dan operasi lainnya. +password_username_disabled=Pengguna non-lokal tidak diizinkan untuk mengubah nama pengguna mereka. Silakan hubungi administrator sistem anda untuk lebih lanjut. full_name=Nama Lengkap website=Situs Web location=Lokasi +update_theme=Perbarui Tema update_profile=Perbarui Profil update_profile_success=Profil anda telah diperbarui. +change_username=Nama pengguna Anda telah diganti. +change_username_prompt=Catatan: Perubahan nama pengguna juga mengubah URL akun Anda. continue=Lanjutkan cancel=Batalkan +language=Bahasa +ui=Tema +lookup_avatar_by_mail=Cari Avatar melalui Alamat Email federated_avatar_lookup=Aktifkan Pencarian Avatar Representasi enable_custom_avatar=Gunakan Avatar Pilihan choose_new_avatar=Pilih avatar baru +update_avatar=Perbarui Avatar delete_current_avatar=Hapus Avatar Saat Ini +uploaded_avatar_not_a_image=Berkas yang diunggah bukanlah gambar. +uploaded_avatar_is_too_big=Berkas yang diunggah melebihi ukuran maksimum. +update_avatar_success=Avatar Anda telah diperbarui. +change_password=Perbarui kata sandi old_password=Kata Sandi Saat Ini new_password=Kata Sandi Baru +retype_new_password=Ketik Ulang Kata Sandi Baru +password_incorrect=Kata sandi saat ini salah. emails=Alamat Surel email_desc=Alamat surel utama anda akan digunakan untuk notifikasi dan operasi lainnya. @@ -318,6 +430,7 @@ confirm_delete_account=Konfirmasi Penghapusan owner=Pemilik repo_name=Nama Repositori visibility=Jarak pandang +clone_helper=Butuh bantuan kloning? Kunjungi Bantuan. fork_repo=Cabang Gudang penyimpanan fork_from=Cabang Dari repo_desc=Deskripsi @@ -508,6 +621,7 @@ pulls.new=Permintaan Tarik Baru pulls.filter_branch=Penyaringan cabang pulls.no_results=Hasil tidak ditemukan. pulls.create=Buat Permintaan Tarik +pulls.title_desc=ingin menggabungkan komit %[1]d dari %[2]s menuju %[3]s pulls.merged_title_desc=commit %[1]d telah digabungkan dari %[2]s menjadi %[3]s %[4]s pulls.tab_conversation=Percakapan pulls.tab_commits=Melakukan @@ -625,6 +739,7 @@ settings.webhook.request=Permintaan settings.webhook.response=Tanggapan settings.webhook.headers=Tajuk settings.webhook.body=Tubuh +settings.githooks_desc=Kaitan Git diberdayakan oleh Git itu sendiri. Anda bisa menyunting berkas kaitan di bawah untuk mempersiapkan operasi kustom. settings.githook_edit_desc=Jika hook tidak aktif, konten sampel akan dipaparkan. Meninggalkan konten dengan nilai kosong akan menonaktifkan hook ini. settings.githook_name=Nama Hook settings.githook_content=Konten Hook diff --git a/options/locale/locale_ja-JP.ini b/options/locale/locale_ja-JP.ini index ababfbb58d..b31603fffb 100644 --- a/options/locale/locale_ja-JP.ini +++ b/options/locale/locale_ja-JP.ini @@ -1062,6 +1062,8 @@ pulls.no_merge_desc=リポジトリのマージオプションがすべて無効 pulls.no_merge_helper=リポジトリ設定でマージを有効にするか、手動でマージしてください。 pulls.no_merge_wip=このプルリクエストはWork in Progressとマークされているため、マージすることはできません。 pulls.no_merge_status_check=すべての必要なステータスチェックが成功していないため、このプルリクエストはマージできません。 +pulls.no_merge_not_ready=このプルリクエストはマージする準備ができていません。 レビュー状況とステータスチェックを確認してください。 +pulls.no_merge_access=このプルリクエストをマージする権限がありません。 pulls.merge_pull_request=プルリクエストをマージ pulls.rebase_merge_pull_request=リベースしてマージ pulls.rebase_merge_commit_pull_request=リベースしてマージ(--no-ff) @@ -1412,6 +1414,8 @@ settings.protect_approvals_whitelist_enabled=ホワイトリストに登録し settings.protect_approvals_whitelist_enabled_desc=ホワイトリストに登録したユーザーやチームによるレビューのみを、必要な承認とみなします。 承認のホワイトリストが無い場合は、書き込み権限がある人によるレビューを必要な承認とみなします。 settings.protect_approvals_whitelist_users=ホワイトリストに含めるレビューア: settings.protect_approvals_whitelist_teams=ホワイトリストに含めるレビューチーム: +settings.dismiss_stale_approvals=古くなった承認を取り消す +settings.dismiss_stale_approvals_desc=プルリクエストの内容を変える新たなコミットがブランチにプッシュされた場合、以前の承認を取り消します。 settings.add_protected_branch=保護を有効にする settings.delete_protected_branch=保護を無効にする settings.update_protect_branch_success=ブランチ '%s' の保護を更新しました。 @@ -1747,6 +1751,7 @@ users.new_account=ユーザーアカウントを作成 users.name=ユーザー名 users.activated=アクティベート済み users.admin=管理者 +users.restricted=制限あり users.repos=リポジトリ users.created=作成日 users.last_login=前回のサインイン @@ -1765,6 +1770,7 @@ users.max_repo_creation_desc=( -1を設定するとデフォルトの制限が users.is_activated=ユーザーアカウントはアクティベート済み users.prohibit_login=サインイン無効 users.is_admin=管理者 +users.is_restricted=制限あり users.allow_git_hook=Gitフックを作成可 users.allow_import_local=ローカルリポジトリをインポート可 users.allow_create_organization=組織を作成可 @@ -2025,8 +2031,54 @@ monitor.execute_time=実行時間 monitor.process.cancel=処理をキャンセル monitor.process.cancel_desc=処理をキャンセルするとデータが失われる可能性があります monitor.process.cancel_notices=キャンセル: %s? +monitor.queues=キュー +monitor.queue=キュー: %s +monitor.queue.name=キュー名 +monitor.queue.type=種類 +monitor.queue.exemplar=要素の型 +monitor.queue.numberworkers=ワーカー数 +monitor.queue.maxnumberworkers=ワーカー数上限 +monitor.queue.review=設定確認 +monitor.queue.review_add=確認/ワーカー追加 +monitor.queue.configuration=初期設定 +monitor.queue.nopool.title=ワーカープールはありません +monitor.queue.nopool.desc=このキューは他のキューをラップし、これ自体にはワーカープールがありません。 +monitor.queue.wrapped.desc=wrappedキューは、すぐに開始されないキューをラップし、入ってきたリクエストをチャンネルにバッファリングします。 これ自体にはワーカープールがありません。 +monitor.queue.persistable-channel.desc=persistable-channelキューは二つのキューをラップします。 一つはchannelキューで、自分のワーカープールを持ちます。もう一つはlevelキューで、前回のシャットダウンからリクエストを引き継ぐためのものです。 これ自体にはワーカープールがありません。 +monitor.queue.pool.timeout=タイムアウト +monitor.queue.pool.addworkers.title=ワーカーの追加 +monitor.queue.pool.addworkers.submit=ワーカーを追加 +monitor.queue.pool.addworkers.desc=このプールに、タイムアウト付きまたはタイムアウト無しでワーカーを追加します。 タイムアウトを指定した場合は、タイムアウト後にそれらのワーカーがこのプールから取り除かれます。 +monitor.queue.pool.addworkers.numberworkers.placeholder=ワーカー数 +monitor.queue.pool.addworkers.timeout.placeholder=0でタイムアウト無し +monitor.queue.pool.addworkers.mustnumbergreaterzero=追加するワーカー数は1以上にしてください +monitor.queue.pool.addworkers.musttimeoutduration=タイムアウトは 、Go言語の時間差表記(例 5m)、または0にしてください +monitor.queue.settings.title=プール設定 +monitor.queue.settings.desc=ワーカーへのキューのブロックが発生すると、それに応じてプール数がブースト分ずつ動的に増えます。 これらの変更は現在のワーカーグループには影響しません。 +monitor.queue.settings.timeout=ブースト分のタイムアウト +monitor.queue.settings.timeout.placeholder=現在の設定 %[1]v +monitor.queue.settings.timeout.error=タイムアウトは 、Go言語の時間差表記(例 5m)、または0にしてください +monitor.queue.settings.numberworkers=ブースト分のワーカー数 +monitor.queue.settings.numberworkers.placeholder=現在の設定 %[1]d +monitor.queue.settings.numberworkers.error=追加するワーカー数はゼロ以上にしてください +monitor.queue.settings.maxnumberworkers=ワーカー数上限 +monitor.queue.settings.maxnumberworkers.placeholder=現在の設定 %[1]d +monitor.queue.settings.maxnumberworkers.error=ワーカー数上限は数値にしてください +monitor.queue.settings.submit=設定を更新 +monitor.queue.settings.changed=設定を更新しました +monitor.queue.settings.blocktimeout=現在のブロックタイムアウト +monitor.queue.settings.blocktimeout.value=%[1]v +monitor.queue.pool.none=このキューにはプールがありません +monitor.queue.pool.added=ワーカーグループを追加しました +monitor.queue.pool.max_changed=ワーカー数の上限を変更しました +monitor.queue.pool.workers.title=アクティブなワーカーグループ +monitor.queue.pool.workers.none=ワーカーグループはありません。 +monitor.queue.pool.cancel=ワーカーグループのシャットダウン +monitor.queue.pool.cancelling=ワーカーグループをシャットダウンしています +monitor.queue.pool.cancel_notices=このワーカー数 %s のグループをシャットダウンしますか? +monitor.queue.pool.cancel_desc=キューをワーカーグループ無しのままにすると、リクエストがブロックし続ける原因となります。 notices.system_notice_list=システム通知 notices.view_detail_header=通知の詳細を表示 @@ -2120,4 +2172,3 @@ error.probable_bad_default_signature=警告! これはデフォルト鍵のIDで [units] error.no_unit_allowed_repo=このリポジトリのどのセクションにもアクセスが許可されていません。 error.unit_not_allowed=このセクションへのアクセスが許可されていません。 - diff --git a/options/locale/locale_lv-LV.ini b/options/locale/locale_lv-LV.ini index d05e672d09..7302b9b7ee 100644 --- a/options/locale/locale_lv-LV.ini +++ b/options/locale/locale_lv-LV.ini @@ -1596,7 +1596,7 @@ settings.full_name=Pilns vārds, uzvārds settings.website=Mājas lapa settings.location=Atrašanās vieta settings.permission=Tiesības -settings.repoadminchangeteam=Repozitorija administrators var pievienot vain noņemt piekļuvi komandām +settings.repoadminchangeteam=Repozitorija administrators var pievienot vai noņemt piekļuvi komandām settings.visibility=Redzamība settings.visibility.public=Publiska settings.visibility.limited=Ierobežota (redzama tikai autorizētiem lietotājiem) @@ -2025,8 +2025,54 @@ monitor.execute_time=Izpildes laiks monitor.process.cancel=Atcelt procesu monitor.process.cancel_desc=Procesa atcelšana var radīt datu zaudējumus monitor.process.cancel_notices=Atcelt: %s? +monitor.queues=Rindas +monitor.queue=Rinda: %s +monitor.queue.name=Nosaukums +monitor.queue.type=Veids +monitor.queue.exemplar=Eksemplāra veids +monitor.queue.numberworkers=Strādņu skaits +monitor.queue.maxnumberworkers=Maksimālais strādņu skaits +monitor.queue.review=Pārbaudīt konfigurāciju +monitor.queue.review_add=Pārbaudīt/Pievienot strādņus +monitor.queue.configuration=Sākotnējā konfigurācija +monitor.queue.nopool.title=Nav strādņu pūla +monitor.queue.nopool.desc=Šī rinda apvieno citas rindas un tai nav strādņu pūla. +monitor.queue.wrapped.desc=Apvienojošā rinda apvieno lēni startējošās rindas, uzkrājot sarindotos pieprasījumus kanālā. Tai nav strādņu pūla. +monitor.queue.persistable-channel.desc=Patstāvīgas kanāli apvieno divas rindas, kanāla rindu, kurai ir savs strādņu pūls un līmeņu rindu patstāvīgajiem pieprasījumiem no iepriekšejām izslēgšanām. Tai nav strādņu pūla. +monitor.queue.pool.timeout=Noildze +monitor.queue.pool.addworkers.title=Pievienot strādņus +monitor.queue.pool.addworkers.submit=Pievienot +monitor.queue.pool.addworkers.desc=Pievienot strādņus šim pūlam ar vai bez noildzes. Ja uzstādīsies noildzi, tad šie strādņi tiks noņemti no pūla, kad noildze būs iestājusies. +monitor.queue.pool.addworkers.numberworkers.placeholder=Strādņu skaits +monitor.queue.pool.addworkers.timeout.placeholder=Norādiet 0, lai nebūtu noildzes +monitor.queue.pool.addworkers.mustnumbergreaterzero=Strādņu skaitam, ko pievienot, ir jābūt lielākam par nulli +monitor.queue.pool.addworkers.musttimeoutduration=Noildzei ir jābūt norādītai kā ilgumam, piemēram, 5m vai 0 +monitor.queue.settings.title=Pūla iestatījumi +monitor.queue.settings.desc=Pūli var dinamiski augt un paildzinātu atbildi uz strādņu rindas bloķēšanu. Šis izmaiņas ietekmēs pašreizējās strādņu grupas. +monitor.queue.settings.timeout=Pagarināt noildzi +monitor.queue.settings.timeout.placeholder=Pašalaik %[1]v +monitor.queue.settings.timeout.error=Noildzei ir jābūt norādītai kā ilgumam, piemēram, 5m vai 0 +monitor.queue.settings.numberworkers=Palielināt strādņu skaitu +monitor.queue.settings.numberworkers.placeholder=Pašalaik %[1]d +monitor.queue.settings.numberworkers.error=Strādņu skaitam ir jābūt lielākam vai vienādam ar nulli +monitor.queue.settings.maxnumberworkers=Maksimālais strādņu skaits +monitor.queue.settings.maxnumberworkers.placeholder=Pašalaik %[1]d +monitor.queue.settings.maxnumberworkers.error=Maksimālajam strādņu skaitam ir jābūt skaitlim +monitor.queue.settings.submit=Saglabāt iestatījumus +monitor.queue.settings.changed=Iestatījumi saglabāti +monitor.queue.settings.blocktimeout=Pašreizējās grupas noildze +monitor.queue.settings.blocktimeout.value=%[1]v +monitor.queue.pool.none=Rindai nav pūla +monitor.queue.pool.added=Strādņu grupa pievienota +monitor.queue.pool.max_changed=Maksimālais strādņu skaits mainīts +monitor.queue.pool.workers.title=Aktīvās strādņu grupas +monitor.queue.pool.workers.none=Nav strādņu grupu. +monitor.queue.pool.cancel=Izslēgt strādņu grupu +monitor.queue.pool.cancelling=Strādņu grupa tiek izslēgta +monitor.queue.pool.cancel_notices=Izslēgt šo grupu ar %s strādņiem? +monitor.queue.pool.cancel_desc=Atstājot rindu bez nevienas strādņu grupas, var radīt pieprasījumu bloķēšanos. notices.system_notice_list=Sistēmas paziņojumi notices.view_detail_header=Skatīt paziņojuma detaļas @@ -2120,4 +2166,3 @@ error.probable_bad_default_signature=BRĪDINĀJUMS! Lai arī šai atslēgai ir n [units] error.no_unit_allowed_repo=Jums nav tiesību aplūkot nevienu šī repozitorija sadaļu. error.unit_not_allowed=Jums nav tiesību piekļūt šai repozitorija sadaļai. - diff --git a/options/locale/locale_pl-PL.ini b/options/locale/locale_pl-PL.ini index 754013212a..1f9d8eb2b5 100644 --- a/options/locale/locale_pl-PL.ini +++ b/options/locale/locale_pl-PL.ini @@ -2100,4 +2100,3 @@ error.probable_bad_default_signature=OSTRZEŻENIE! Pomimo, że domyślny klucz p [units] error.no_unit_allowed_repo=Nie masz uprawnień do żadnej sekcji tego repozytorium. error.unit_not_allowed=Nie masz uprawnień do tej sekcji repozytorium. - diff --git a/options/locale/locale_pt-BR.ini b/options/locale/locale_pt-BR.ini index 3367b45879..a5b70e418e 100644 --- a/options/locale/locale_pt-BR.ini +++ b/options/locale/locale_pt-BR.ini @@ -1062,6 +1062,8 @@ pulls.no_merge_desc=O merge deste pull request não pode ser aplicado porque tod pulls.no_merge_helper=Habilite as opções de merge nas configurações do repositório ou faça o merge do pull request manualmente. pulls.no_merge_wip=O merge deste pull request não pode ser aplicado porque está marcado como um trabalho em andamento. pulls.no_merge_status_check=Este pull request não pode ter seu merge aplicado porque nem todas as verificações de status necessárias foram bem sucedidas. +pulls.no_merge_not_ready=Este pull request não está pronto para ser realizado o merge, verifique o status da revisão e as verificações de status. +pulls.no_merge_access=Você não está autorizado para realizar o merge deste pull request. pulls.merge_pull_request=Aplicar merge do pull request pulls.rebase_merge_pull_request=Aplicar Rebase e Merge pulls.rebase_merge_commit_pull_request=Aplicar Rebase e Merge (--no-ff) @@ -1412,6 +1414,8 @@ settings.protect_approvals_whitelist_enabled=Restringir aprovações a usuários settings.protect_approvals_whitelist_enabled_desc=Somente as avaliações de usuários ou equipes da lista permitida serão contadas com as aprovações necessárias. Sem aprovação da lista permitida, as revisões de qualquer pessoa com acesso de escrita contam para as aprovações necessárias. settings.protect_approvals_whitelist_users=Usuários com permissão de revisão: settings.protect_approvals_whitelist_teams=Equipes com permissão de revisão: +settings.dismiss_stale_approvals=Descartar aprovações obsoletas +settings.dismiss_stale_approvals_desc=Quando novos commits que mudam o conteúdo do pull request são enviados para o branch, as antigas aprovações serão descartadas. settings.add_protected_branch=Habilitar proteção settings.delete_protected_branch=Desabilitar proteção settings.update_protect_branch_success=Proteção do branch '%s' foi atualizada. @@ -1747,6 +1751,7 @@ users.new_account=Criar conta de usuário users.name=Nome de usuário users.activated=Ativado users.admin=Administrador +users.restricted=Restrito users.repos=Repositórios users.created=Criado users.last_login=Último acesso @@ -1765,6 +1770,7 @@ users.max_repo_creation_desc=(Use -1 para usar o limite padrão global.) users.is_activated=Conta de usuário está ativada users.prohibit_login=Desabilitar acesso users.is_admin=É administrador +users.is_restricted=Está restrito users.allow_git_hook=Pode criar hooks Git users.allow_import_local=Pode importar repositórios locais users.allow_create_organization=Pode criar organizações @@ -2166,4 +2172,3 @@ error.probable_bad_default_signature=AVISO! Embora a chave padrão tenha este ID [units] error.no_unit_allowed_repo=Você não tem permissão para acessar nenhuma seção deste repositório. error.unit_not_allowed=Você não tem permissão para acessar esta seção do repositório. - diff --git a/options/locale/locale_tr-TR.ini b/options/locale/locale_tr-TR.ini index 5940524c71..2fc76603ef 100644 --- a/options/locale/locale_tr-TR.ini +++ b/options/locale/locale_tr-TR.ini @@ -2113,4 +2113,3 @@ error.probable_bad_default_signature=UYARI! Varsayılan anahtarın bu kimliği o [units] error.no_unit_allowed_repo=Bu deponun hiçbir bölümüne erişme izniniz yok. error.unit_not_allowed=Bu depo bölümüne erişme izniniz yok. - diff --git a/options/locale/locale_uk-UA.ini b/options/locale/locale_uk-UA.ini index e140af1e49..5722528b23 100644 --- a/options/locale/locale_uk-UA.ini +++ b/options/locale/locale_uk-UA.ini @@ -2115,4 +2115,3 @@ error.probable_bad_default_signature=УВАГА! Хоча типовий клю [units] error.no_unit_allowed_repo=У вас немає доступу до жодного розділу цього репозитория. error.unit_not_allowed=У вас немає доступу до жодного розділу цього репозитория. - diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 00c8078754..4e1474f907 100644 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -2166,4 +2166,3 @@ error.probable_bad_default_signature=警告!虽然默认密钥拥有此ID, [units] error.no_unit_allowed_repo=您没有被允许访问此仓库的任何单元。 error.unit_not_allowed=您没有权限访问此仓库单元 - From 42663a687c387cb821cfbdd07c2d9efc110c84b8 Mon Sep 17 00:00:00 2001 From: David Svantesson Date: Wed, 15 Jan 2020 14:18:18 +0100 Subject: [PATCH 023/200] Fix add team on collaborator page when same name as organization (#9778) --- routers/repo/setting.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/repo/setting.go b/routers/repo/setting.go index e5c2a9dbc6..b2330f4ebc 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -581,7 +581,7 @@ func AddTeamPost(ctx *context.Context) { } name := utils.RemoveUsernameParameterSuffix(strings.ToLower(ctx.Query("team"))) - if len(name) == 0 || ctx.Repo.Owner.LowerName == name { + if len(name) == 0 { ctx.Redirect(ctx.Repo.RepoLink + "/settings/collaboration") return } From 6d1f7e90cf9921e0d944cd353a441c985f1b6f11 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 15 Jan 2020 17:28:44 +0100 Subject: [PATCH 024/200] Fix (#9761) Korean locales (#9780) * backport korean 20-20-01-15 | fix #9761 * update state 14:43:10 UTC --- options/locale/locale_ko-KR.ini | 106 ++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 47 deletions(-) diff --git a/options/locale/locale_ko-KR.ini b/options/locale/locale_ko-KR.ini index 55951c19d1..15218d145b 100644 --- a/options/locale/locale_ko-KR.ini +++ b/options/locale/locale_ko-KR.ini @@ -3,9 +3,9 @@ dashboard=대시보드 explore=탐색 help=도움말 sign_in=로그인 -sign_in_with=냐후 ㅑㅜ 쨔소 +sign_in_with=다음을 통해 로그인 sign_out=로그아웃 -sign_up=ㄲㄷ햔ㅅㄷㄱ +sign_up=가입하기 link_account=계정 연결 register=가입하기 website=웹 사이트 @@ -14,18 +14,18 @@ page=페이지 template=템플릿 language=언어 notifications=알림 -create_new=ㅊㄱㄷㅁㅅㄷ... -user_profile_and_more=ㅖ개랴ㅣㄷ 뭉 ㄴㄷㅅ샤ㅜㅎㄴ... +create_new=생성하기 +user_profile_and_more=프로파일 및 설정 signed_in_as=다음 사용자로 로그인됨 -enable_javascript=쏘ㅑㄴ ㅈ듀냣ㄷ 재간 ㅠㄷㅅㅅㄷㄱ 쟈소 ㅓㅁㅍㅁㄴㅊ갸ㅔㅅ. +enable_javascript=이 웹사이트는 자바스크립트 활성화가 필요합니다. username=사용자명 -email=뜨먀ㅣ ㅁㅇㅇㄱㄷㄴㄴ +email=이메일 주소 password=비밀번호 -re_type=ㄲㄷ-쑈ㅔㄷ ㅖㅁㄴㄴ잭ㅇ -captcha=ㅊ몠촘 -twofa=ㅆ재-ㄻㅊ색 며소두샻ㅁ샤ㅐㅜ -twofa_scratch=ㅆ재-ㄻㅊ색 ㄴㅊㄱㅁㅅ초 챙ㄷ +re_type=비밀번호 재입력 +captcha=보안 문자 +twofa=2단계 인증 +twofa_scratch=2단계 일회성 코드 passcode=인증코드 u2f_insert_key=보안 키를 입력해주세요. @@ -50,12 +50,12 @@ new_mirror=새로운 미러 new_fork=새 저장소 포크 new_org=새로운 조직 manage_org=조직 관리 -admin_panel=냣ㄷ ㅁ으ㅑㅜㅑㄴㅅㄱㅁ샤ㅐㅜ +admin_panel=사이트 관리 account_settings=계정 설정 settings=설정 -your_profile=ㅖ개랴ㅣㄷ -your_starred=ㄴㅅㅁㄱㄱㄷㅇ -your_settings=ㄴㄷㅅ샤ㅜㅎㄴ +your_profile=프로필 +your_starred=즐겨찾기 +your_settings=설정 all=전체 sources=소스 @@ -66,71 +66,75 @@ forks=포크 activities=활동 pull_requests=풀 리퀘스트 issues=이슈들 +milestones=마일스톤 cancel=취소 +add=추가 write=쓰기 preview=미리보기 loading=불러오는 중... [startpage] +app_desc=편리한 설치형 Git 서비스 +license=오픈 소스 [install] install=설치 -title=ㅑㅜㅑ샤미 채ㅜ랴혁ㅁ샤ㅐㅜ +title=초기 설정 docker_helper=Gitea를 Docker에서 실행하려면 설정 전에 이 문서를 읽어보세요. requite_db_desc=Gitea를 실행하려면 MySQL, PostgreSQL, MSSQL 또는 SQLite3 중 하나가 필요합니다. db_title=데이터베이스 설정 db_type=데이터베이스 유형 host=호스트 -user=ㅕㄴㄷ구믇 +user=이름 password=비밀번호 db_name=데이터베이스 이름 -ssl_mode=ㄴ니 +ssl_mode=SSL charset=문자셋 path=경로 sqlite_helper=SQLite3 데이터베이스에 대한 파일 경로입니다.
    Gitea를 서비스로 구동할 경우, 절대 경로를 입력해주십시오. err_empty_db_path=SQLite3 데이터베이스 경로는 필수 입력 값입니다. -no_admin_and_disable_registration=ㅛㅐㅕ ㅊ무ㅜㅐㅅ 얀뮤ㅣㄷ ㅕㄴㄷㄱ ㄴ딜-ㄱㄷ햔ㅅㄱㅁ샤ㅐㅜ 쟈쇄ㅕㅅ ㅊㄱㄷㅁ샤ㅜㅎ 무 ㅁ으ㅑㅜㅑㄴㅅㄱㅁ색 ㅁㅊ채ㅕㅜㅅ. -err_empty_admin_password=쏟 ㅁ으ㅑㅜㅑㄴㅅㄱㅁ색 ㅔㅁㄴㄴ잭ㅇ ㅊ무ㅜㅐㅅ ㅠㄷ 드ㅔ쇼. +no_admin_and_disable_registration=관리자 계정을 만들지 않고 등록을 비활성화할 수 없습니다. +err_empty_admin_password=관리자 비밀번호는 비어 있을 수 없습니다. err_empty_admin_email=관리자 이메일은 비어 있을 수 없습니다. err_admin_name_is_reserved=관리자 사용자 이름이 올바르지 않습니다, 제한된 사용자 이름입니다 err_admin_name_is_invalid=관리자 사용자 이름이 올바르지 않습니다 -general_title=ㅎ둗ㄱ미 ㄴㄷㅅ샤ㅜㅎㄴ -app_name=냣ㄷ 쌰싣 -app_name_helper=ㅛㅐㅕ ㅊ무 둣ㄷㄱ ㅛㅐㅕㄱ 채ㅡㅔ무ㅛ ㅜ믇 ㅗㄷㄱㄷ. +general_title=기본설정 +app_name=사이트 제목 +app_name_helper=회사이름을 넣으세요. repo_path=저장소 최상위 경로 -repo_path_helper=ㄲ드ㅐㅅㄷ 햣 ㄱ데ㅐ냐새갿ㄴ 쟈ㅣㅣ ㅠㄷ ㄴㅁㅍㄷㅇ 새 소ㅑㄴ 약ㄷㅊ새교. -lfs_path=햣 ㅣㄹㄴ 깨ㅐㅅ ㅖㅁ소 -lfs_path_helper=랴ㅣㄷㄴ ㅅㄱㅁ찯ㅇ ㅠㅛ 햣 ㅣㄹㄴ 쟈ㅣㅣ ㅠㄷ ㄴ색ㄷㅇ ㅑㅜ 소ㅑㄴ 약ㄷㅊ새교. ㅣㄷㅁㅍㄷ 드ㅔ쇼 새 얀뮤ㅣㄷ. -run_user=껴ㅜ ㅁㄴ ㅕㄴㄷ구믇 -run_user_helper=뚯ㄷㄱ 솓 ㅐㅔㄷㄱㅁ샤ㅜㅎ 뇬ㅅ드 ㅕㄴㄷ구믇 솜ㅅ 햣ㄷㅁ 겨ㅜㄴ ㅁㄴ. ㅜㅐㅅㄷ 솜ㅅ 소ㅑㄴ ㅕㄴㄷㄱ ㅡㅕㄴㅅ ㅗㅁㅍㄷ ㅁㅊㅊㄷㄴㄴ 새 솓 ㄱ데ㅐ냐새교 개ㅐㅅ ㅔㅁ소. -domain=ㄴ노 ㄴㄷㄱㅍㄷㄱ 애ㅡ먀ㅜ -domain_helper=애ㅡ먀ㅜ ㅐㄱ ㅙㄴㅅ ㅁㅇㅇㄱㄷㄴㄴ 랙 노ㅗ 치ㅐㅜㄷ ㅕ낀. +repo_path_helper=Git 원격 저장소는 이 디렉터리에 저장 됩니다. +lfs_path=Git LFS 루트 경로 +lfs_path_helper=Git LFS에 저장된 파일들은 이 디렉토리에 저장됩니다. LFS를 사용하지 않는다면 빈칸으로 남겨주세요. +run_user=실행 사용자명 +run_user_helper=Gitea 를 실행할 시스템 사용자명을 넣으세요. 시스템 사용자는 레포지토리 루트 경로에 대한 권한이 필요합니다. +domain=SSH 서버 도메인 +domain_helper=SSH clone URL 에 대한 도메인 또는 호스트 주소 ssh_port=ㄴ노 ㄴㄷㄱㅍㄷㄱ ㅖㅐㄳ -ssh_port_helper=ㅖㅐㄳ ㅜㅕㅡㅠㄷㄱ ㅛㅐㅕㄱ 노ㅗ ㄴㄷㄱㅍㄷㄱ ㅣㅑㄴㅅ둔 ㅐㅜ. ㅣㄷㅁㅍㄷ 드ㅔ쇼 새 얀뮤ㅣㄷ. -http_port=햣ㄷㅁ ㅗㅆ쎄 ㅣㅑㄴㅅ두 ㅖㅐㄳ -http_port_helper=ㅖㅐㄳ ㅜㅕㅡㅠㄷㄱ 솓 햣ㄷㅁㄴ ㅈ듀 ㄴㄷㄱㅍㄷㄱ 쟈ㅣㅣ ㅣㅑㄴㅅ두 ㅐㅜ. -app_url=햣ㄷㅁ ㅠㅁㄴㄷ ㅕ끼 -app_url_helper=ㅠㅁㄴㄷ ㅁㅇㅇㄱㄷㄴㄴ 랙 ㅗㅆ쎼(ㄴ) 치ㅐㅜㄷ ㅕ낀 뭉 드먀ㅣ ㅜㅐ샤럋ㅁ샤ㅐㅜㄴ. +ssh_port_helper=SSH 서버가 실행되고 있는 포트를 입력하세요. 비워둘 경우 SSH를 사용하지 않습니다. +http_port=Gitea HTTP 수신 포트 +http_port_helper=Gitea 웹서버가 수신할 포트 번호 +app_url=Gitea 기본 URL +app_url_helper=HTTP(S) clone URL 및 이메일 알림 기본 주소 log_root_path=로그 경로 -log_root_path_helper=ㅣㅐㅎ 랴ㅣㄷㄴ 쟈ㅣㅣ ㅠㄷ ㅈ걋ㅅ두 새 소ㅑㄴ 약ㄷㅊ새교. +log_root_path_helper=로그파일은 이 디렉토리에 저장됩니다. optional_title=추가설정 -email_title=뜨먀ㅣ ㄴㄷㅅ샤ㅜㅎㄴ +email_title=이메일 설정 smtp_host=SMTP 호스트 -smtp_from=ㄴ둥 뜨먀ㅣ ㅁㄴ -smtp_from_helper=뜨먀ㅣ ㅁㅇㅇㄱㄷㄴㄴ 햣ㄷㅁ 쟈ㅣㅣ ㅕㄴㄷ. 뚯ㄷㄱ ㅁ ㅔㅣ먀ㅜ 드먀ㅣ ㅁㅇㅇㄱㄷㄴㄴ ㅐㄱ ㅕㄴㄷ 솓 "ㅜ믇" <드먀ㅣ@ㄷㅌ므ㅔㅣㄷ.kr> 래금ㅅ. -mailer_user=느쎼 ㅕㄴㄷ구믇 -mailer_password=느쎼 ㅖㅁㄴㄴ잭ㅇ -register_confirm=ㄲㄷ벼ㅑㄱㄷ 뜨먀ㅣ 채ㅜ랴금샤ㅐㅜ 새 ㄲㄷ햔ㅅㄷㄱ -mail_notify=뚜뮤ㅣㄷ 뜨먀ㅣ ㅜㅐ샤럋ㅁ샤ㅐㅜㄴ -server_service_title=ㄴㄷㄱㅍㄷㄱ 뭉 쏘ㅑㄱㅇ-ㅖㅁㄱ쇼 ㄴㄷㄱ퍛ㄷ ㄴㄷㅅ샤ㅜㅎㄴ -offline_mode=뚜뮤ㅣㄷ ㅣㅐㅊ미 ㅡㅐㅇㄷ -offline_mode_popup=얀뮤ㅣㄷ 소ㅑㄱㅇ-ㅔㅁㄱ쇼 채ㅜㅅ둣 ㅇ디ㅑㅍㄷ교 ㅜㄷㅅ재간 뭉 ㄴㄷㄱㅍㄷ 미ㅣ ㄱㄷ내ㅕㄱㅊㄷㄴ ㅣㅐㅊ미ㅣㅛ. -disable_gravatar=얀뮤ㅣㄷ ㅎㄱㅁㅍㅍㅁㅅㅁㄱ -disable_gravatar_popup=얀뮤ㅣㄷ ㅎㄱㅁㅍㅁㅅㅁㄱ 뭉 소ㅑㄱㅇ-ㅔㅁㄱ쇼 ㅁㅍㅁㄴㅅㅁㄱ 내ㅕㄱㅊㄷㄴ. ㅁ ㅇㄷㄹ며ㅣㅅ ㅁㅍㅁㅅㅁㄱ 쟈ㅣㅣ ㅠㄷ ㅕㄴㄷㅇ ㅕㅟㄷㄴㄴ ㅁ ㅕㄴㄷㄱ ㅣㅐㅊ미ㅣㅛ ㅕㅔㅣㅐㅁㅇㄴ 무 ㅁㅍㅁㅅㅁㄱ. +smtp_from=이메일 발신인 +smtp_from_helper=Gitea 가 사용할 이메일 주소. 이메일 주소 또는 "이름" 형식으로 입력하세요. +mailer_user=SMTP 사용자이름 +mailer_password=SMTP 비밀번호 +register_confirm=가입시 이메일 확인 필수 +mail_notify=이메일 알림 켜기 +server_service_title=서버 및 기타 서비스 설정 +offline_mode=로컬 모드 켜기 +offline_mode_popup=타사 콘텐츠 전송 네트워크를 사용하지 않도록 설정하고 모든 리소스를 로컬로 제공하십시오. +disable_gravatar=Gravatar 사용안함 +disable_gravatar_popup=Gravatar 및 타사 아바타 소스를 사용하지 않도록 설정합니다. 사용자가 로컬로 아바타를 업로드하지 않는 한 기본 아바타가 사용됩니다. federated_avatar_lookup=아바타 연동 사용여부 federated_avatar_lookup_popup=libravatar 기반 오픈소스 서비스 사용 목적으로 연합 아바타 조회를 허용하기 disable_registration=사용자 등록 비활성화 @@ -509,6 +513,8 @@ confirm_delete_account=삭제 승인 delete_account_title=사용자 계정 삭제 delete_account_desc=이 계정을 정말로 삭제하시겠습니까? +email_notifications.enable=이메일 알림 켜기 +email_notifications.disable=이메일 알림 끄기 [repo] owner=소유자 @@ -879,6 +885,7 @@ milestones.filter_sort.most_complete=완료율이 높은 순 milestones.filter_sort.most_issues=이슈 많은 순 milestones.filter_sort.least_issues=이슈 적은 순 + ext_wiki=외부 위키 ext_wiki.desc=외부 위키에 연결하기. @@ -960,6 +967,8 @@ settings.basic_settings=기본 설정 settings.mirror_settings=미러 설정 settings.sync_mirror=지금 동기화 settings.mirror_sync_in_progress=미러 동기화 진행중입니다. 잠시 후 다시 확인해주십시오. +settings.email_notifications.enable=이메일 알림 켜기 +settings.email_notifications.disable=이메일 알림 끄기 settings.site=웹 사이트 settings.update_settings=설정 저장 settings.advanced_settings=고급 설정 @@ -1080,6 +1089,8 @@ settings.protected_branch_can_push_yes=푸시할 수 있습니다. settings.protected_branch_can_push_no=푸시할 수 없습니다. settings.branch_protection='%s' 브랜치 보호 settings.protect_this_branch=브랜치 보호 활성화 +settings.protect_disable_push=푸시 끄기 +settings.protect_enable_push=푸시 켜기 settings.protect_whitelist_search_users=사용자 찾기... settings.protect_whitelist_search_teams=팀 찾기... settings.protect_merge_whitelist_committers=머지 화이트리스트 활성화 @@ -1511,6 +1522,7 @@ monitor.process=실행중인 프로세스들 monitor.desc=설명 monitor.start=시작 시간 monitor.execute_time=실행 시간 +monitor.queue.configuration=초기 설정 From dbe6136348a1dd8085f0c04cfb6079f00cb00efe Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 16 Jan 2020 00:09:31 +0000 Subject: [PATCH 025/200] Fix missing unlock in uniquequeue (#9791) --- modules/sync/unique_queue.go | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/sync/unique_queue.go b/modules/sync/unique_queue.go index 14644c7d4e..d41726b5af 100644 --- a/modules/sync/unique_queue.go +++ b/modules/sync/unique_queue.go @@ -82,6 +82,7 @@ func (q *UniqueQueue) AddFunc(id interface{}, fn func()) { idStr := com.ToStr(id) q.table.lock.Lock() if _, ok := q.table.pool[idStr]; ok { + q.table.lock.Unlock() return } q.table.pool[idStr] = struct{}{} From c8bb0ecf52f6da087cbcfc9afb01d62328241f7d Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 16 Jan 2020 11:09:47 +0800 Subject: [PATCH 026/200] Fix missing msteam webhook on organization (#9781) (#9794) --- routers/routes/routes.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 2f886f749d..58a2da82fc 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -455,7 +455,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Post("/discord/:id", bindIgnErr(auth.NewDiscordHookForm{}), repo.DiscordHooksEditPost) m.Post("/dingtalk/:id", bindIgnErr(auth.NewDingtalkHookForm{}), repo.DingtalkHooksEditPost) m.Post("/telegram/:id", bindIgnErr(auth.NewTelegramHookForm{}), repo.TelegramHooksEditPost) - m.Post("/msteams/:id", bindIgnErr(auth.NewMSTeamsHookForm{}), repo.MSTeamsHooksNewPost) + m.Post("/msteams/:id", bindIgnErr(auth.NewMSTeamsHookForm{}), repo.MSTeamsHooksEditPost) }) m.Group("/auths", func() { @@ -563,6 +563,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Post("/discord/new", bindIgnErr(auth.NewDiscordHookForm{}), repo.DiscordHooksNewPost) m.Post("/dingtalk/new", bindIgnErr(auth.NewDingtalkHookForm{}), repo.DingtalkHooksNewPost) m.Post("/telegram/new", bindIgnErr(auth.NewTelegramHookForm{}), repo.TelegramHooksNewPost) + m.Post("/msteams/new", bindIgnErr(auth.NewMSTeamsHookForm{}), repo.MSTeamsHooksNewPost) m.Get("/:id", repo.WebHooksEdit) m.Post("/gitea/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost) m.Post("/gogs/:id", bindIgnErr(auth.NewGogshookForm{}), repo.GogsHooksEditPost) @@ -570,6 +571,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Post("/discord/:id", bindIgnErr(auth.NewDiscordHookForm{}), repo.DiscordHooksEditPost) m.Post("/dingtalk/:id", bindIgnErr(auth.NewDingtalkHookForm{}), repo.DingtalkHooksEditPost) m.Post("/telegram/:id", bindIgnErr(auth.NewTelegramHookForm{}), repo.TelegramHooksEditPost) + m.Post("/msteams/:id", bindIgnErr(auth.NewMSTeamsHookForm{}), repo.MSTeamsHooksEditPost) }) m.Route("/delete", "GET,POST", org.SettingsDelete) From 3521177a34aea902156e963b20206d174e4daa0a Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Wed, 15 Jan 2020 23:40:37 -0600 Subject: [PATCH 027/200] Fix push-to-create (#9772) (#9797) * Fix push-to-create Signed-off-by: jolheiser * Check URL path and service Signed-off-by: jolheiser * Send dummy payload on receive-pack GET Signed-off-by: jolheiser * The space was actually a NUL byte Signed-off-by: jolheiser * Use real bare repo instead of manufactured payload Signed-off-by: jolheiser Co-authored-by: zeripath --- routers/repo/http.go | 59 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/routers/repo/http.go b/routers/repo/http.go index b97feed51d..d0a2b289b7 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -10,6 +10,7 @@ import ( "compress/gzip" gocontext "context" "fmt" + "io/ioutil" "net/http" "os" "os/exec" @@ -17,6 +18,7 @@ import ( "regexp" "strconv" "strings" + "sync" "time" "code.gitea.io/gitea/models" @@ -65,11 +67,12 @@ func HTTP(ctx *context.Context) { return } - var isPull bool + var isPull, receivePack bool service := ctx.Query("service") if service == "git-receive-pack" || strings.HasSuffix(ctx.Req.URL.Path, "git-receive-pack") { isPull = false + receivePack = true } else if service == "git-upload-pack" || strings.HasSuffix(ctx.Req.URL.Path, "git-upload-pack") { isPull = true @@ -282,6 +285,11 @@ func HTTP(ctx *context.Context) { } if !repoExist { + if !receivePack { + ctx.HandleText(http.StatusNotFound, "Repository not found") + return + } + if owner.IsOrganization() && !setting.Repository.EnablePushCreateOrg { ctx.HandleText(http.StatusForbidden, "Push to create is not enabled for organizations.") return @@ -290,6 +298,13 @@ func HTTP(ctx *context.Context) { ctx.HandleText(http.StatusForbidden, "Push to create is not enabled for users.") return } + + // Return dummy payload if GET receive-pack + if ctx.Req.Method == http.MethodGet { + dummyInfoRefs(ctx) + return + } + repo, err = repo_service.PushCreateRepo(authUser, owner, reponame) if err != nil { log.Error("pushCreateRepo: %v", err) @@ -352,6 +367,48 @@ func HTTP(ctx *context.Context) { ctx.NotFound("Smart Git HTTP", nil) } +var ( + infoRefsCache []byte + infoRefsOnce sync.Once +) + +func dummyInfoRefs(ctx *context.Context) { + infoRefsOnce.Do(func() { + tmpDir, err := ioutil.TempDir(os.TempDir(), "gitea-info-refs-cache") + if err != nil { + log.Error("Failed to create temp dir for git-receive-pack cache: %v", err) + return + } + + defer func() { + if err := os.RemoveAll(tmpDir); err != nil { + log.Error("RemoveAll: %v", err) + } + }() + + if err := git.InitRepository(tmpDir, true); err != nil { + log.Error("Failed to init bare repo for git-receive-pack cache: %v", err) + return + } + + refs, err := git.NewCommand("receive-pack", "--stateless-rpc", "--advertise-refs", ".").RunInDirBytes(tmpDir) + if err != nil { + log.Error(fmt.Sprintf("%v - %s", err, string(refs))) + } + + log.Debug("populating infoRefsCache: \n%s", string(refs)) + infoRefsCache = refs + }) + + ctx.Header().Set("Expires", "Fri, 01 Jan 1980 00:00:00 GMT") + ctx.Header().Set("Pragma", "no-cache") + ctx.Header().Set("Cache-Control", "no-cache, max-age=0, must-revalidate") + ctx.Header().Set("Content-Type", "application/x-git-receive-pack-advertisement") + _, _ = ctx.Write(packetWrite("# service=git-receive-pack\n")) + _, _ = ctx.Write([]byte("0000")) + _, _ = ctx.Write(infoRefsCache) +} + type serviceConfig struct { UploadPack bool ReceivePack bool From e2ddc4237720d671eb84848bc4b75e6608448b6f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 17 Jan 2020 10:08:28 +0800 Subject: [PATCH 028/200] Fix compare (#9808) (#9814) Co-authored-by: techknowlogick Co-authored-by: techknowlogick --- routers/repo/compare.go | 44 +++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/routers/repo/compare.go b/routers/repo/compare.go index d23bccd09a..9e76fe5b5e 100644 --- a/routers/repo/compare.go +++ b/routers/repo/compare.go @@ -157,12 +157,12 @@ func ParseCompareInfo(ctx *context.Context) (*models.User, *models.Repository, * ctx.ServerError("OpenRepository", err) return nil, nil, nil, nil, "", "" } + defer headGitRepo.Close() } // user should have permission to read baseRepo's codes and pulls, NOT headRepo's permBase, err := models.GetUserRepoPermission(baseRepo, ctx.User) if err != nil { - headGitRepo.Close() ctx.ServerError("GetUserRepoPermission", err) return nil, nil, nil, nil, "", "" } @@ -173,42 +173,40 @@ func ParseCompareInfo(ctx *context.Context) (*models.User, *models.Repository, * baseRepo, permBase) } - headGitRepo.Close() ctx.NotFound("ParseCompareInfo", nil) return nil, nil, nil, nil, "", "" } - // user should have permission to read headrepo's codes - permHead, err := models.GetUserRepoPermission(headRepo, ctx.User) - if err != nil { - headGitRepo.Close() - ctx.ServerError("GetUserRepoPermission", err) - return nil, nil, nil, nil, "", "" - } - if !permHead.CanRead(models.UnitTypeCode) { - if log.IsTrace() { - log.Trace("Permission Denied: User: %-v cannot read code in Repo: %-v\nUser in headRepo has Permissions: %-+v", - ctx.User, - headRepo, - permHead) + if !isSameRepo { + // user should have permission to read headrepo's codes + permHead, err := models.GetUserRepoPermission(headRepo, ctx.User) + if err != nil { + ctx.ServerError("GetUserRepoPermission", err) + return nil, nil, nil, nil, "", "" + } + if !permHead.CanRead(models.UnitTypeCode) { + if log.IsTrace() { + log.Trace("Permission Denied: User: %-v cannot read code in Repo: %-v\nUser in headRepo has Permissions: %-+v", + ctx.User, + headRepo, + permHead) + } + ctx.NotFound("ParseCompareInfo", nil) + return nil, nil, nil, nil, "", "" } - headGitRepo.Close() - ctx.NotFound("ParseCompareInfo", nil) - return nil, nil, nil, nil, "", "" } // Check if head branch is valid. - headIsCommit := ctx.Repo.GitRepo.IsCommitExist(headBranch) + headIsCommit := headGitRepo.IsCommitExist(headBranch) headIsBranch := headGitRepo.IsBranchExist(headBranch) headIsTag := headGitRepo.IsTagExist(headBranch) if !headIsCommit && !headIsBranch && !headIsTag { // Check if headBranch is short sha commit hash - if headCommit, _ := ctx.Repo.GitRepo.GetCommit(headBranch); headCommit != nil { + if headCommit, _ := headGitRepo.GetCommit(headBranch); headCommit != nil { headBranch = headCommit.ID.String() ctx.Data["HeadBranch"] = headBranch headIsCommit = true } else { - headGitRepo.Close() ctx.NotFound("IsRefExist", nil) return nil, nil, nil, nil, "", "" } @@ -229,14 +227,12 @@ func ParseCompareInfo(ctx *context.Context) (*models.User, *models.Repository, * baseRepo, permBase) } - headGitRepo.Close() ctx.NotFound("ParseCompareInfo", nil) return nil, nil, nil, nil, "", "" } - compareInfo, err := headGitRepo.GetCompareInfo(models.RepoPath(baseRepo.Owner.Name, baseRepo.Name), baseBranch, headBranch) + compareInfo, err := headGitRepo.GetCompareInfo(baseRepo.RepoPath(), baseBranch, headBranch) if err != nil { - headGitRepo.Close() ctx.ServerError("GetCompareInfo", err) return nil, nil, nil, nil, "", "" } From f7667198959f12f5627e22f8a46c35dfd1c9196c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 17 Jan 2020 13:02:41 +0800 Subject: [PATCH 029/200] fix dump non-exist log directory (#9818) (#9819) --- cmd/dump.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/dump.go b/cmd/dump.go index 6cbf04c468..d4461bea93 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -151,8 +151,10 @@ func runDump(ctx *cli.Context) error { } } - if err := z.AddDir("log", setting.LogRootPath); err != nil { - fatal("Failed to include log: %v", err) + if com.IsExist(setting.LogRootPath) { + if err := z.AddDir("log", setting.LogRootPath); err != nil { + fatal("Failed to include log: %v", err) + } } if err = z.Close(); err != nil { From 69a2a29c3335e0b9d76d789c95aeba266c089b65 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 17 Jan 2020 20:38:11 +0800 Subject: [PATCH 030/200] =?UTF-8?q?Fix=20wrong=20identify=20poster=20on=20?= =?UTF-8?q?a=20migrated=20pull=20request=20when=20submi=E2=80=A6=20(#9827)?= =?UTF-8?q?=20(#9830)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/issue.go | 2 +- routers/repo/pull_review.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/issue.go b/models/issue.go index 8218614edd..7c7a7c295a 100644 --- a/models/issue.go +++ b/models/issue.go @@ -438,7 +438,7 @@ func (issue *Issue) HashTag() string { // IsPoster returns true if given user by ID is the poster. func (issue *Issue) IsPoster(uid int64) bool { - return issue.PosterID == uid + return issue.OriginalAuthorID == 0 && issue.PosterID == uid } func (issue *Issue) hasLabel(e Engine, labelID int64) bool { diff --git a/routers/repo/pull_review.go b/routers/repo/pull_review.go index b596d2578b..9e03601c75 100644 --- a/routers/repo/pull_review.go +++ b/routers/repo/pull_review.go @@ -81,7 +81,7 @@ func SubmitReview(ctx *context.Context, form auth.SubmitReviewForm) { // can not approve/reject your own PR case models.ReviewTypeApprove, models.ReviewTypeReject: - if issue.Poster.ID == ctx.User.ID { + if issue.IsPoster(ctx.User.ID) { var translated string if reviewType == models.ReviewTypeApprove { translated = ctx.Tr("repo.issues.review.self.approval") From fe461854075fac19469fee0400bdd75ce6b8a1c4 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 17 Jan 2020 22:11:20 +0800 Subject: [PATCH 031/200] Fix download file wrong content-type (#9825) (#9834) * Fix download file wrong content-type * change the error text to be more precise * fix test Co-authored-by: Lauris BH --- routers/repo/download.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/routers/repo/download.go b/routers/repo/download.go index 6f10fe36a3..7ef0574b1d 100644 --- a/routers/repo/download.go +++ b/routers/repo/download.go @@ -12,6 +12,7 @@ import ( "strings" "code.gitea.io/gitea/modules/base" + "code.gitea.io/gitea/modules/charset" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/lfs" @@ -33,7 +34,12 @@ func ServeData(ctx *context.Context, name string, reader io.Reader) error { name = strings.Replace(name, ",", " ", -1) if base.IsTextFile(buf) || ctx.QueryBool("render") { - ctx.Resp.Header().Set("Content-Type", "text/plain; charset=utf-8") + cs, err := charset.DetectEncoding(buf) + if err != nil { + log.Error("Detect raw file %s charset failed: %v, using by default utf-8", name, err) + cs = "utf-8" + } + ctx.Resp.Header().Set("Content-Type", "text/plain; charset="+strings.ToLower(cs)) } else if base.IsImageFile(buf) || base.IsPDFFile(buf) { ctx.Resp.Header().Set("Content-Disposition", fmt.Sprintf(`inline; filename="%s"`, name)) } else { From b577500a54f76449887f9a10b65bf90c41a8a29e Mon Sep 17 00:00:00 2001 From: Moritz <13287984+mohe2015@users.noreply.github.com> Date: Fri, 17 Jan 2020 17:49:50 +0100 Subject: [PATCH 032/200] Fix markdown anchor links (#9673) (#9840) --- modules/markup/markdown/goldmark.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/markup/markdown/goldmark.go b/modules/markup/markdown/goldmark.go index 2a2a9dce6a..a1c8e1ded0 100644 --- a/modules/markup/markdown/goldmark.go +++ b/modules/markup/markdown/goldmark.go @@ -79,6 +79,9 @@ func (g *GiteaASTTransformer) Transform(node *ast.Document, reader text.Reader, } link = []byte(giteautil.URLJoin(pc.Get(urlPrefixKey).(string), lnk)) } + if len(link) > 0 && link[0] == '#' { + link = []byte("#user-content-" + string(link)[1:]) + } v.Destination = link } return ast.WalkContinue, nil From 6730df9e8c3f8ec726864426959cbdb950ac78b7 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 17 Jan 2020 23:02:30 +0100 Subject: [PATCH 033/200] Changelog 1.10.3 (#9832) (#9849) --- .changelog.yml | 24 ++++++++++++------------ CHANGELOG.md | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.changelog.yml b/.changelog.yml index 3bcb309046..3d61e8ef48 100644 --- a/.changelog.yml +++ b/.changelog.yml @@ -1,44 +1,44 @@ repo: go-gitea/gitea groups: - - + - name: BREAKING labels: - kind/breaking - - + - name: FEATURE labels: - kind/feature + - + name: SECURITY + labels: + - kind/security - name: BUGFIXES labels: - kind/bug - - + - name: ENHANCEMENT labels: - kind/enhancement - kind/refactor - kind/ui - - name: SECURITY - labels: - - kind/security - - name: TESTING labels: - kind/testing - - + - name: TRANSLATION labels: - kind/translation - - + - name: BUILD labels: - kind/build - kind/lint - - + - name: DOCS labels: - kind/docs - - + - name: MISC - default: true \ No newline at end of file + default: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 31fca8804f..2c01871c8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -384,6 +384,24 @@ been added to each release, please refer to the [blog](https://blog.gitea.io). * Update CodeMirror to version 5.49.0 (#8381) * Wiki editor: enable side-by-side button (#7242) +## [1.10.3](https://github.com/go-gitea/gitea/releases/tag/v1.10.3) - 2020-01-17 +* SECURITY + * Hide credentials when submitting migration (#9102) (#9704) + * Never allow an empty password to validate (#9682) (#9684) + * Prevent redirect to Host (#9678) (#9680) + * Hide public repos owned by private orgs (#9609) (#9616) +* BUGFIXES + * Allow assignee on Pull Creation when Issue Unit is deactivated (#9836) (#9838) + * Fix download file wrong content-type (#9825) (#9835) + * Fix wrong identify poster on a migrated pull request when submit review (#9827) (#9831) + * Fix dump non-exist log directory (#9818) (#9820) + * Fix compare (#9808) (#9815) + * Fix missing msteam webhook on organization (#9781) (#9795) + * Fix add team on collaborator page when same name as organization (#9783) + * Fix cache problem on dashboard (#9358) (#9703) + * Send tag create and push webhook when release created on UI (#8671) (#9702) + * Branches not at ref commit ID should not be listed as Merged (#9614) (#9639) + ## [1.10.2](https://github.com/go-gitea/gitea/releases/tag/v1.10.2) - 2020-01-02 * BUGFIXES * Allow only specific Columns to be updated on Issue via API (#9539) (#9580) From 95cb921097b8d1bb8fef0ef4ac402beb4a872f4a Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 18 Jan 2020 05:31:46 +0100 Subject: [PATCH 034/200] fix (#9837) --- routers/repo/compare.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/routers/repo/compare.go b/routers/repo/compare.go index 9e76fe5b5e..54bae464b2 100644 --- a/routers/repo/compare.go +++ b/routers/repo/compare.go @@ -381,7 +381,8 @@ func CompareDiff(ctx *context.Context) { } defer headGitRepo.Close() - if err := parseBaseRepoInfo(ctx, headRepo); err != nil { + var err error + if err = parseBaseRepoInfo(ctx, headRepo); err != nil { ctx.ServerError("parseBaseRepoInfo", err) return } @@ -423,6 +424,11 @@ func CompareDiff(ctx *context.Context) { beforeCommitID := ctx.Data["BeforeCommitID"].(string) afterCommitID := ctx.Data["AfterCommitID"].(string) + if ctx.Data["Assignees"], err = ctx.Repo.Repository.GetAssignees(); err != nil { + ctx.ServerError("GetAssignees", err) + return + } + ctx.Data["Title"] = "Comparing " + base.ShortSha(beforeCommitID) + "..." + base.ShortSha(afterCommitID) ctx.Data["IsRepoToolbarCommits"] = true From aa6ed1b7c138ec45362bcbebb72e58baeaf2a2be Mon Sep 17 00:00:00 2001 From: David Svantesson Date: Sat, 18 Jan 2020 15:28:33 +0100 Subject: [PATCH 035/200] Explicitly refer to PR in squash-merge commit message in case of external tracker (#9844) (#9855) * Explicitly refer to PR in squash-merge commit message in case of external tracker * documentation Co-authored-by: zeripath Co-authored-by: zeripath --- docs/content/doc/usage/linked-references.en-us.md | 3 ++- models/pull.go | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/content/doc/usage/linked-references.en-us.md b/docs/content/doc/usage/linked-references.en-us.md index a5f88363dd..d2836f8571 100644 --- a/docs/content/doc/usage/linked-references.en-us.md +++ b/docs/content/doc/usage/linked-references.en-us.md @@ -136,7 +136,8 @@ the `!` marker to identify pull requests. For example: > This is pull request [!1234](#), and links to a pull request in Gitea. The `!` and `#` can be used interchangeably for issues and pull request _except_ -for this case, where a distinction is required. +for this case, where a distinction is required. If the repository uses external +tracker, commit message for squash merge will use `!` as reference by default. ## Issues and Pull Requests References Summary diff --git a/models/pull.go b/models/pull.go index 94cb2a2a03..870a0960df 100644 --- a/models/pull.go +++ b/models/pull.go @@ -385,6 +385,13 @@ func (pr *PullRequest) GetDefaultSquashMessage() string { log.Error("LoadIssue: %v", err) return "" } + if err := pr.LoadBaseRepo(); err != nil { + log.Error("LoadBaseRepo: %v", err) + return "" + } + if pr.BaseRepo.UnitEnabled(UnitTypeExternalTracker) { + return fmt.Sprintf("%s (!%d)", pr.Issue.Title, pr.Issue.Index) + } return fmt.Sprintf("%s (#%d)", pr.Issue.Title, pr.Issue.Index) } From 8add1dfacc84ac0807cba1ec94022d52b818d1e9 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 20 Jan 2020 01:56:57 +0800 Subject: [PATCH 036/200] Fix issues/pulls dependencies problems (#9842) (#9864) * Fix issues/pulls dependencies problems * fix swagger and api param name * fix js --- modules/context/repo.go | 4 +-- routers/api/v1/repo/issue.go | 15 +++++++++ routers/repo/compare.go | 2 +- routers/repo/issue.go | 18 ++++++++--- routers/repo/issue_dependency.go | 32 +++++++++---------- .../repo/issue/view_content/sidebar.tmpl | 1 + templates/swagger/v1_json.tmpl | 6 ++++ web_src/js/index.js | 5 +-- 8 files changed, 57 insertions(+), 26 deletions(-) diff --git a/modules/context/repo.go b/modules/context/repo.go index 4c32e846eb..af2b3902ad 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -95,8 +95,8 @@ func (r *Repository) CanUseTimetracker(issue *models.Issue, user *models.User) b } // CanCreateIssueDependencies returns whether or not a user can create dependencies. -func (r *Repository) CanCreateIssueDependencies(user *models.User) bool { - return r.Permission.CanWrite(models.UnitTypeIssues) && r.Repository.IsDependenciesEnabled() +func (r *Repository) CanCreateIssueDependencies(user *models.User, isPull bool) bool { + return r.Repository.IsDependenciesEnabled() && r.Permission.CanWriteIssuesOrPulls(isPull) } // GetCommitsCount returns cached commit count for current view diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index 69b8a36995..7440f65bee 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -51,6 +51,10 @@ func SearchIssues(ctx *context.APIContext) { // description: repository to prioritize in the results // type: integer // format: int64 + // - name: type + // in: query + // description: filter by type (issues / pulls) if set + // type: string // responses: // "200": // "$ref": "#/responses/IssueList" @@ -129,6 +133,16 @@ func SearchIssues(ctx *context.APIContext) { } } + var isPull util.OptionalBool + switch ctx.Query("type") { + case "pulls": + isPull = util.OptionalBoolTrue + case "issues": + isPull = util.OptionalBoolFalse + default: + isPull = util.OptionalBoolNone + } + // Only fetch the issues if we either don't have a keyword or the search returned issues // This would otherwise return all issues if no issues were found by the search. if len(keyword) == 0 || len(issueIDs) > 0 || len(labelIDs) > 0 { @@ -141,6 +155,7 @@ func SearchIssues(ctx *context.APIContext) { LabelIDs: labelIDs, SortType: "priorityrepo", PriorityRepoID: ctx.QueryInt64("priority_repo_id"), + IsPull: isPull, }) } diff --git a/routers/repo/compare.go b/routers/repo/compare.go index 54bae464b2..3fa86a8d9f 100644 --- a/routers/repo/compare.go +++ b/routers/repo/compare.go @@ -415,7 +415,7 @@ func CompareDiff(ctx *context.Context) { if !nothingToCompare { // Setup information for new form. - RetrieveRepoMetas(ctx, ctx.Repo.Repository) + RetrieveRepoMetas(ctx, ctx.Repo.Repository, true) if ctx.Written() { return } diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 0a78e06b41..52f21b16ab 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -348,7 +348,7 @@ func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *models.Repos } // RetrieveRepoMetas find all the meta information of a repository -func RetrieveRepoMetas(ctx *context.Context, repo *models.Repository) []*models.Label { +func RetrieveRepoMetas(ctx *context.Context, repo *models.Repository, isPull bool) []*models.Label { if !ctx.Repo.CanWrite(models.UnitTypeIssues) { return nil } @@ -373,7 +373,7 @@ func RetrieveRepoMetas(ctx *context.Context, repo *models.Repository) []*models. ctx.Data["Branches"] = brs // Contains true if the user can create issue dependencies - ctx.Data["CanCreateIssueDependencies"] = ctx.Repo.CanCreateIssueDependencies(ctx.User) + ctx.Data["CanCreateIssueDependencies"] = ctx.Repo.CanCreateIssueDependencies(ctx.User, isPull) return labels } @@ -443,7 +443,7 @@ func NewIssue(ctx *context.Context) { setTemplateIfExists(ctx, issueTemplateKey, IssueTemplateCandidates) renderAttachmentSettings(ctx) - RetrieveRepoMetas(ctx, ctx.Repo.Repository) + RetrieveRepoMetas(ctx, ctx.Repo.Repository, false) if ctx.Written() { return } @@ -458,7 +458,7 @@ func ValidateRepoMetas(ctx *context.Context, form auth.CreateIssueForm, isPull b err error ) - labels := RetrieveRepoMetas(ctx, ctx.Repo.Repository) + labels := RetrieveRepoMetas(ctx, ctx.Repo.Repository, isPull) if ctx.Written() { return nil, nil, 0 } @@ -670,6 +670,14 @@ func ViewIssue(ctx *context.Context) { ctx.Data["PageIsIssueList"] = true } + if issue.IsPull && !ctx.Repo.CanRead(models.UnitTypeIssues) { + ctx.Data["IssueType"] = "pulls" + } else if !issue.IsPull && !ctx.Repo.CanRead(models.UnitTypePullRequests) { + ctx.Data["IssueType"] = "issues" + } else { + ctx.Data["IssueType"] = "all" + } + ctx.Data["RequireHighlightJS"] = true ctx.Data["RequireDropzone"] = true ctx.Data["RequireTribute"] = true @@ -807,7 +815,7 @@ func ViewIssue(ctx *context.Context) { } // Check if the user can use the dependencies - ctx.Data["CanCreateIssueDependencies"] = ctx.Repo.CanCreateIssueDependencies(ctx.User) + ctx.Data["CanCreateIssueDependencies"] = ctx.Repo.CanCreateIssueDependencies(ctx.User, issue.IsPull) // check if dependencies can be created across repositories ctx.Data["AllowCrossRepositoryDependencies"] = setting.Service.AllowCrossRepositoryDependencies diff --git a/routers/repo/issue_dependency.go b/routers/repo/issue_dependency.go index d865a56518..055b5ed2af 100644 --- a/routers/repo/issue_dependency.go +++ b/routers/repo/issue_dependency.go @@ -14,14 +14,6 @@ import ( // AddDependency adds new dependencies func AddDependency(ctx *context.Context) { - // Check if the Repo is allowed to have dependencies - if !ctx.Repo.CanCreateIssueDependencies(ctx.User) { - ctx.Error(http.StatusForbidden, "CanCreateIssueDependencies") - return - } - - depID := ctx.QueryInt64("newDependency") - issueIndex := ctx.ParamsInt64("index") issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, issueIndex) if err != nil { @@ -29,6 +21,14 @@ func AddDependency(ctx *context.Context) { return } + // Check if the Repo is allowed to have dependencies + if !ctx.Repo.CanCreateIssueDependencies(ctx.User, issue.IsPull) { + ctx.Error(http.StatusForbidden, "CanCreateIssueDependencies") + return + } + + depID := ctx.QueryInt64("newDependency") + if err = issue.LoadRepo(); err != nil { ctx.ServerError("LoadRepo", err) return @@ -73,14 +73,6 @@ func AddDependency(ctx *context.Context) { // RemoveDependency removes the dependency func RemoveDependency(ctx *context.Context) { - // Check if the Repo is allowed to have dependencies - if !ctx.Repo.CanCreateIssueDependencies(ctx.User) { - ctx.Error(http.StatusForbidden, "CanCreateIssueDependencies") - return - } - - depID := ctx.QueryInt64("removeDependencyID") - issueIndex := ctx.ParamsInt64("index") issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, issueIndex) if err != nil { @@ -88,6 +80,14 @@ func RemoveDependency(ctx *context.Context) { return } + // Check if the Repo is allowed to have dependencies + if !ctx.Repo.CanCreateIssueDependencies(ctx.User, issue.IsPull) { + ctx.Error(http.StatusForbidden, "CanCreateIssueDependencies") + return + } + + depID := ctx.QueryInt64("removeDependencyID") + if err = issue.LoadRepo(); err != nil { ctx.ServerError("LoadRepo", err) return diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index dd58e8b216..02564643cc 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -428,6 +428,7 @@ + diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 519a273b4e..fad47731f3 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -1173,6 +1173,12 @@ "description": "repository to prioritize in the results", "name": "priority_repo_id", "in": "query" + }, + { + "type": "string", + "description": "filter by type (issues / pulls) if set", + "name": "type", + "in": "query" } ], "responses": { diff --git a/web_src/js/index.js b/web_src/js/index.js index 7c3749c08b..619ca74e52 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -3455,9 +3455,10 @@ function initIssueList() { const repolink = $('#repolink').val(); const repoId = $('#repoId').val(); const crossRepoSearch = $('#crossRepoSearch').val(); - let issueSearchUrl = `${suburl}/api/v1/repos/${repolink}/issues?q={query}`; + const tp = $('#type').val(); + let issueSearchUrl = `${suburl}/api/v1/repos/${repolink}/issues?q={query}&type=${tp}`; if (crossRepoSearch === 'true') { - issueSearchUrl = `${suburl}/api/v1/repos/issues/search?q={query}&priority_repo_id=${repoId}`; + issueSearchUrl = `${suburl}/api/v1/repos/issues/search?q={query}&priority_repo_id=${repoId}&type=${tp}`; } $('#new-dependency-drop-list') .dropdown({ From bcb722daec4bdd45303da97173a2b8a3c4c95dcd Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 19 Jan 2020 19:59:30 +0000 Subject: [PATCH 037/200] Make CertFile and KeyFile relative to CustomPath (#9868) (#9874) * Make CertFile and KeyFile relative to CustomPath The current code will absolute CertFile and KeyFile against the current working directory. This is quite unexpected for users. This code makes relative paths absolute against the CustomPath. Fix #4196 * Improve error reporting when reading certificates * Apply suggestions from code review Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> --- custom/conf/app.ini.sample | 5 +++-- .../doc/advanced/config-cheat-sheet.en-us.md | 4 ++-- modules/graceful/server.go | 18 ++++++++++++++++-- modules/setting/setting.go | 6 ++++++ 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/custom/conf/app.ini.sample b/custom/conf/app.ini.sample index 29e147add8..190b838b85 100644 --- a/custom/conf/app.ini.sample +++ b/custom/conf/app.ini.sample @@ -275,8 +275,9 @@ DISABLE_ROUTER_LOG = false ; not forget to export the private key): ; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys ; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes -CERT_FILE = custom/https/cert.pem -KEY_FILE = custom/https/key.pem +; Paths are relative to CUSTOM_PATH +CERT_FILE = https/cert.pem +KEY_FILE = https/key.pem ; Root directory containing templates and static files. ; default is the path where Gitea is executed STATIC_ROOT_PATH = diff --git a/docs/content/doc/advanced/config-cheat-sheet.en-us.md b/docs/content/doc/advanced/config-cheat-sheet.en-us.md index ea17096ea5..feea2dbcc4 100644 --- a/docs/content/doc/advanced/config-cheat-sheet.en-us.md +++ b/docs/content/doc/advanced/config-cheat-sheet.en-us.md @@ -181,8 +181,8 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. - `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server. - `OFFLINE_MODE`: **false**: Disables use of CDN for static files and Gravatar for profile pictures. - `DISABLE_ROUTER_LOG`: **false**: Mute printing of the router log. -- `CERT_FILE`: **custom/https/cert.pem**: Cert file path used for HTTPS. -- `KEY_FILE`: **custom/https/key.pem**: Key file path used for HTTPS. +- `CERT_FILE`: **https/cert.pem**: Cert file path used for HTTPS. From 1.11 paths are relative to `CUSTOM_PATH`. +- `KEY_FILE`: **https/key.pem**: Key file path used for HTTPS. From 1.11 paths are relative to `CUSTOM_PATH`. - `STATIC_ROOT_PATH`: **./**: Upper level of template and static files path. - `STATIC_CACHE_TIME`: **6h**: Web browser cache time for static resources on `custom/`, `public/` and all uploaded avatars. - `ENABLE_GZIP`: **false**: Enables application-level GZIP support. diff --git a/modules/graceful/server.go b/modules/graceful/server.go index 30fb8cdffa..19ce8a866f 100644 --- a/modules/graceful/server.go +++ b/modules/graceful/server.go @@ -7,6 +7,7 @@ package graceful import ( "crypto/tls" + "io/ioutil" "net" "os" "strings" @@ -99,12 +100,25 @@ func (srv *Server) ListenAndServeTLS(certFile, keyFile string, serve ServeFuncti } config.Certificates = make([]tls.Certificate, 1) - var err error - config.Certificates[0], err = tls.LoadX509KeyPair(certFile, keyFile) + + certPEMBlock, err := ioutil.ReadFile(certFile) if err != nil { log.Error("Failed to load https cert file %s for %s:%s: %v", certFile, srv.network, srv.address, err) return err } + + keyPEMBlock, err := ioutil.ReadFile(keyFile) + if err != nil { + log.Error("Failed to load https key file %s for %s:%s: %v", keyFile, srv.network, srv.address, err) + return err + } + + config.Certificates[0], err = tls.X509KeyPair(certPEMBlock, keyPEMBlock) + if err != nil { + log.Error("Failed to create certificate from cert file %s and key file %s for %s:%s: %v", certFile, keyFile, srv.network, srv.address, err) + return err + } + return srv.ListenAndServeTLSConfig(config, serve) } diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 17c84d3d31..4183c203ed 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -554,6 +554,12 @@ func NewContext() { Protocol = HTTPS CertFile = sec.Key("CERT_FILE").String() KeyFile = sec.Key("KEY_FILE").String() + if !filepath.IsAbs(CertFile) && len(CertFile) > 0 { + CertFile = filepath.Join(CustomPath, CertFile) + } + if !filepath.IsAbs(KeyFile) && len(KeyFile) > 0 { + KeyFile = filepath.Join(CustomPath, KeyFile) + } case "fcgi": Protocol = FCGI case "fcgi+unix": From 3fa14d89a2c7fdbf021868318f75f53525c8948f Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 19 Jan 2020 23:21:54 +0100 Subject: [PATCH 038/200] [Backport] CI optimisation & add github token env var (#9875) * ci: use docker image for golangci-lint (#9737) * ci: re-ordering Drone CI for optimizing time (#9719) * ci: try re-ordering for optimizing time * ci: try re-ordering for optimizing time * ci: try re-ordering for optimizing time * ci: try re-ordering for optimizing time * ci: try re-ordering for optimizing time * ci: try re-ordering for optimizing time * ci: try offloading mysql8 to arm64 * Revert "ci: try offloading mysql8 to arm64" This reverts commit c60de5db1cf8b5984c3014a57da6490f06c8d980. * ci: try offloading pgsql to arm64 * ci: activate ldap on arm64 * ci: test mysql8 in place pgsql arm64 * chore: clean un-needed move * typo * ci: revert runnning mysql on arm64 * ci: run compliance on arm * chore: limit change * chore: readd maybe need for release fetch-tags * ci: remove docker-linux-amd64-dry-run * ci: remove docker-linux-amd64-dry-run * Revert "ci: remove docker-linux-amd64-dry-run" This reverts commit 0715f65b11c37869359aaaa5d22901da512e8184. Co-authored-by: zeripath Co-authored-by: Lunny Xiao * ci: use new mssql image (#9720) Co-authored-by: Lunny Xiao * ci: run notify on arm64 (#9762) * ci: run notify on arm64 Free one jobs on amrd64 * Update .drone.yml * Update .drone.yml * Update .drone.yml Based on: https://github.com/appleboy/drone-discord/blob/master/.drone.yml#L339 * improve trigger Co-authored-by: techknowlogick * ci: move some integration tests on arm64 (#9747) * tests: configure github remaining limit + read token (#9800) * ci: configure remaining github limmit * prepend with github since package is common to all migrations * add RefreshRate * Update github.go * add missing space * go fmt * Read env variable GITHUB_READ_TOKEN for token * Update .drone.yml * ci: simplify tag/release by always running coverage (#9774) * ci: simplify tag/release by always running coverage * use mod and vendor for unit test coverage * remove not needed lfs for unit test * use arm drone agent for docs (#9776) * run translations pipeline on arm server (#9865) * add git-check to Makefile Co-authored-by: Antoine GIRARD Co-authored-by: zeripath Co-authored-by: Lunny Xiao Co-authored-by: techknowlogick --- .drone.yml | 402 +++++++++++++++--------------- Makefile | 11 +- modules/migrations/github.go | 19 +- modules/migrations/github_test.go | 7 +- 4 files changed, 226 insertions(+), 213 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7a844af8eb..422319cfe0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,61 @@ --- kind: pipeline -name: testing +name: compliance + +platform: + os: linux + arch: arm64 + +workspace: + base: /go + path: src/code.gitea.io/gitea + +steps: + - name: pre-build + pull: always + image: node:10 # this step is kept at the lowest version of node that we support + commands: + - make css + - make js + + - name: build-without-gcc + pull: always + image: golang:1.11 # this step is kept as the lowest version of golang that we support + environment: + GO111MODULE: on + GOPROXY: off + commands: + - go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag + + - name: build-linux-386 + pull: always + image: golang:1.13 + environment: + GO111MODULE: on + GOPROXY: off + GOOS: linux + GOARCH: 386 + commands: + - go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit + + - name: check + pull: always + image: golang:1.13 + commands: + - make clean + - make golangci-lint + - make revive + - make swagger-check + - make swagger-validate + - make test-vendor + environment: + GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not + GOSUMDB: sum.golang.org + TAGS: bindata sqlite sqlite_unlock_notify + +--- +kind: pipeline +name: testing-amd64 platform: os: linux @@ -25,15 +80,9 @@ services: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: testgitea - - name: pgsql - pull: default - image: postgres:9.5 - environment: - POSTGRES_DB: test - - name: mssql pull: default - image: microsoft/mssql-server-linux:latest + image: mcr.microsoft.com/mssql/server:latest environment: ACCEPT_EULA: Y MSSQL_PID: Standard @@ -54,46 +103,11 @@ steps: exclude: - pull_request - - name: pre-build - pull: always - image: node:10 # this step is kept at the lowest version of node that we support - commands: - - make css - - make js - - - name: build-without-gcc - pull: always - image: golang:1.11 # this step is kept as the lowest version of golang that we support - environment: - GO111MODULE: on - GOPROXY: off - commands: - - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - - go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag - - - name: build-linux-386 - pull: always - image: golang:1.13 - environment: - GO111MODULE: on - GOPROXY: off - GOOS: linux - GOARCH: 386 - commands: - - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - - go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit - - name: build pull: always image: golang:1.13 commands: - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - - make clean - - make golangci-lint - - make revive - - make swagger-check - - make swagger-validate - - make test-vendor - make build environment: GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not @@ -108,70 +122,8 @@ steps: environment: GOPROXY: off TAGS: bindata sqlite sqlite_unlock_notify - depends_on: - - build - when: - branch: - - master - event: - - push - - pull_request - - - name: release-test - pull: always - image: golang:1.13 - commands: - - make test - environment: - GOPROXY: off - TAGS: bindata sqlite sqlite_unlock_notify - depends_on: - - build - when: - branch: - - "release/*" - event: - - push - - pull_request - - - name: tag-pre-condition - pull: always - image: alpine/git - commands: - - git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA} - depends_on: - - build - when: - event: - - tag - - - name: tag-test - pull: always - image: golang:1.13 - commands: - - make test - environment: - GOPROXY: off - TAGS: bindata - depends_on: - - tag-pre-condition - when: - event: - - tag - - - name: test-sqlite - pull: always - image: golang:1.13 - commands: - - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - - apt-get install -y git-lfs - - timeout -s ABRT 20m make test-sqlite-migration - - timeout -s ABRT 20m make test-sqlite - environment: - GOPROXY: off - TAGS: bindata - depends_on: - - build + GITHUB_READ_TOKEN: + from_secret: github_read_token - name: test-mysql pull: always @@ -187,30 +139,6 @@ steps: TEST_LDAP: 1 depends_on: - build - when: - branch: - - master - event: - - push - - pull_request - - - name: tag-test-mysql - pull: always - image: golang:1.13 - commands: - - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - - apt-get install -y git-lfs - - timeout -s ABRT 20m make test-mysql-migration - - timeout -s ABRT 20m make test-mysql - environment: - GOPROXY: off - TAGS: bindata - TEST_LDAP: 1 - depends_on: - - build - when: - event: - - tag - name: test-mysql8 pull: always @@ -227,21 +155,6 @@ steps: depends_on: - build - - name: test-pgsql - pull: always - image: golang:1.13 - commands: - - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - - apt-get install -y git-lfs - - timeout -s ABRT 20m make test-pgsql-migration - - timeout -s ABRT 20m make test-pgsql - environment: - GOPROXY: off - TAGS: bindata - TEST_LDAP: 1 - depends_on: - - build - - name: test-mssql pull: always image: golang:1.13 @@ -293,13 +206,89 @@ steps: - push - pull_request + + +--- +kind: pipeline +name: testing-arm64 + +platform: + os: linux + arch: arm64 + +workspace: + base: /go + path: src/code.gitea.io/gitea + +services: + - name: pgsql + pull: default + image: postgres:9.5 + environment: + POSTGRES_DB: test + + - name: ldap + pull: default + image: gitea/test-openldap:latest + +steps: + - name: fetch-tags + pull: default + image: docker:git + commands: + - git fetch --tags --force + when: + event: + exclude: + - pull_request + + - name: build + pull: always + image: golang:1.13 + commands: + - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs + - make build + environment: + GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not + GOSUMDB: sum.golang.org + TAGS: bindata sqlite sqlite_unlock_notify + + - name: test-sqlite + pull: always + image: golang:1.13 + commands: + - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" + - apt-get install -y git-lfs + - timeout -s ABRT 20m make test-sqlite-migration + - timeout -s ABRT 20m make test-sqlite + environment: + GOPROXY: off + TAGS: bindata + depends_on: + - build + + - name: test-pgsql + pull: always + image: golang:1.13 + commands: + - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" + - apt-get install -y git-lfs + - timeout -s ABRT 20m make test-pgsql-migration + - timeout -s ABRT 20m make test-pgsql + environment: + GOPROXY: off + TAGS: bindata + TEST_LDAP: 1 + depends_on: + - build + --- kind: pipeline name: translations platform: os: linux - arch: amd64 + arch: arm64 workspace: base: /go @@ -378,7 +367,8 @@ trigger: - push depends_on: - - testing + - testing-amd64 + - testing-arm64 - translations steps: @@ -476,7 +466,8 @@ trigger: - tag depends_on: - - testing + - testing-arm64 + - testing-amd64 steps: - name: fetch-tags @@ -545,17 +536,14 @@ name: docs platform: os: linux - arch: amd64 - -workspace: - base: /go - path: src/code.gitea.io/gitea + arch: arm64 steps: - name: build-docs pull: always - image: webhippie/hugo:latest + image: plugins/hugo:latest commands: + - apk add --no-cache make bash curl - cd docs - make trans-copy - make clean @@ -563,7 +551,7 @@ steps: - name: publish-docs pull: always - image: lucap/drone-netlify:latest + image: techknowlogick/drone-netlify:latest settings: path: docs/public/ site_id: d2260bae-7861-4c02-8646-8f6440b12672 @@ -578,7 +566,7 @@ steps: --- kind: pipeline -name: docker-linux-amd64 +name: docker-linux-amd64-release platform: os: linux @@ -589,13 +577,13 @@ workspace: path: src/code.gitea.io/gitea depends_on: - - testing + - testing-amd64 + - testing-arm64 trigger: ref: - refs/heads/master - "refs/tags/**" - - "refs/pull/**" steps: - name: fetch-tags @@ -603,23 +591,6 @@ steps: image: docker:git commands: - git fetch --tags --force - when: - event: - exclude: - - pull_request - - - name: dryrun - pull: always - image: plugins/docker:linux-amd64 - settings: - dry_run: true - repo: gitea/gitea - tags: linux-amd64 - build_args: - - GOPROXY=off - when: - event: - - pull_request - name: publish pull: always @@ -641,7 +612,7 @@ steps: --- kind: pipeline -name: docker-linux-arm64 +name: docker-linux-arm64-dry-run platform: os: linux @@ -652,25 +623,13 @@ workspace: path: src/code.gitea.io/gitea depends_on: - - testing + - compliance trigger: ref: - - refs/heads/master - - "refs/tags/**" - "refs/pull/**" steps: - - name: fetch-tags - pull: default - image: docker:git - commands: - - git fetch --tags --force - when: - event: - exclude: - - pull_request - - name: dryrun pull: always image: plugins/docker:linux-arm64 @@ -684,6 +643,33 @@ steps: event: - pull_request +--- +kind: pipeline +name: docker-linux-arm64-release + +platform: + os: linux + arch: arm64 + +workspace: + base: /go + path: src/code.gitea.io/gitea + +depends_on: + - testing-amd64 + - testing-arm64 + +trigger: + ref: + - refs/heads/master + - "refs/tags/**" +steps: + - name: fetch-tags + pull: default + image: docker:git + commands: + - git fetch --tags --force + - name: publish pull: always image: plugins/docker:linux-arm64 @@ -729,45 +715,49 @@ trigger: - "refs/tags/**" depends_on: - - docker-linux-amd64 - - docker-linux-arm64 + - docker-linux-amd64-release + - docker-linux-arm64-release --- kind: pipeline -name: notify +name: notifications platform: os: linux - arch: amd64 - -workspace: - base: /go - path: src/code.gitea.io/gitea + arch: arm64 clone: disable: true -when: +trigger: + branch: + - master + - "release/*" + event: + - push + - tag status: - success - failure depends_on: - - testing + - testing-amd64 + - testing-arm64 - translations - release-version - release-master - - docker-linux-amd64 - - docker-linux-arm64 + - docker-linux-amd64-release + - docker-linux-arm64-release - docker-manifest - docs steps: - name: discord pull: always - image: appleboy/drone-discord:1.0.0 - environment: - DISCORD_WEBHOOK_ID: + image: appleboy/drone-discord:1.2.4 + settings: + message: "{{#success build.status}} ✅ Build #{{build.number}} of `{{repo.name}}` succeeded.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{else}} ❌ Build #{{build.number}} of `{{repo.name}}` failed.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{/success}}\n" + webhook_id: from_secret: discord_webhook_id - DISCORD_WEBHOOK_TOKEN: + webhook_token: from_secret: discord_webhook_token diff --git a/Makefile b/Makefile index 8da85c7a81..7f5ba4534c 100644 --- a/Makefile +++ b/Makefile @@ -119,6 +119,13 @@ go-check: exit 1; \ fi +.PHONY: git-check +git-check: + @if git lfs >/dev/null 2>&1 ; then : ; else \ + echo "Gitea requires git with lfs support to run tests." ; \ + exit 1; \ + fi + .PHONY: node-check node-check: $(eval NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell node -v | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?' | tr '.' ' ');)) @@ -233,7 +240,7 @@ coverage: .PHONY: unit-test-coverage unit-test-coverage: - $(GO) test -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1 + GO111MODULE=on $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1 .PHONY: vendor vendor: @@ -376,7 +383,7 @@ integrations.mssql.test: $(GO_SOURCES) integrations.sqlite.test: $(GO_SOURCES) GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite sqlite_unlock_notify' -integrations.cover.test: $(GO_SOURCES) +integrations.cover.test: git-check $(GO_SOURCES) GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES) | tr ' ' ',') -o integrations.cover.test .PHONY: migrations.mysql.test diff --git a/modules/migrations/github.go b/modules/migrations/github.go index 9183c9318f..52344d0174 100644 --- a/modules/migrations/github.go +++ b/modules/migrations/github.go @@ -24,6 +24,8 @@ import ( var ( _ base.Downloader = &GithubDownloaderV3{} _ base.DownloaderFactory = &GithubDownloaderV3Factory{} + // GithubLimitRateRemaining limit to wait for new rate to apply + GithubLimitRateRemaining = 0 ) func init() { @@ -115,7 +117,7 @@ func (g *GithubDownloaderV3) SetContext(ctx context.Context) { } func (g *GithubDownloaderV3) sleep() { - for g.rate != nil && g.rate.Remaining <= 0 { + for g.rate != nil && g.rate.Remaining <= GithubLimitRateRemaining { timer := time.NewTimer(time.Until(g.rate.Reset.Time)) select { case <-g.ctx.Done(): @@ -124,15 +126,24 @@ func (g *GithubDownloaderV3) sleep() { case <-timer.C: } - rates, _, err := g.client.RateLimits(g.ctx) + err := g.RefreshRate() if err != nil { log.Error("g.client.RateLimits: %s", err) } - - g.rate = rates.GetCore() } } +// RefreshRate update the current rate (doesn't count in rate limit) +func (g *GithubDownloaderV3) RefreshRate() error { + rates, _, err := g.client.RateLimits(g.ctx) + if err != nil { + return err + } + + g.rate = rates.GetCore() + return nil +} + // GetRepoInfo returns a repository information func (g *GithubDownloaderV3) GetRepoInfo() (*base.Repository, error) { g.sleep() diff --git a/modules/migrations/github_test.go b/modules/migrations/github_test.go index bf71ab4756..0ff939dee7 100644 --- a/modules/migrations/github_test.go +++ b/modules/migrations/github_test.go @@ -6,6 +6,7 @@ package migrations import ( + "os" "testing" "time" @@ -62,7 +63,11 @@ func assertLabelEqual(t *testing.T, name, color, description string, label *base } func TestGitHubDownloadRepo(t *testing.T) { - downloader := NewGithubDownloaderV3("", "", "go-gitea", "test_repo") + GithubLimitRateRemaining = 3 //Wait at 3 remaining since we could have 3 CI in // + downloader := NewGithubDownloaderV3(os.Getenv("GITHUB_READ_TOKEN"), "", "go-gitea", "test_repo") + err := downloader.RefreshRate() + assert.NoError(t, err) + repo, err := downloader.GetRepoInfo() assert.NoError(t, err) assert.EqualValues(t, &base.Repository{ From e878d743f49fc48c603ace90c9b9343814ae31ec Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 19 Jan 2020 23:21:21 +0000 Subject: [PATCH 039/200] Ensure that 2fa is checked on reset-password (#9857) (#9876) * Ensure that 2fa is checked on reset-password * Apply suggestions from code review Co-Authored-By: Lauris BH * Properly manage scratch_code regeneration Co-authored-by: Lauris BH Co-authored-by: Lauris BH --- routers/user/auth.go | 83 ++++++++++++++++++++++++--- templates/user/auth/reset_passwd.tmpl | 23 +++++++- 2 files changed, 97 insertions(+), 9 deletions(-) diff --git a/routers/user/auth.go b/routers/user/auth.go index 258b5e03d7..6395836480 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -1284,7 +1284,7 @@ func ForgotPasswdPost(ctx *context.Context) { ctx.HTML(200, tplForgotPassword) } -func commonResetPassword(ctx *context.Context) *models.User { +func commonResetPassword(ctx *context.Context) (*models.User, *models.TwoFactor) { code := ctx.Query("code") ctx.Data["Title"] = ctx.Tr("auth.reset_password") @@ -1296,14 +1296,25 @@ func commonResetPassword(ctx *context.Context) *models.User { if len(code) == 0 { ctx.Flash.Error(ctx.Tr("auth.invalid_code")) - return nil + return nil, nil } // Fail early, don't frustrate the user u := models.VerifyUserActiveCode(code) if u == nil { ctx.Flash.Error(ctx.Tr("auth.invalid_code")) - return nil + return nil, nil + } + + twofa, err := models.GetTwoFactorByUID(u.ID) + if err != nil { + if !models.IsErrTwoFactorNotEnrolled(err) { + ctx.Error(http.StatusInternalServerError, "CommonResetPassword", err.Error()) + return nil, nil + } + } else { + ctx.Data["has_two_factor"] = true + ctx.Data["scratch_code"] = ctx.QueryBool("scratch_code") } // Show the user that they are affecting the account that they intended to @@ -1311,10 +1322,10 @@ func commonResetPassword(ctx *context.Context) *models.User { if nil != ctx.User && u.ID != ctx.User.ID { ctx.Flash.Error(ctx.Tr("auth.reset_password_wrong_user", ctx.User.Email, u.Email)) - return nil + return nil, nil } - return u + return u, twofa } // ResetPasswd render the account recovery page @@ -1322,13 +1333,19 @@ func ResetPasswd(ctx *context.Context) { ctx.Data["IsResetForm"] = true commonResetPassword(ctx) + if ctx.Written() { + return + } ctx.HTML(200, tplResetPassword) } // ResetPasswdPost response from account recovery request func ResetPasswdPost(ctx *context.Context) { - u := commonResetPassword(ctx) + u, twofa := commonResetPassword(ctx) + if ctx.Written() { + return + } if u == nil { // Flash error has been set @@ -1350,6 +1367,39 @@ func ResetPasswdPost(ctx *context.Context) { return } + // Handle two-factor + regenerateScratchToken := false + if twofa != nil { + if ctx.QueryBool("scratch_code") { + if !twofa.VerifyScratchToken(ctx.Query("token")) { + ctx.Data["IsResetForm"] = true + ctx.Data["Err_Token"] = true + ctx.RenderWithErr(ctx.Tr("auth.twofa_scratch_token_incorrect"), tplResetPassword, nil) + return + } + regenerateScratchToken = true + } else { + passcode := ctx.Query("passcode") + ok, err := twofa.ValidateTOTP(passcode) + if err != nil { + ctx.Error(http.StatusInternalServerError, "ValidateTOTP", err.Error()) + return + } + if !ok || twofa.LastUsedPasscode == passcode { + ctx.Data["IsResetForm"] = true + ctx.Data["Err_Passcode"] = true + ctx.RenderWithErr(ctx.Tr("auth.twofa_passcode_incorrect"), tplResetPassword, nil) + return + } + + twofa.LastUsedPasscode = passcode + if err = models.UpdateTwoFactor(twofa); err != nil { + ctx.ServerError("ResetPasswdPost: UpdateTwoFactor", err) + return + } + } + } + var err error if u.Rands, err = models.GetUserSalt(); err != nil { ctx.ServerError("UpdateUser", err) @@ -1359,7 +1409,6 @@ func ResetPasswdPost(ctx *context.Context) { ctx.ServerError("UpdateUser", err) return } - u.HashPassword(passwd) u.MustChangePassword = false if err := models.UpdateUserCols(u, "must_change_password", "passwd", "rands", "salt"); err != nil { @@ -1368,9 +1417,27 @@ func ResetPasswdPost(ctx *context.Context) { } log.Trace("User password reset: %s", u.Name) - ctx.Data["IsResetFailed"] = true remember := len(ctx.Query("remember")) != 0 + + if regenerateScratchToken { + // Invalidate the scratch token. + _, err = twofa.GenerateScratchToken() + if err != nil { + ctx.ServerError("UserSignIn", err) + return + } + if err = models.UpdateTwoFactor(twofa); err != nil { + ctx.ServerError("UserSignIn", err) + return + } + + handleSignInFull(ctx, u, remember, false) + ctx.Flash.Info(ctx.Tr("auth.twofa_scratch_used")) + ctx.Redirect(setting.AppSubURL + "/user/settings/security") + return + } + handleSignInFull(ctx, u, remember, true) } diff --git a/templates/user/auth/reset_passwd.tmpl b/templates/user/auth/reset_passwd.tmpl index e7d939294e..91d5a5ef88 100644 --- a/templates/user/auth/reset_passwd.tmpl +++ b/templates/user/auth/reset_passwd.tmpl @@ -18,7 +18,7 @@ {{end}} {{if .IsResetForm}}
    - +
    {{if not .user_signed_in}} @@ -30,10 +30,31 @@
    {{end}} + {{if .has_two_factor}} +

    + {{.i18n.Tr "twofa"}} +

    +
    {{.i18n.Tr "settings.twofa_is_enrolled" | Str2html }}
    + {{if .scratch_code}} +
    + + +
    + + {{else}} +
    + + +
    + {{end}} + {{end}}
    + {{if and .has_two_factor (not .scratch_code)}} + {{.i18n.Tr "auth.use_scratch_code" | Str2html}} + {{end}}
    {{else}}

    {{.i18n.Tr "auth.invalid_code"}}

    From f2e9d4b85108e29f13e3a2f3425e77f7ec3dec7c Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 20 Jan 2020 00:23:35 +0000 Subject: [PATCH 040/200] Allow hyphen in language name (#9873) (#9880) Co-authored-by: techknowlogick --- modules/markup/sanitizer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/markup/sanitizer.go b/modules/markup/sanitizer.go index d135d41966..5158e67c2a 100644 --- a/modules/markup/sanitizer.go +++ b/modules/markup/sanitizer.go @@ -38,7 +38,7 @@ func NewSanitizer() { func ReplaceSanitizer() { sanitizer.policy = bluemonday.UGCPolicy() // We only want to allow HighlightJS specific classes for code blocks - sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`^language-\w+$`)).OnElements("code") + sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`^language-[\w-]+$`)).OnElements("code") // Checkboxes sanitizer.policy.AllowAttrs("type").Matching(regexp.MustCompile(`^checkbox$`)).OnElements("input") From ce756ee89fa1e0c27a0f3a4a26016aa6bab72648 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 20 Jan 2020 04:01:39 +0100 Subject: [PATCH 041/200] Check user != nil before checking values (#9881) (#9883) * Check user != nil before checking values * Handle autoAdmin Co-authored-by: zeripath --- models/login_source.go | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/models/login_source.go b/models/login_source.go index 0a8a92336e..0c4d444fec 100644 --- a/models/login_source.go +++ b/models/login_source.go @@ -473,13 +473,21 @@ func LoginViaLDAP(user *User, login, password string, source *LoginSource, autoR // Update User admin flag if exist if isExist, err := IsUserExist(0, sr.Username); err != nil { return nil, err - } else if isExist && - !user.ProhibitLogin && len(source.LDAP().AdminFilter) > 0 && user.IsAdmin != sr.IsAdmin { - // Change existing admin flag only if AdminFilter option is set - user.IsAdmin = sr.IsAdmin - err = UpdateUserCols(user, "is_admin") - if err != nil { - return nil, err + } else if isExist { + if user == nil { + user, err = GetUserByName(sr.Username) + if err != nil { + return nil, err + } + } + if user != nil && + !user.ProhibitLogin && len(source.LDAP().AdminFilter) > 0 && user.IsAdmin != sr.IsAdmin { + // Change existing admin flag only if AdminFilter option is set + user.IsAdmin = sr.IsAdmin + err = UpdateUserCols(user, "is_admin") + if err != nil { + return nil, err + } } } From f96c1a2c79a86a157f5eb697a5f1ac89ee33267f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 20 Jan 2020 23:59:33 +0800 Subject: [PATCH 042/200] Fix wrong permissions check when issues/prs shared operations (#9885) (#9889) * Fix wrong permissions check when issues/prs shared operations * move redirect to the last of the function * fix swagger Co-authored-by: zeripath Co-authored-by: Lauris BH --- modules/context/repo.go | 2 +- modules/repofiles/action.go | 4 ++-- routers/api/v1/repo/issue.go | 26 +++++++++++++++++++++----- routers/api/v1/repo/issue_comment.go | 2 +- routers/api/v1/repo/issue_reaction.go | 4 ++-- routers/api/v1/repo/issue_stopwatch.go | 2 +- routers/repo/issue.go | 9 ++++----- routers/repo/issue_dependency.go | 6 +++--- routers/routes/routes.go | 8 +------- templates/repo/issue/view_content.tmpl | 2 +- templates/swagger/v1_json.tmpl | 6 ++++++ 11 files changed, 43 insertions(+), 28 deletions(-) diff --git a/modules/context/repo.go b/modules/context/repo.go index af2b3902ad..d0a9826467 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -91,7 +91,7 @@ func (r *Repository) CanUseTimetracker(issue *models.Issue, user *models.User) b // 2. Is the user a contributor, admin, poster or assignee and do the repository policies require this? isAssigned, _ := models.IsUserAssignedToIssue(issue, user) return r.Repository.IsTimetrackerEnabled() && (!r.Repository.AllowOnlyContributorsToTrackTime() || - r.Permission.CanWrite(models.UnitTypeIssues) || issue.IsPoster(user.ID) || isAssigned) + r.Permission.CanWriteIssuesOrPulls(issue.IsPull) || issue.IsPoster(user.ID) || isAssigned) } // CanCreateIssueDependencies returns whether or not a user can create dependencies. diff --git a/modules/repofiles/action.go b/modules/repofiles/action.go index 5fe9333591..29438a880d 100644 --- a/modules/repofiles/action.go +++ b/modules/repofiles/action.go @@ -103,8 +103,8 @@ func UpdateIssuesCommit(doer *models.User, repo *models.Repository, commits []*m refMarked[key] = true // FIXME: this kind of condition is all over the code, it should be consolidated in a single place - canclose := perm.IsAdmin() || perm.IsOwner() || perm.CanWrite(models.UnitTypeIssues) || refIssue.PosterID == doer.ID - cancomment := canclose || perm.CanRead(models.UnitTypeIssues) + canclose := perm.IsAdmin() || perm.IsOwner() || perm.CanWriteIssuesOrPulls(refIssue.IsPull) || refIssue.PosterID == doer.ID + cancomment := canclose || perm.CanReadIssuesOrPulls(refIssue.IsPull) // Don't proceed if the user can't comment if !cancomment { diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index 7440f65bee..e00c24ea3f 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -207,6 +207,10 @@ func ListIssues(ctx *context.APIContext) { // in: query // description: search string // type: string + // - name: type + // in: query + // description: filter by type (issues / pulls) if set + // type: string // responses: // "200": // "$ref": "#/responses/IssueList" @@ -242,6 +246,16 @@ func ListIssues(ctx *context.APIContext) { } } + var isPull util.OptionalBool + switch ctx.Query("type") { + case "pulls": + isPull = util.OptionalBoolTrue + case "issues": + isPull = util.OptionalBoolFalse + default: + isPull = util.OptionalBoolNone + } + // Only fetch the issues if we either don't have a keyword or the search returned issues // This would otherwise return all issues if no issues were found by the search. if len(keyword) == 0 || len(issueIDs) > 0 || len(labelIDs) > 0 { @@ -252,6 +266,7 @@ func ListIssues(ctx *context.APIContext) { IsClosed: isClosed, IssueIDs: issueIDs, LabelIDs: labelIDs, + IsPull: isPull, }) } @@ -476,6 +491,7 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) { return } issue.Repo = ctx.Repo.Repository + canWrite := ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) err = issue.LoadAttributes() if err != nil { @@ -483,7 +499,7 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) { return } - if !issue.IsPoster(ctx.User.ID) && !ctx.Repo.CanWrite(models.UnitTypeIssues) { + if !issue.IsPoster(ctx.User.ID) && !canWrite { ctx.Status(http.StatusForbidden) return } @@ -496,7 +512,7 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) { } // Update or remove the deadline, only if set and allowed - if (form.Deadline != nil || form.RemoveDeadline != nil) && ctx.Repo.CanWrite(models.UnitTypeIssues) { + if (form.Deadline != nil || form.RemoveDeadline != nil) && canWrite { var deadlineUnix timeutil.TimeStamp if (form.RemoveDeadline == nil || !*form.RemoveDeadline) && !form.Deadline.IsZero() { @@ -520,7 +536,7 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) { // Pass one or more user logins to replace the set of assignees on this Issue. // Send an empty array ([]) to clear all assignees from the Issue. - if ctx.Repo.CanWrite(models.UnitTypeIssues) && (form.Assignees != nil || form.Assignee != nil) { + if canWrite && (form.Assignees != nil || form.Assignee != nil) { oneAssignee := "" if form.Assignee != nil { oneAssignee = *form.Assignee @@ -533,7 +549,7 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) { } } - if ctx.Repo.CanWrite(models.UnitTypeIssues) && form.Milestone != nil && + if canWrite && form.Milestone != nil && issue.MilestoneID != *form.Milestone { oldMilestoneID := issue.MilestoneID issue.MilestoneID = *form.Milestone @@ -619,7 +635,7 @@ func UpdateIssueDeadline(ctx *context.APIContext, form api.EditDeadlineOption) { return } - if !ctx.Repo.CanWrite(models.UnitTypeIssues) { + if !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) { ctx.Error(http.StatusForbidden, "", "Not repo writer") return } diff --git a/routers/api/v1/repo/issue_comment.go b/routers/api/v1/repo/issue_comment.go index c13fc93cdf..0e4ed6827c 100644 --- a/routers/api/v1/repo/issue_comment.go +++ b/routers/api/v1/repo/issue_comment.go @@ -190,7 +190,7 @@ func CreateIssueComment(ctx *context.APIContext, form api.CreateIssueCommentOpti return } - if issue.IsLocked && !ctx.Repo.CanWrite(models.UnitTypeIssues) && !ctx.User.IsAdmin { + if issue.IsLocked && !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) && !ctx.User.IsAdmin { ctx.Error(http.StatusForbidden, "CreateIssueComment", errors.New(ctx.Tr("repo.issues.comment_on_locked"))) return } diff --git a/routers/api/v1/repo/issue_reaction.go b/routers/api/v1/repo/issue_reaction.go index b943ea6980..f546c2746a 100644 --- a/routers/api/v1/repo/issue_reaction.go +++ b/routers/api/v1/repo/issue_reaction.go @@ -179,7 +179,7 @@ func changeIssueCommentReaction(ctx *context.APIContext, form api.EditReactionOp ctx.Error(http.StatusInternalServerError, "comment.LoadIssue() failed", err) } - if comment.Issue.IsLocked && !ctx.Repo.CanWrite(models.UnitTypeIssues) { + if comment.Issue.IsLocked && !ctx.Repo.CanWriteIssuesOrPulls(comment.Issue.IsPull) { ctx.Error(http.StatusForbidden, "ChangeIssueCommentReaction", errors.New("no permission to change reaction")) return } @@ -380,7 +380,7 @@ func changeIssueReaction(ctx *context.APIContext, form api.EditReactionOption, i return } - if issue.IsLocked && !ctx.Repo.CanWrite(models.UnitTypeIssues) { + if issue.IsLocked && !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) { ctx.Error(http.StatusForbidden, "ChangeIssueCommentReaction", errors.New("no permission to change reaction")) return } diff --git a/routers/api/v1/repo/issue_stopwatch.go b/routers/api/v1/repo/issue_stopwatch.go index 3ffdf24404..3b7c20d4d3 100644 --- a/routers/api/v1/repo/issue_stopwatch.go +++ b/routers/api/v1/repo/issue_stopwatch.go @@ -170,7 +170,7 @@ func prepareIssueStopwatch(ctx *context.APIContext, shouldExist bool) (*models.I return nil, err } - if !ctx.Repo.CanWrite(models.UnitTypeIssues) { + if !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) { ctx.Status(http.StatusForbidden) return nil, err } diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 52f21b16ab..f69e0bb60d 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -63,13 +63,12 @@ var ( // If locked and user has permissions to write to the repository, // then the comment is allowed, else it is blocked func MustAllowUserComment(ctx *context.Context) { - issue := GetActionIssue(ctx) if ctx.Written() { return } - if issue.IsLocked && !ctx.Repo.CanWrite(models.UnitTypeIssues) && !ctx.User.IsAdmin { + if issue.IsLocked && !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) && !ctx.User.IsAdmin { ctx.Flash.Error(ctx.Tr("repo.issues.comment_on_locked")) ctx.Redirect(issue.HTMLURL()) return @@ -349,7 +348,7 @@ func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *models.Repos // RetrieveRepoMetas find all the meta information of a repository func RetrieveRepoMetas(ctx *context.Context, repo *models.Repository, isPull bool) []*models.Label { - if !ctx.Repo.CanWrite(models.UnitTypeIssues) { + if !ctx.Repo.CanWriteIssuesOrPulls(isPull) { return nil } @@ -1006,7 +1005,6 @@ func ViewIssue(ctx *context.Context) { ctx.Data["IsIssuePoster"] = ctx.IsSigned && issue.IsPoster(ctx.User.ID) ctx.Data["IsIssueWriter"] = ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) ctx.Data["IsRepoAdmin"] = ctx.IsSigned && (ctx.Repo.IsAdmin() || ctx.User.IsAdmin) - ctx.Data["IsRepoIssuesWriter"] = ctx.IsSigned && (ctx.Repo.CanWrite(models.UnitTypeIssues) || ctx.User.IsAdmin) ctx.Data["LockReasons"] = setting.Repository.Issue.LockReasons ctx.HTML(200, tplIssueView) } @@ -1267,9 +1265,10 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) { } ctx.Error(403) + return } - if issue.IsLocked && !ctx.Repo.CanWrite(models.UnitTypeIssues) && !ctx.User.IsAdmin { + if issue.IsLocked && !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) && !ctx.User.IsAdmin { ctx.Flash.Error(ctx.Tr("repo.issues.comment_on_locked")) ctx.Redirect(issue.HTMLURL(), http.StatusSeeOther) return diff --git a/routers/repo/issue_dependency.go b/routers/repo/issue_dependency.go index 055b5ed2af..8a83c7bae3 100644 --- a/routers/repo/issue_dependency.go +++ b/routers/repo/issue_dependency.go @@ -93,9 +93,6 @@ func RemoveDependency(ctx *context.Context) { return } - // Redirect - ctx.Redirect(issue.HTMLURL(), http.StatusSeeOther) - // Dependency Type depTypeStr := ctx.Req.PostForm.Get("dependencyType") @@ -126,4 +123,7 @@ func RemoveDependency(ctx *context.Context) { ctx.ServerError("RemoveIssueDependency", err) return } + + // Redirect + ctx.Redirect(issue.HTMLURL(), http.StatusSeeOther) } diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 58a2da82fc..08cc52e0e0 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -503,19 +503,13 @@ func RegisterRoutes(m *macaron.Macaron) { reqRepoReleaseWriter := context.RequireRepoWriter(models.UnitTypeReleases) reqRepoReleaseReader := context.RequireRepoReader(models.UnitTypeReleases) reqRepoWikiWriter := context.RequireRepoWriter(models.UnitTypeWiki) + reqRepoIssueWriter := context.RequireRepoWriter(models.UnitTypeIssues) reqRepoIssueReader := context.RequireRepoReader(models.UnitTypeIssues) reqRepoPullsWriter := context.RequireRepoWriter(models.UnitTypePullRequests) reqRepoPullsReader := context.RequireRepoReader(models.UnitTypePullRequests) reqRepoIssuesOrPullsWriter := context.RequireRepoWriterOr(models.UnitTypeIssues, models.UnitTypePullRequests) reqRepoIssuesOrPullsReader := context.RequireRepoReaderOr(models.UnitTypeIssues, models.UnitTypePullRequests) - reqRepoIssueWriter := func(ctx *context.Context) { - if !ctx.Repo.CanWrite(models.UnitTypeIssues) { - ctx.Error(403) - return - } - } - // ***** START: Organization ***** m.Group("/org", func() { m.Group("", func() { diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index bee8a3dfe5..d336b78049 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -66,7 +66,7 @@ {{ template "repo/issue/view_content/pull". }} {{end}} {{if .IsSigned}} - {{ if and (or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }} + {{ if and (or .IsRepoAdmin .IsIssueWriter (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }}
    diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index fad47731f3..731d2d36ad 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -2909,6 +2909,12 @@ "description": "search string", "name": "q", "in": "query" + }, + { + "type": "string", + "description": "filter by type (issues / pulls) if set", + "name": "type", + "in": "query" } ], "responses": { From ff508c9c9b7405dc82b760ed9e44e35757c1e768 Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 20 Jan 2020 19:18:23 +0000 Subject: [PATCH 043/200] Add option to prevent LDAP from deactivating everything on empty search (#9879) (#9896) * Add option to prevent LDAP from deactivating everything on empty search * Update options/locale/locale_en-US.ini Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lunny Xiao --- cmd/admin_auth_ldap.go | 7 +++++++ models/user.go | 9 +++++++++ modules/auth/auth_form.go | 1 + modules/auth/ldap/ldap.go | 1 + options/locale/locale_en-US.ini | 1 + routers/admin/auths.go | 1 + templates/admin/auth/edit.tmpl | 6 ++++++ 7 files changed, 26 insertions(+) diff --git a/cmd/admin_auth_ldap.go b/cmd/admin_auth_ldap.go index cce3aa894f..e869686cbd 100644 --- a/cmd/admin_auth_ldap.go +++ b/cmd/admin_auth_ldap.go @@ -61,6 +61,10 @@ var ( Name: "admin-filter", Usage: "An LDAP filter specifying if a user should be given administrator privileges.", }, + cli.BoolFlag{ + Name: "allow-deactivate-all", + Usage: "Allow empty search results to deactivate all users.", + }, cli.StringFlag{ Name: "username-attribute", Usage: "The attribute of the user’s LDAP record containing the user name.", @@ -231,6 +235,9 @@ func parseLdapConfig(c *cli.Context, config *models.LDAPConfig) error { if c.IsSet("admin-filter") { config.Source.AdminFilter = c.String("admin-filter") } + if c.IsSet("allow-deactivate-all") { + config.Source.AllowDeactivateAll = c.Bool("allow-deactivate-all") + } return nil } diff --git a/models/user.go b/models/user.go index 9ddd262aed..7e3fce5f70 100644 --- a/models/user.go +++ b/models/user.go @@ -1760,6 +1760,15 @@ func SyncExternalUsers(ctx context.Context) { continue } + if len(sr) == 0 { + if !s.LDAP().AllowDeactivateAll { + log.Error("LDAP search found no entries but did not report an error. Refusing to deactivate all users") + continue + } else { + log.Warn("LDAP search found no entries but did not report an error. All users will be deactivated as per settings") + } + } + for _, su := range sr { select { case <-ctx.Done(): diff --git a/modules/auth/auth_form.go b/modules/auth/auth_form.go index c838590c1f..a30ebb75eb 100644 --- a/modules/auth/auth_form.go +++ b/modules/auth/auth_form.go @@ -30,6 +30,7 @@ type AuthenticationForm struct { SearchPageSize int Filter string AdminFilter string + AllowDeactivateAll bool IsActive bool IsSyncEnabled bool SMTPAuth string diff --git a/modules/auth/ldap/ldap.go b/modules/auth/ldap/ldap.go index ed83a77e12..7f0d2c93f3 100644 --- a/modules/auth/ldap/ldap.go +++ b/modules/auth/ldap/ldap.go @@ -47,6 +47,7 @@ type Source struct { Filter string // Query filter to validate entry AdminFilter string // Query filter to check if user is admin Enabled bool // if this source is disabled + AllowDeactivateAll bool // Allow an empty search response to deactivate all users from this source } // SearchResult : user data diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 320d606485..5e4d945317 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1826,6 +1826,7 @@ auths.attribute_surname = Surname Attribute auths.attribute_mail = Email Attribute auths.attribute_ssh_public_key = Public SSH Key Attribute auths.attributes_in_bind = Fetch Attributes in Bind DN Context +auths.allow_deactivate_all = Allow an empty search result to deactivate all users auths.use_paged_search = Use Paged Search auths.search_page_size = Page Size auths.filter = User Filter diff --git a/routers/admin/auths.go b/routers/admin/auths.go index 8a16e36bf5..4fa76df44e 100644 --- a/routers/admin/auths.go +++ b/routers/admin/auths.go @@ -130,6 +130,7 @@ func parseLDAPConfig(form auth.AuthenticationForm) *models.LDAPConfig { SearchPageSize: pageSize, Filter: form.Filter, AdminFilter: form.AdminFilter, + AllowDeactivateAll: form.AllowDeactivateAll, Enabled: true, }, } diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index d1a614b1f0..3f515bbf48 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -112,6 +112,12 @@
  • {{end}} +
    +
    + + +
    +
    {{end}} From 05b986408618c1cbd7491bd7b5cf689c3fb143e0 Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 21 Jan 2020 12:02:25 +0000 Subject: [PATCH 044/200] Update queue_redis.go (#9911) --- modules/queue/queue_redis.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/queue/queue_redis.go b/modules/queue/queue_redis.go index 14e68937a5..7d3efb9cff 100644 --- a/modules/queue/queue_redis.go +++ b/modules/queue/queue_redis.go @@ -84,11 +84,12 @@ func NewRedisQueue(handle HandlerFunc, cfg, exemplar interface{}) (Queue, error) boostWorkers: config.BoostWorkers, maxNumberOfWorkers: config.MaxWorkers, }, - queueName: config.QueueName, - exemplar: exemplar, - closed: make(chan struct{}), - workers: config.Workers, - name: config.Name, + queueName: config.QueueName, + exemplar: exemplar, + closed: make(chan struct{}), + terminated: make(chan struct{}), + workers: config.Workers, + name: config.Name, } if len(dbs) == 0 { return nil, errors.New("no redis host specified") From 79c1d48532167cb86597316b115fd3f367e35b22 Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 21 Jan 2020 20:17:00 +0000 Subject: [PATCH 045/200] Do not try to recreate ldap user if they are already created (#9900) (#9919) * Do not try to recreate ldap user if they are already created * just remove autoregister Co-authored-by: techknowlogick Co-authored-by: techknowlogick --- models/login_source.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/models/login_source.go b/models/login_source.go index 0c4d444fec..f5dae860f8 100644 --- a/models/login_source.go +++ b/models/login_source.go @@ -461,7 +461,7 @@ var ( // LoginViaLDAP queries if login/password is valid against the LDAP directory pool, // and create a local user if success when enabled. -func LoginViaLDAP(user *User, login, password string, source *LoginSource, autoRegister bool) (*User, error) { +func LoginViaLDAP(user *User, login, password string, source *LoginSource) (*User, error) { sr := source.Cfg.(*LDAPConfig).SearchEntry(login, password, source.Type == LoginDLDAP) if sr == nil { // User not in LDAP, do nothing @@ -491,7 +491,7 @@ func LoginViaLDAP(user *User, login, password string, source *LoginSource, autoR } } - if !autoRegister { + if user != nil { if isAttributeSSHPublicKeySet && synchronizeLdapSSHPublicKeys(user, source, sr.SSHPublicKey) { return user, RewriteAllPublicKeys() } @@ -602,7 +602,7 @@ func SMTPAuth(a smtp.Auth, cfg *SMTPConfig) error { // LoginViaSMTP queries if login/password is valid against the SMTP, // and create a local user if success when enabled. -func LoginViaSMTP(user *User, login, password string, sourceID int64, cfg *SMTPConfig, autoRegister bool) (*User, error) { +func LoginViaSMTP(user *User, login, password string, sourceID int64, cfg *SMTPConfig) (*User, error) { // Verify allowed domains. if len(cfg.AllowedDomains) > 0 { idx := strings.Index(login, "@") @@ -633,7 +633,7 @@ func LoginViaSMTP(user *User, login, password string, sourceID int64, cfg *SMTPC return nil, err } - if !autoRegister { + if user != nil { return user, nil } @@ -665,7 +665,7 @@ func LoginViaSMTP(user *User, login, password string, sourceID int64, cfg *SMTPC // LoginViaPAM queries if login/password is valid against the PAM, // and create a local user if success when enabled. -func LoginViaPAM(user *User, login, password string, sourceID int64, cfg *PAMConfig, autoRegister bool) (*User, error) { +func LoginViaPAM(user *User, login, password string, sourceID int64, cfg *PAMConfig) (*User, error) { if err := pam.Auth(cfg.ServiceName, login, password); err != nil { if strings.Contains(err.Error(), "Authentication failure") { return nil, ErrUserNotExist{0, login, 0} @@ -673,7 +673,7 @@ func LoginViaPAM(user *User, login, password string, sourceID int64, cfg *PAMCon return nil, err } - if !autoRegister { + if user != nil { return user, nil } @@ -691,7 +691,7 @@ func LoginViaPAM(user *User, login, password string, sourceID int64, cfg *PAMCon } // ExternalUserLogin attempts a login using external source types. -func ExternalUserLogin(user *User, login, password string, source *LoginSource, autoRegister bool) (*User, error) { +func ExternalUserLogin(user *User, login, password string, source *LoginSource) (*User, error) { if !source.IsActived { return nil, ErrLoginSourceNotActived } @@ -699,11 +699,11 @@ func ExternalUserLogin(user *User, login, password string, source *LoginSource, var err error switch source.Type { case LoginLDAP, LoginDLDAP: - user, err = LoginViaLDAP(user, login, password, source, autoRegister) + user, err = LoginViaLDAP(user, login, password, source) case LoginSMTP: - user, err = LoginViaSMTP(user, login, password, source.ID, source.Cfg.(*SMTPConfig), autoRegister) + user, err = LoginViaSMTP(user, login, password, source.ID, source.Cfg.(*SMTPConfig)) case LoginPAM: - user, err = LoginViaPAM(user, login, password, source.ID, source.Cfg.(*PAMConfig), autoRegister) + user, err = LoginViaPAM(user, login, password, source.ID, source.Cfg.(*PAMConfig)) default: return nil, ErrUnsupportedLoginType } @@ -783,7 +783,7 @@ func UserSignIn(username, password string) (*User, error) { return nil, ErrLoginSourceNotExist{user.LoginSource} } - return ExternalUserLogin(user, user.LoginName, password, &source, false) + return ExternalUserLogin(user, user.LoginName, password, &source) } } @@ -797,7 +797,7 @@ func UserSignIn(username, password string) (*User, error) { // don't try to authenticate against OAuth2 and SSPI sources here continue } - authUser, err := ExternalUserLogin(nil, username, password, source, true) + authUser, err := ExternalUserLogin(nil, username, password, source) if err == nil { return authUser, nil } From db9342c8540fdea3fe135b97886ec0752689d8d5 Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Tue, 21 Jan 2020 16:24:18 -0600 Subject: [PATCH 046/200] Fix RocketChat (#9908) (#9921) * Fix RocketChat?? Signed-off-by: jolheiser * Don't send attachment for repo create/delete Signed-off-by: jolheiser * Make fmt Signed-off-by: jolheiser Co-authored-by: Lauris BH Co-authored-by: Lauris BH --- modules/webhook/slack.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/modules/webhook/slack.go b/modules/webhook/slack.go index 74361509d8..361e15ece5 100644 --- a/modules/webhook/slack.go +++ b/modules/webhook/slack.go @@ -232,8 +232,10 @@ func getSlackPushPayload(p *api.PushPayload, slack *SlackMeta) (*SlackPayload, e Username: slack.Username, IconURL: slack.IconURL, Attachments: []SlackAttachment{{ - Color: slack.Color, - Text: attachmentText, + Color: slack.Color, + Title: p.Repo.HTMLURL, + TitleLink: p.Repo.HTMLURL, + Text: attachmentText, }}, }, nil } @@ -289,12 +291,11 @@ func getSlackPullRequestApprovalPayload(p *api.PullRequestPayload, slack *SlackM func getSlackRepositoryPayload(p *api.RepositoryPayload, slack *SlackMeta) (*SlackPayload, error) { senderLink := SlackLinkFormatter(setting.AppURL+p.Sender.UserName, p.Sender.UserName) repoLink := SlackLinkFormatter(p.Repository.HTMLURL, p.Repository.FullName) - var text, title, attachmentText string + var text string switch p.Action { case api.HookRepoCreated: text = fmt.Sprintf("[%s] Repository created by %s", repoLink, senderLink) - title = p.Repository.HTMLURL case api.HookRepoDeleted: text = fmt.Sprintf("[%s] Repository deleted by %s", repoLink, senderLink) } @@ -304,12 +305,6 @@ func getSlackRepositoryPayload(p *api.RepositoryPayload, slack *SlackMeta) (*Sla Text: text, Username: slack.Username, IconURL: slack.IconURL, - Attachments: []SlackAttachment{{ - Color: slack.Color, - Title: title, - TitleLink: title, - Text: attachmentText, - }}, }, nil } From 0dced15c1a7f984f5a363c10853f9348c9b39aa9 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 22 Jan 2020 14:06:11 +0800 Subject: [PATCH 047/200] Fix wrong hint when status checking is running on pull request view (#9886) (#9928) * Fix wrong hint when status checking is running on pull request view * fix lint * fix test * fix test * fix wrong tmpl * fix import * rename function name --- integrations/pull_status_test.go | 25 ++++---- models/commit_status.go | 59 +++++-------------- models/commit_status_test.go | 11 ++-- modules/structs/attachment.go | 1 + modules/structs/commit_status.go | 63 +++++++++++++++++++++ routers/api/v1/repo/status.go | 18 +++--- routers/repo/pull.go | 4 +- services/pull/commit_status.go | 57 ++++++++++++++++--- templates/repo/issue/view_content/pull.tmpl | 5 +- 9 files changed, 159 insertions(+), 84 deletions(-) create mode 100644 modules/structs/commit_status.go diff --git a/integrations/pull_status_test.go b/integrations/pull_status_test.go index fde2d3cc9b..95ed755fbb 100644 --- a/integrations/pull_status_test.go +++ b/integrations/pull_status_test.go @@ -11,7 +11,6 @@ import ( "strings" "testing" - "code.gitea.io/gitea/models" api "code.gitea.io/gitea/modules/structs" "github.com/stretchr/testify/assert" @@ -48,20 +47,20 @@ func TestPullCreate_CommitStatus(t *testing.T) { commitID := path.Base(commitURL) - statusList := []models.CommitStatusState{ - models.CommitStatusPending, - models.CommitStatusError, - models.CommitStatusFailure, - models.CommitStatusWarning, - models.CommitStatusSuccess, + statusList := []api.CommitStatusState{ + api.CommitStatusPending, + api.CommitStatusError, + api.CommitStatusFailure, + api.CommitStatusWarning, + api.CommitStatusSuccess, } - statesIcons := map[models.CommitStatusState]string{ - models.CommitStatusPending: "circle icon yellow", - models.CommitStatusSuccess: "check icon green", - models.CommitStatusError: "warning icon red", - models.CommitStatusFailure: "remove icon red", - models.CommitStatusWarning: "warning sign icon yellow", + statesIcons := map[api.CommitStatusState]string{ + api.CommitStatusPending: "circle icon yellow", + api.CommitStatusSuccess: "check icon green", + api.CommitStatusError: "warning icon red", + api.CommitStatusFailure: "remove icon red", + api.CommitStatusWarning: "warning sign icon yellow", } // Update commit status, and check if icon is updated as well diff --git a/models/commit_status.go b/models/commit_status.go index 4e0f8166f3..4102e731e1 100644 --- a/models/commit_status.go +++ b/models/commit_status.go @@ -19,52 +19,19 @@ import ( "xorm.io/xorm" ) -// CommitStatusState holds the state of a Status -// It can be "pending", "success", "error", "failure", and "warning" -type CommitStatusState string - -// IsWorseThan returns true if this State is worse than the given State -func (css CommitStatusState) IsWorseThan(css2 CommitStatusState) bool { - switch css { - case CommitStatusError: - return true - case CommitStatusFailure: - return css2 != CommitStatusError - case CommitStatusWarning: - return css2 != CommitStatusError && css2 != CommitStatusFailure - case CommitStatusSuccess: - return css2 != CommitStatusError && css2 != CommitStatusFailure && css2 != CommitStatusWarning - default: - return css2 != CommitStatusError && css2 != CommitStatusFailure && css2 != CommitStatusWarning && css2 != CommitStatusSuccess - } -} - -const ( - // CommitStatusPending is for when the Status is Pending - CommitStatusPending CommitStatusState = "pending" - // CommitStatusSuccess is for when the Status is Success - CommitStatusSuccess CommitStatusState = "success" - // CommitStatusError is for when the Status is Error - CommitStatusError CommitStatusState = "error" - // CommitStatusFailure is for when the Status is Failure - CommitStatusFailure CommitStatusState = "failure" - // CommitStatusWarning is for when the Status is Warning - CommitStatusWarning CommitStatusState = "warning" -) - // CommitStatus holds a single Status of a single Commit type CommitStatus struct { - ID int64 `xorm:"pk autoincr"` - Index int64 `xorm:"INDEX UNIQUE(repo_sha_index)"` - RepoID int64 `xorm:"INDEX UNIQUE(repo_sha_index)"` - Repo *Repository `xorm:"-"` - State CommitStatusState `xorm:"VARCHAR(7) NOT NULL"` - SHA string `xorm:"VARCHAR(64) NOT NULL INDEX UNIQUE(repo_sha_index)"` - TargetURL string `xorm:"TEXT"` - Description string `xorm:"TEXT"` - ContextHash string `xorm:"char(40) index"` - Context string `xorm:"TEXT"` - Creator *User `xorm:"-"` + ID int64 `xorm:"pk autoincr"` + Index int64 `xorm:"INDEX UNIQUE(repo_sha_index)"` + RepoID int64 `xorm:"INDEX UNIQUE(repo_sha_index)"` + Repo *Repository `xorm:"-"` + State api.CommitStatusState `xorm:"VARCHAR(7) NOT NULL"` + SHA string `xorm:"VARCHAR(64) NOT NULL INDEX UNIQUE(repo_sha_index)"` + TargetURL string `xorm:"TEXT"` + Description string `xorm:"TEXT"` + ContextHash string `xorm:"char(40) index"` + Context string `xorm:"TEXT"` + Creator *User `xorm:"-"` CreatorID int64 CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` @@ -118,9 +85,9 @@ func (status *CommitStatus) APIFormat() *api.Status { // CalcCommitStatus returns commit status state via some status, the commit statues should order by id desc func CalcCommitStatus(statuses []*CommitStatus) *CommitStatus { var lastStatus *CommitStatus - var state CommitStatusState + var state api.CommitStatusState for _, status := range statuses { - if status.State.IsWorseThan(state) { + if status.State.NoBetterThan(state) { state = status.State lastStatus = status } diff --git a/models/commit_status_test.go b/models/commit_status_test.go index 97783ae6f1..90d72cd74d 100644 --- a/models/commit_status_test.go +++ b/models/commit_status_test.go @@ -7,6 +7,7 @@ package models import ( "testing" + "code.gitea.io/gitea/modules/structs" "github.com/stretchr/testify/assert" ) @@ -23,22 +24,22 @@ func TestGetCommitStatuses(t *testing.T) { assert.Len(t, statuses, 5) assert.Equal(t, "ci/awesomeness", statuses[0].Context) - assert.Equal(t, CommitStatusPending, statuses[0].State) + assert.Equal(t, structs.CommitStatusPending, statuses[0].State) assert.Equal(t, "https://try.gitea.io/api/v1/repos/user2/repo1/statuses/1234123412341234123412341234123412341234", statuses[0].APIURL()) assert.Equal(t, "cov/awesomeness", statuses[1].Context) - assert.Equal(t, CommitStatusWarning, statuses[1].State) + assert.Equal(t, structs.CommitStatusWarning, statuses[1].State) assert.Equal(t, "https://try.gitea.io/api/v1/repos/user2/repo1/statuses/1234123412341234123412341234123412341234", statuses[1].APIURL()) assert.Equal(t, "cov/awesomeness", statuses[2].Context) - assert.Equal(t, CommitStatusSuccess, statuses[2].State) + assert.Equal(t, structs.CommitStatusSuccess, statuses[2].State) assert.Equal(t, "https://try.gitea.io/api/v1/repos/user2/repo1/statuses/1234123412341234123412341234123412341234", statuses[2].APIURL()) assert.Equal(t, "ci/awesomeness", statuses[3].Context) - assert.Equal(t, CommitStatusFailure, statuses[3].State) + assert.Equal(t, structs.CommitStatusFailure, statuses[3].State) assert.Equal(t, "https://try.gitea.io/api/v1/repos/user2/repo1/statuses/1234123412341234123412341234123412341234", statuses[3].APIURL()) assert.Equal(t, "deploy/awesomeness", statuses[4].Context) - assert.Equal(t, CommitStatusError, statuses[4].State) + assert.Equal(t, structs.CommitStatusError, statuses[4].State) assert.Equal(t, "https://try.gitea.io/api/v1/repos/user2/repo1/statuses/1234123412341234123412341234123412341234", statuses[4].APIURL()) } diff --git a/modules/structs/attachment.go b/modules/structs/attachment.go index 954956f328..7becd94335 100644 --- a/modules/structs/attachment.go +++ b/modules/structs/attachment.go @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. package structs // import "code.gitea.io/gitea/modules/structs" + import ( "time" ) diff --git a/modules/structs/commit_status.go b/modules/structs/commit_status.go new file mode 100644 index 0000000000..397356b133 --- /dev/null +++ b/modules/structs/commit_status.go @@ -0,0 +1,63 @@ +// Copyright 2020 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package structs + +// CommitStatusState holds the state of a Status +// It can be "pending", "success", "error", "failure", and "warning" +type CommitStatusState string + +const ( + // CommitStatusPending is for when the Status is Pending + CommitStatusPending CommitStatusState = "pending" + // CommitStatusSuccess is for when the Status is Success + CommitStatusSuccess CommitStatusState = "success" + // CommitStatusError is for when the Status is Error + CommitStatusError CommitStatusState = "error" + // CommitStatusFailure is for when the Status is Failure + CommitStatusFailure CommitStatusState = "failure" + // CommitStatusWarning is for when the Status is Warning + CommitStatusWarning CommitStatusState = "warning" +) + +// NoBetterThan returns true if this State is no better than the given State +func (css CommitStatusState) NoBetterThan(css2 CommitStatusState) bool { + switch css { + case CommitStatusError: + return true + case CommitStatusFailure: + return css2 != CommitStatusError + case CommitStatusWarning: + return css2 != CommitStatusError && css2 != CommitStatusFailure + case CommitStatusPending: + return css2 != CommitStatusError && css2 != CommitStatusFailure && css2 != CommitStatusWarning + default: + return css2 != CommitStatusError && css2 != CommitStatusFailure && css2 != CommitStatusWarning && css2 != CommitStatusPending + } +} + +// IsPending represents if commit status state is pending +func (css CommitStatusState) IsPending() bool { + return css == CommitStatusPending +} + +// IsSuccess represents if commit status state is success +func (css CommitStatusState) IsSuccess() bool { + return css == CommitStatusSuccess +} + +// IsError represents if commit status state is error +func (css CommitStatusState) IsError() bool { + return css == CommitStatusError +} + +// IsFailure represents if commit status state is failure +func (css CommitStatusState) IsFailure() bool { + return css == CommitStatusFailure +} + +// IsWarning represents if commit status state is warning +func (css CommitStatusState) IsWarning() bool { + return css == CommitStatusWarning +} diff --git a/routers/api/v1/repo/status.go b/routers/api/v1/repo/status.go index c137b64f5c..b6b3d495ca 100644 --- a/routers/api/v1/repo/status.go +++ b/routers/api/v1/repo/status.go @@ -53,7 +53,7 @@ func NewCommitStatus(ctx *context.APIContext, form api.CreateStatusOption) { return } status := &models.CommitStatus{ - State: models.CommitStatusState(form.State), + State: api.CommitStatusState(form.State), TargetURL: form.TargetURL, Description: form.Description, Context: form.Context, @@ -220,13 +220,13 @@ func getCommitStatuses(ctx *context.APIContext, sha string) { } type combinedCommitStatus struct { - State models.CommitStatusState `json:"state"` - SHA string `json:"sha"` - TotalCount int `json:"total_count"` - Statuses []*api.Status `json:"statuses"` - Repo *api.Repository `json:"repository"` - CommitURL string `json:"commit_url"` - URL string `json:"url"` + State api.CommitStatusState `json:"state"` + SHA string `json:"sha"` + TotalCount int `json:"total_count"` + Statuses []*api.Status `json:"statuses"` + Repo *api.Repository `json:"repository"` + CommitURL string `json:"commit_url"` + URL string `json:"url"` } // GetCombinedCommitStatusByRef returns the combined status for any given commit hash @@ -293,7 +293,7 @@ func GetCombinedCommitStatusByRef(ctx *context.APIContext) { retStatus.Statuses = make([]*api.Status, 0, len(statuses)) for _, status := range statuses { retStatus.Statuses = append(retStatus.Statuses, status.APIFormat()) - if status.State.IsWorseThan(retStatus.State) { + if status.State.NoBetterThan(retStatus.State) { retStatus.State = status.State } } diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 1a5c4a036f..df6a92fb4c 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -403,7 +403,9 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.Compare } return false } - ctx.Data["IsRequiredStatusCheckSuccess"] = pull_service.IsCommitStatusContextSuccess(commitStatuses, pull.ProtectedBranch.StatusCheckContexts) + state := pull_service.MergeRequiredContextsCommitStatus(commitStatuses, pull.ProtectedBranch.StatusCheckContexts) + ctx.Data["RequiredStatusCheckState"] = state + ctx.Data["IsRequiredStatusCheckSuccess"] = state.IsSuccess() } ctx.Data["HeadBranchMovedOn"] = headBranchSha != sha diff --git a/services/pull/commit_status.go b/services/pull/commit_status.go index ca00cdaad9..3dccfb1f0c 100644 --- a/services/pull/commit_status.go +++ b/services/pull/commit_status.go @@ -8,15 +8,47 @@ package pull import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/git" + "code.gitea.io/gitea/modules/structs" + "github.com/pkg/errors" ) +// MergeRequiredContextsCommitStatus returns a commit status state for given required contexts +func MergeRequiredContextsCommitStatus(commitStatuses []*models.CommitStatus, requiredContexts []string) structs.CommitStatusState { + if len(requiredContexts) == 0 { + status := models.CalcCommitStatus(commitStatuses) + if status != nil { + return status.State + } + return structs.CommitStatusSuccess + } + + var returnedStatus = structs.CommitStatusPending + for _, ctx := range requiredContexts { + var targetStatus structs.CommitStatusState + for _, commitStatus := range commitStatuses { + if commitStatus.Context == ctx { + targetStatus = commitStatus.State + break + } + } + + if targetStatus == "" { + targetStatus = structs.CommitStatusPending + } + if targetStatus.NoBetterThan(returnedStatus) { + returnedStatus = targetStatus + } + } + return returnedStatus +} + // IsCommitStatusContextSuccess returns true if all required status check contexts succeed. func IsCommitStatusContextSuccess(commitStatuses []*models.CommitStatus, requiredContexts []string) bool { // If no specific context is required, require that last commit status is a success if len(requiredContexts) == 0 { status := models.CalcCommitStatus(commitStatuses) - if status == nil || status.State != models.CommitStatusSuccess { + if status == nil || status.State != structs.CommitStatusSuccess { return false } return true @@ -26,7 +58,7 @@ func IsCommitStatusContextSuccess(commitStatuses []*models.CommitStatus, require var found bool for _, commitStatus := range commitStatuses { if commitStatus.Context == ctx { - if commitStatus.State != models.CommitStatusSuccess { + if commitStatus.State != structs.CommitStatusSuccess { return false } @@ -50,30 +82,39 @@ func IsPullCommitStatusPass(pr *models.PullRequest) (bool, error) { return true, nil } + state, err := GetPullRequestCommitStatusState(pr) + if err != nil { + return false, err + } + return state.IsSuccess(), nil +} + +// GetPullRequestCommitStatusState returns pull request merged commit status state +func GetPullRequestCommitStatusState(pr *models.PullRequest) (structs.CommitStatusState, error) { // check if all required status checks are successful headGitRepo, err := git.OpenRepository(pr.HeadRepo.RepoPath()) if err != nil { - return false, errors.Wrap(err, "OpenRepository") + return "", errors.Wrap(err, "OpenRepository") } defer headGitRepo.Close() if !headGitRepo.IsBranchExist(pr.HeadBranch) { - return false, errors.New("Head branch does not exist, can not merge") + return "", errors.New("Head branch does not exist, can not merge") } sha, err := headGitRepo.GetBranchCommitID(pr.HeadBranch) if err != nil { - return false, errors.Wrap(err, "GetBranchCommitID") + return "", errors.Wrap(err, "GetBranchCommitID") } if err := pr.LoadBaseRepo(); err != nil { - return false, errors.Wrap(err, "LoadBaseRepo") + return "", errors.Wrap(err, "LoadBaseRepo") } commitStatuses, err := models.GetLatestCommitStatus(pr.BaseRepo, sha, 0) if err != nil { - return false, errors.Wrap(err, "GetLatestCommitStatus") + return "", errors.Wrap(err, "GetLatestCommitStatus") } - return IsCommitStatusContextSuccess(commitStatuses, pr.ProtectedBranch.StatusCheckContexts), nil + return MergeRequiredContextsCommitStatus(commitStatuses, pr.ProtectedBranch.StatusCheckContexts), nil } diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 2dc76dcf2e..72ec470249 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -42,7 +42,8 @@ {{else if .IsPullRequestBroken}}red {{else if .IsBlockedByApprovals}}red {{else if .IsBlockedByRejection}}red - {{else if and .EnableStatusCheck (not .IsRequiredStatusCheckSuccess)}}red + {{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsFailure .RequiredStatusCheckState.IsError)}}red + {{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsPending .RequiredStatusCheckState.IsWarning)}}yellow {{else if .Issue.PullRequest.IsChecking}}yellow {{else if .Issue.PullRequest.CanAutoMerge}}green {{else}}red{{end}}">
    @@ -117,7 +118,7 @@ {{$.i18n.Tr "repo.pulls.required_status_check_failed"}} {{else if .Issue.PullRequest.CanAutoMerge}} - {{if and .EnableStatusCheck (not .IsRequiredStatusCheckSuccess)}} + {{if and .EnableStatusCheck (or .RequiredStatusCheckState.IsError .RequiredStatusCheckState.IsFailure)}}
    {{$.i18n.Tr "repo.pulls.required_status_check_failed"}} From f82a8054787e3a334619b918b4e416b3d0bea47a Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Wed, 22 Jan 2020 10:02:57 +0200 Subject: [PATCH 048/200] Check if diff actually contains sections when rendering (#9926) (#9933) --- services/gitdiff/gitdiff.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/gitdiff/gitdiff.go b/services/gitdiff/gitdiff.go index b8efa8a43f..fc55c03595 100644 --- a/services/gitdiff/gitdiff.go +++ b/services/gitdiff/gitdiff.go @@ -344,7 +344,7 @@ func (diffFile *DiffFile) GetHighlightClass() string { // GetTailSection creates a fake DiffLineSection if the last section is not the end of the file func (diffFile *DiffFile) GetTailSection(gitRepo *git.Repository, leftCommitID, rightCommitID string) *DiffSection { - if diffFile.Type != DiffFileChange || diffFile.IsBin || diffFile.IsLFSFile { + if len(diffFile.Sections) == 0 || diffFile.Type != DiffFileChange || diffFile.IsBin || diffFile.IsLFSFile { return nil } leftCommit, err := gitRepo.GetCommit(leftCommitID) From 128cc34344104bfe32427a7ecc8422cd7a2918d6 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 22 Jan 2020 11:54:40 +0100 Subject: [PATCH 049/200] Fixed repo link in generated comment for cross repository dependency (#9863) (#9935) * fixed link to issue in issue comments after adding/removing a dependency, before links assumed the issue was in the same repository. also changed the format of the displayed issue since the issue will not necessarily be in the same repo * based on pr comments, changed to use HTMLURL instead of piecing together the issue url, and added an if statement around the issue link display as a nil protection * only showing repo name in dependency comment if the issue is from another repo Co-authored-by: Brad Albright <32200834+bhalbright@users.noreply.github.com> Co-authored-by: Antoine GIRARD --- models/issue_comment_list.go | 5 +++ .../repo/issue/view_content/comments.tmpl | 36 ++++++++++++++----- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/models/issue_comment_list.go b/models/issue_comment_list.go index ae2a89a01a..f8739e32a6 100644 --- a/models/issue_comment_list.go +++ b/models/issue_comment_list.go @@ -376,6 +376,11 @@ func (comments CommentList) loadDependentIssues(e Engine) error { for _, comment := range comments { if comment.DependentIssue == nil { comment.DependentIssue = issues[comment.DependentIssueID] + if comment.DependentIssue != nil { + if err := comment.DependentIssue.loadRepo(e); err != nil { + return err + } + } } } return nil diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 658494ac30..40db434dec 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -277,10 +277,20 @@ {{$.i18n.Tr "repo.issues.dependency.added_dependency" .Poster.HomeLink (.Poster.GetDisplayName|Escape) $createdStr | Safe}} - + {{if .DependentIssue}} + + {{end}}
    {{else if eq .Type 20}}
    @@ -291,10 +301,20 @@ {{$.i18n.Tr "repo.issues.dependency.removed_dependency" .Poster.HomeLink (.Poster.GetDisplayName|Escape) $createdStr | Safe}} - + {{if .DependentIssue}} + + {{end}}
    {{else if eq .Type 22}}
    From e24861a54657c8cc70094cbcfdfb3e72ad483d32 Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Wed, 22 Jan 2020 10:24:04 -0600 Subject: [PATCH 050/200] Don't convert ellipsis in markdown (#9905) (#9937) * Don't convert ellipsis Signed-off-by: jolheiser * Formatting Co-Authored-By: zeripath Co-authored-by: Lunny Xiao Co-authored-by: Antoine GIRARD Co-authored-by: zeripath Co-authored-by: Lunny Xiao Co-authored-by: Antoine GIRARD Co-authored-by: zeripath --- modules/markup/markdown/markdown.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/markup/markdown/markdown.go b/modules/markup/markdown/markdown.go index 5230fca4dc..81b5635d3b 100644 --- a/modules/markup/markdown/markdown.go +++ b/modules/markup/markdown/markdown.go @@ -48,8 +48,9 @@ func RenderRaw(body []byte, urlPrefix string, wikiMarkdown bool) []byte { common.FootnoteExtension, extension.NewTypographer( extension.WithTypographicSubstitutions(extension.TypographicSubstitutions{ - extension.EnDash: nil, - extension.EmDash: nil, + extension.EnDash: nil, + extension.EmDash: nil, + extension.Ellipsis: nil, }), ), ), From 4b688135f963a9a4b789f5e264ab6d7b4101a234 Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Wed, 22 Jan 2020 13:56:55 -0600 Subject: [PATCH 051/200] Changelog 1.11.0-rc2 (#9853) Signed-off-by: jolheiser Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lunny Xiao Co-authored-by: Antoine GIRARD Co-authored-by: techknowlogick --- CHANGELOG.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c01871c8e..add2f9a872 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,62 @@ This changelog goes through all the changes that have been made in each release without substantial changes to our git log; to see the highlights of what has been added to each release, please refer to the [blog](https://blog.gitea.io). +## [1.11.0-RC2](https://github.com/go-gitea/gitea/releases/tag/v1.11.0-rc2) - 2020-01-18 +* BREAKING + * Make CertFile and KeyFile relative to CustomPath (#9868) (#9874) +* SECURITY + * Never allow an empty password to validate (#9682) (#9683) + * Prevent redirect to Host (#9678) (#9679) +* BUGFIXES + * Don't convert ellipsis in markdown (#9905) (#9937) + * Fixed repo link in generated comment for cross repository dependency (#9863) (#9935) + * Check if diff actually contains sections when rendering (#9926) (#9933) + * Fix wrong hint when status checking is running on pull request view (#9886) (#9928) + * Fix RocketChat (#9908) (#9921) + * Do not try to recreate ldap user if they are already created (#9900) (#9919) + * Create terminated channel in queue_redis (#9910) (#9911) + * Prevent empty LDAP search result from deactivating all users (#9879) (#9896) + * Fix wrong permissions check when issues/prs shared operations (#9885) (#9889) + * Check user != nil before checking values (#9881) (#9883) + * Allow hyphen in language name (#9873) (#9880) + * Ensure that 2fa is checked on reset-password (#9857) (#9876) + * Fix issues/pulls dependencies problems (#9842) (#9864) + * Explicitly refer to PR in squash-merge commit message in case of external tracker (#9844) (#9855) + * Fix markdown anchor links (#9673) (#9840) + * Allow assignee on Pull Creation when Issue Unit is deactivated (#9836) (#9837) + * Fix download file wrong content-type (#9825) (#9834) + * Fix wrong poster identity on a migrated pull request when submit review (#9827) (#9830) + * Fix database dump when log directory is missing (#9818) (#9819) + * Fix compare (#9808) (#9814) + * Fix push-to-create (#9772) (#9797) + * Fix missing msteam webhook on organization (#9781) (#9794) + * Fix missing unlock in uniquequeue (#9790) (#9791) + * Fix add team on collaborator page when same name as organization (#9778) + * DeleteRepoFile incorrectly handles Delete to new branch (#9769) (#9775) + * Fix milestones page (#9771) + * Fix SimpleMDE quote reply (#9757) (#9768) + * Fix missing updated time on migrated issues and comments (#9744) (#9764) + * Move Errored PRs out of StatusChecking (#9675) (#9726) + * Make hook status printing configurable with delay (#9641) (#9725) + * ​Fix /repos​/issues​/search (#9698) (#9724) + * Silence fomantic error regarding tabs (#9713) (#9718) + * Remove unused lock (#9709) (#9710) + * Remove q.lock.Unlock() in setInternal to prevent panic (#9705) (#9706) + * Load milestone in API PR list (#9671) (#9700) + * Don't attempt to close issue if already closed (#9696) (#9699) + * Remove google font call (#9668) (#9681) + * Eliminate horizontal scroll caused by footer (#9674) + * Fix nil reference in repo generation (#9660) (#9666) + * Add HTML URL to API Issues (#9654) (#9661) + * Add PR review webhook to Telegram (#9653) (#9655) + * Use filepath.IsAbs instead of path.IsAbs (#9651) (#9652) +* TRANSLATION + * Fix Korean locales (#9761) (#9780) +* BUILD + * Fix webpack polyfills (#9735) (#9738) +* MISC + * Backport Locales [2020-01-14] (#9773) + ## [1.11.0-RC1](https://github.com/go-gitea/gitea/releases/tag/v1.11.0-rc1) - 2020-01-07 * BREAKING * Remove unused endpoints (#9538) @@ -1501,13 +1557,13 @@ been added to each release, please refer to the [blog](https://blog.gitea.io). * BUGFIXES * Allow resend of confirmation email when logged in (#6482) (#6487) -## [1.7.5](https://github.com/go-gitea/gitea/releases/tag/v1.7.5) - 2019-03-27 +## [1.7.5](https://github.com/go-gitea/gitea/releases/tag/v1.7.5) - 2019-03-27 * BUGFIXES * Fix unitTypeCode not being used in accessLevelUnit (#6419) (#6423) * Fix bug where manifest.json was being requested without cookies and continuously creating new sessions (#6372) (#6383) * Fix ParsePatch function to work with quoted diff --git strings (#6323) (#6332) -## [1.7.4](https://github.com/go-gitea/gitea/releases/tag/v1.7.4) - 2019-03-12 +## [1.7.4](https://github.com/go-gitea/gitea/releases/tag/v1.7.4) - 2019-03-12 * SECURITY * Fix potential XSS vulnerability in repository description. (#6306) (#6308) * BUGFIXES From ef8f6d99f1b4534b398c3e9e304add87f6131519 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Wed, 22 Jan 2020 15:49:08 -0500 Subject: [PATCH 052/200] Fix regression with tag test running (#9941) --- .drone.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.drone.yml b/.drone.yml index 422319cfe0..a18ef1879a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -114,6 +114,12 @@ steps: GOSUMDB: sum.golang.org TAGS: bindata sqlite sqlite_unlock_notify + - name: tag-pre-condition + pull: always + image: alpine/git + commands: + - git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA} + - name: unit-test pull: always image: golang:1.13 From 16fc15ae6ade99367a448e021380d90374838766 Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Fri, 24 Jan 2020 20:25:00 -0300 Subject: [PATCH 053/200] Fix file rename/copy not supported by indexer (#9967) --- modules/indexer/code/git.go | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/modules/indexer/code/git.go b/modules/indexer/code/git.go index bfa7d20438..114d5a9e6d 100644 --- a/modules/indexer/code/git.go +++ b/modules/indexer/code/git.go @@ -116,7 +116,12 @@ func nonGenesisChanges(repo *models.Repository, revision string) (*repoChanges, if len(line) == 0 { continue } - filename := strings.TrimSpace(line[1:]) + fields := strings.Split(line, "\t") + if len(fields) < 2 { + log.Warn("Unparseable output for diff --name-status: `%s`)", line) + continue + } + filename := fields[1] if len(filename) == 0 { continue } else if filename[0] == '"' { @@ -126,11 +131,31 @@ func nonGenesisChanges(repo *models.Repository, revision string) (*repoChanges, } } - switch status := line[0]; status { + switch status := fields[0][0]; status { case 'M', 'A': updatedFilenames = append(updatedFilenames, filename) case 'D': changes.RemovedFilenames = append(changes.RemovedFilenames, filename) + case 'R', 'C': + if len(fields) < 3 { + log.Warn("Unparseable output for diff --name-status: `%s`)", line) + continue + } + dest := fields[2] + if len(dest) == 0 { + log.Warn("Unparseable output for diff --name-status: `%s`)", line) + continue + } + if dest[0] == '"' { + dest, err = strconv.Unquote(dest) + if err != nil { + return nil, err + } + } + if status == 'R' { + changes.RemovedFilenames = append(changes.RemovedFilenames, filename) + } + updatedFilenames = append(updatedFilenames, dest) default: log.Warn("Unrecognized status: %c (line=%s)", status, line) } From 60f91d56f0f723a02e5f1bc9a02dcb094632c00d Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Fri, 24 Jan 2020 21:56:30 -0300 Subject: [PATCH 054/200] Fix check for push on default branch (#9963) Co-authored-by: techknowlogick --- modules/notification/indexer/indexer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/notification/indexer/indexer.go b/modules/notification/indexer/indexer.go index 4ca5e64c3e..70ad44483b 100644 --- a/modules/notification/indexer/indexer.go +++ b/modules/notification/indexer/indexer.go @@ -6,6 +6,7 @@ package indexer import ( "code.gitea.io/gitea/models" + "code.gitea.io/gitea/modules/git" code_indexer "code.gitea.io/gitea/modules/indexer/code" issue_indexer "code.gitea.io/gitea/modules/indexer/issues" "code.gitea.io/gitea/modules/log" @@ -118,7 +119,7 @@ func (r *indexerNotifier) NotifyMigrateRepository(doer *models.User, u *models.U } func (r *indexerNotifier) NotifyPushCommits(pusher *models.User, repo *models.Repository, refName, oldCommitID, newCommitID string, commits *models.PushCommits) { - if setting.Indexer.RepoIndexerEnabled && refName == repo.DefaultBranch { + if setting.Indexer.RepoIndexerEnabled && refName == git.BranchPrefix+repo.DefaultBranch { code_indexer.UpdateRepoIndexer(repo) } } From 043febdbc9d4b55b4b9bbd846ef1d04c9d03f1a3 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Fri, 24 Jan 2020 20:45:53 -0500 Subject: [PATCH 055/200] Switch to use -f instead of -F for sendmail (#9961) (#9970) Fix #9385 Co-authored-by: zeripath --- services/mailer/mailer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/mailer/mailer.go b/services/mailer/mailer.go index 2e4aa8d71b..0eb4a38e59 100644 --- a/services/mailer/mailer.go +++ b/services/mailer/mailer.go @@ -213,7 +213,7 @@ func (s *sendmailSender) Send(from string, to []string, msg io.WriterTo) error { var closeError error var waitError error - args := []string{"-F", from, "-i"} + args := []string{"-f", from, "-i"} args = append(args, setting.MailService.SendmailArgs...) args = append(args, to...) log.Trace("Sending with: %s %v", setting.MailService.SendmailPath, args) From 16f7b43903f9d63c6a053ed22b7ab59bd5381143 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 25 Jan 2020 17:39:53 +0800 Subject: [PATCH 056/200] Fix pull view when head repository or head branch missed and close related pull requests when delete head repository or head branch (#9927) (#9974) * fix pull view when head repository or head branch missed and close related pull requests when delete branch * fix pull view broken when head repository deleted * close pull requests when head repositories deleted * Add tests for broken pull request head repository or branch * fix typo * ignore special error when close pull request Co-authored-by: Lauris BH Co-authored-by: Lauris BH --- integrations/pull_create_test.go | 54 ++++++++++++++++++++++ models/pull.go | 6 ++- modules/repofiles/update.go | 24 +++++++--- services/pull/pull.go | 77 +++++++++++++++++++++++++++++++ services/repository/repository.go | 5 ++ 5 files changed, 159 insertions(+), 7 deletions(-) diff --git a/integrations/pull_create_test.go b/integrations/pull_create_test.go index 84bcbff0dc..d0c78a046c 100644 --- a/integrations/pull_create_test.go +++ b/integrations/pull_create_test.go @@ -106,3 +106,57 @@ func TestPullCreate_TitleEscape(t *testing.T) { assert.Equal(t, "<u>XSS PR</u>", titleHTML) }) } + +func testUIDeleteBranch(t *testing.T, session *TestSession, ownerName, repoName, branchName string) { + relURL := "/" + path.Join(ownerName, repoName, "branches") + req := NewRequest(t, "GET", relURL) + resp := session.MakeRequest(t, req, http.StatusOK) + htmlDoc := NewHTMLParser(t, resp.Body) + + req = NewRequestWithValues(t, "POST", relURL+"/delete", map[string]string{ + "_csrf": getCsrf(t, htmlDoc.doc), + "name": branchName, + }) + session.MakeRequest(t, req, http.StatusOK) +} + +func testDeleteRepository(t *testing.T, session *TestSession, ownerName, repoName string) { + relURL := "/" + path.Join(ownerName, repoName, "settings") + req := NewRequest(t, "GET", relURL) + resp := session.MakeRequest(t, req, http.StatusOK) + htmlDoc := NewHTMLParser(t, resp.Body) + + req = NewRequestWithValues(t, "POST", relURL+"?action=delete", map[string]string{ + "_csrf": getCsrf(t, htmlDoc.doc), + "repo_name": repoName, + }) + session.MakeRequest(t, req, http.StatusFound) +} + +func TestPullBranchDelete(t *testing.T) { + onGiteaRun(t, func(t *testing.T, u *url.URL) { + defer prepareTestEnv(t)() + + session := loginUser(t, "user1") + testRepoFork(t, session, "user2", "repo1", "user1", "repo1") + testCreateBranch(t, session, "user1", "repo1", "branch/master", "master1", http.StatusFound) + testEditFile(t, session, "user1", "repo1", "master1", "README.md", "Hello, World (Edited)\n") + resp := testPullCreate(t, session, "user1", "repo1", "master1", "This is a pull title") + + // check the redirected URL + url := resp.HeaderMap.Get("Location") + assert.Regexp(t, "^/user2/repo1/pulls/[0-9]*$", url) + req := NewRequest(t, "GET", url) + session.MakeRequest(t, req, http.StatusOK) + + // delete head branch and confirm pull page is ok + testUIDeleteBranch(t, session, "user1", "repo1", "master1") + req = NewRequest(t, "GET", url) + session.MakeRequest(t, req, http.StatusOK) + + // delete head repository and confirm pull page is ok + testDeleteRepository(t, session, "user1", "repo1") + req = NewRequest(t, "GET", url) + session.MakeRequest(t, req, http.StatusOK) + }) +} diff --git a/models/pull.go b/models/pull.go index 870a0960df..c39ceb6165 100644 --- a/models/pull.go +++ b/models/pull.go @@ -68,7 +68,11 @@ type PullRequest struct { // MustHeadUserName returns the HeadRepo's username if failed return blank func (pr *PullRequest) MustHeadUserName() string { if err := pr.LoadHeadRepo(); err != nil { - log.Error("LoadHeadRepo: %v", err) + if !IsErrRepoNotExist(err) { + log.Error("LoadHeadRepo: %v", err) + } else { + log.Warn("LoadHeadRepo %d but repository does not exist: %v", pr.HeadRepoID, err) + } return "" } return pr.HeadRepo.MustOwnerName() diff --git a/modules/repofiles/update.go b/modules/repofiles/update.go index 19c3d5b51c..32a5c5297b 100644 --- a/modules/repofiles/update.go +++ b/modules/repofiles/update.go @@ -475,9 +475,18 @@ func PushUpdate(repo *models.Repository, branch string, opts PushUpdateOptions) return err } - log.Trace("TriggerTask '%s/%s' by %s", repo.Name, branch, pusher.Name) + if !isDelRef { + if err = models.RemoveDeletedBranch(repo.ID, opts.Branch); err != nil { + log.Error("models.RemoveDeletedBranch %s/%s failed: %v", repo.ID, opts.Branch, err) + } - go pull_service.AddTestPullRequestTask(pusher, repo.ID, branch, true) + log.Trace("TriggerTask '%s/%s' by %s", repo.Name, branch, pusher.Name) + + go pull_service.AddTestPullRequestTask(pusher, repo.ID, branch, true) + // close all related pulls + } else if err = pull_service.CloseBranchPulls(pusher, repo.ID, branch); err != nil { + log.Error("close related pull request failed: %v", err) + } if err = models.WatchIfAuto(opts.PusherID, repo.ID, true); err != nil { log.Warn("Fail to perform auto watch on user %v for repo %v: %v", opts.PusherID, repo.ID, err) @@ -524,12 +533,15 @@ func PushUpdates(repo *models.Repository, optsList []*PushUpdateOptions) error { if err = models.RemoveDeletedBranch(repo.ID, opts.Branch); err != nil { log.Error("models.RemoveDeletedBranch %s/%s failed: %v", repo.ID, opts.Branch, err) } + + log.Trace("TriggerTask '%s/%s' by %s", repo.Name, opts.Branch, pusher.Name) + + go pull_service.AddTestPullRequestTask(pusher, repo.ID, opts.Branch, true) + // close all related pulls + } else if err = pull_service.CloseBranchPulls(pusher, repo.ID, opts.Branch); err != nil { + log.Error("close related pull request failed: %v", err) } - log.Trace("TriggerTask '%s/%s' by %s", repo.Name, opts.Branch, pusher.Name) - - go pull_service.AddTestPullRequestTask(pusher, repo.ID, opts.Branch, true) - if err = models.WatchIfAuto(opts.PusherID, repo.ID, true); err != nil { log.Warn("Fail to perform auto watch on user %v for repo %v: %v", opts.PusherID, repo.ID, err) } diff --git a/services/pull/pull.go b/services/pull/pull.go index 6be9c2da17..b6f6d2a777 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -9,6 +9,7 @@ import ( "fmt" "os" "path" + "strings" "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/git" @@ -261,3 +262,79 @@ func PushToBaseRepo(pr *models.PullRequest) (err error) { return nil } + +type errlist []error + +func (errs errlist) Error() string { + if len(errs) > 0 { + var buf strings.Builder + for i, err := range errs { + if i > 0 { + buf.WriteString(", ") + } + buf.WriteString(err.Error()) + } + return buf.String() + } + return "" +} + +// CloseBranchPulls close all the pull requests who's head branch is the branch +func CloseBranchPulls(doer *models.User, repoID int64, branch string) error { + prs, err := models.GetUnmergedPullRequestsByHeadInfo(repoID, branch) + if err != nil { + return err + } + + prs2, err := models.GetUnmergedPullRequestsByBaseInfo(repoID, branch) + if err != nil { + return err + } + + prs = append(prs, prs2...) + if err := models.PullRequestList(prs).LoadAttributes(); err != nil { + return err + } + + var errs errlist + for _, pr := range prs { + if err = issue_service.ChangeStatus(pr.Issue, doer, true); err != nil && !models.IsErrIssueWasClosed(err) { + errs = append(errs, err) + } + } + if len(errs) > 0 { + return errs + } + return nil +} + +// CloseRepoBranchesPulls close all pull requests which head branches are in the given repository +func CloseRepoBranchesPulls(doer *models.User, repo *models.Repository) error { + branches, err := git.GetBranchesByPath(repo.RepoPath()) + if err != nil { + return err + } + + var errs errlist + for _, branch := range branches { + prs, err := models.GetUnmergedPullRequestsByHeadInfo(repo.ID, branch.Name) + if err != nil { + return err + } + + if err = models.PullRequestList(prs).LoadAttributes(); err != nil { + return err + } + + for _, pr := range prs { + if err = issue_service.ChangeStatus(pr.Issue, doer, true); err != nil && !models.IsErrIssueWasClosed(err) { + errs = append(errs, err) + } + } + } + + if len(errs) > 0 { + return errs + } + return nil +} diff --git a/services/repository/repository.go b/services/repository/repository.go index 2fb45bb617..1a3f1a0c98 100644 --- a/services/repository/repository.go +++ b/services/repository/repository.go @@ -10,6 +10,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/notification" + pull_service "code.gitea.io/gitea/services/pull" ) // CreateRepository creates a repository for the user/organization. @@ -48,6 +49,10 @@ func ForkRepository(doer, u *models.User, oldRepo *models.Repository, name, desc // DeleteRepository deletes a repository for a user or organization. func DeleteRepository(doer *models.User, repo *models.Repository) error { + if err := pull_service.CloseRepoBranchesPulls(doer, repo); err != nil { + log.Error("CloseRepoBranchesPulls failed: %v", err) + } + if err := models.DeleteRepository(doer, repo.OwnerID, repo.ID); err != nil { return err } From 16dfd9ffbe5d9653d75997303d88872462f10bfe Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 26 Jan 2020 16:16:53 +0800 Subject: [PATCH 057/200] Sanitize credentials in mirror form (#9975) (#9991) --- models/repo.go | 8 ++++++++ modules/util/sanitize.go | 3 +++ modules/util/sanitize_test.go | 25 +++++++++++++++++++++++++ templates/repo/header.tmpl | 2 +- 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 modules/util/sanitize_test.go diff --git a/models/repo.go b/models/repo.go index 0dbdcc11b5..3071c11f32 100644 --- a/models/repo.go +++ b/models/repo.go @@ -204,6 +204,14 @@ type Repository struct { UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` } +// SanitizedOriginalURL returns a sanitized OriginalURL +func (repo *Repository) SanitizedOriginalURL() string { + if repo.OriginalURL == "" { + return "" + } + return util.SanitizeURLCredentials(repo.OriginalURL, false) +} + // ColorFormat returns a colored string to represent this repo func (repo *Repository) ColorFormat(s fmt.State) { var ownerName interface{} diff --git a/modules/util/sanitize.go b/modules/util/sanitize.go index b1c17b29cf..d04e1dee77 100644 --- a/modules/util/sanitize.go +++ b/modules/util/sanitize.go @@ -7,6 +7,8 @@ package util import ( "net/url" "strings" + + "code.gitea.io/gitea/modules/log" ) // urlSafeError wraps an error whose message may contain a sensitive URL @@ -36,6 +38,7 @@ func SanitizeMessage(message, unsanitizedURL string) string { func SanitizeURLCredentials(unsanitizedURL string, usePlaceholder bool) string { u, err := url.Parse(unsanitizedURL) if err != nil { + log.Error("parse url %s failed: %v", unsanitizedURL, err) // don't log the error, since it might contain unsanitized URL. return "(unparsable url)" } diff --git a/modules/util/sanitize_test.go b/modules/util/sanitize_test.go new file mode 100644 index 0000000000..4f07100675 --- /dev/null +++ b/modules/util/sanitize_test.go @@ -0,0 +1,25 @@ +// Copyright 2020 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package util + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestSanitizeURLCredentials(t *testing.T) { + var kases = map[string]string{ + "https://github.com/go-gitea/test_repo.git": "https://github.com/go-gitea/test_repo.git", + "https://mytoken@github.com/go-gitea/test_repo.git": "https://github.com/go-gitea/test_repo.git", + "http://github.com/go-gitea/test_repo.git": "http://github.com/go-gitea/test_repo.git", + "/test/repos/repo1": "/test/repos/repo1", + "git@github.com:go-gitea/test_repo.git": "(unparsable url)", + } + + for source, value := range kases { + assert.EqualValues(t, value, SanitizeURLCredentials(source, false)) + } +} diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index b1b31183c4..b3757b2764 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -14,7 +14,7 @@ {{if and .RelAvatarLink .IsPrivate}}{{end}} {{if .IsTemplate}}{{end}} {{if .IsArchived}}{{end}} - {{if .IsMirror}}
    {{$.i18n.Tr "repo.mirror_from"}} {{MirrorAddress $.Mirror}}
    {{end}} + {{if .IsMirror}}{{end}} {{if .IsFork}}
    {{$.i18n.Tr "repo.forked_from"}} {{SubStr .BaseRepo.RelLink 1 -1}}
    {{end}} {{if .IsGenerated}}
    {{$.i18n.Tr "repo.generated_from"}} {{SubStr .TemplateRepo.RelLink 1 -1}}
    {{end}}
    From 315026c2c55e8aa0dae21995eda35325fe273f0d Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 28 Jan 2020 09:52:24 +0100 Subject: [PATCH 058/200] trim whitespace of MilestoneName at creation/rename (#10017) (#10034) --- models/issue_milestone.go | 4 ++++ models/issue_milestone_test.go | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/models/issue_milestone.go b/models/issue_milestone.go index f33ad19ada..38338e9bee 100644 --- a/models/issue_milestone.go +++ b/models/issue_milestone.go @@ -6,6 +6,7 @@ package models import ( "fmt" + "strings" "code.gitea.io/gitea/modules/setting" api "code.gitea.io/gitea/modules/structs" @@ -95,6 +96,8 @@ func NewMilestone(m *Milestone) (err error) { return err } + m.Name = strings.TrimSpace(m.Name) + if _, err = sess.Insert(m); err != nil { return err } @@ -268,6 +271,7 @@ func GetMilestones(repoID int64, page int, isClosed bool, sortType string) (Mile } func updateMilestone(e Engine, m *Milestone) error { + m.Name = strings.TrimSpace(m.Name) _, err := e.ID(m.ID).AllCols(). SetExpr("num_issues", builder.Select("count(*)").From("issue").Where( builder.Eq{"milestone_id": m.ID}, diff --git a/models/issue_milestone_test.go b/models/issue_milestone_test.go index 5b7d19aa4d..00db3a907e 100644 --- a/models/issue_milestone_test.go +++ b/models/issue_milestone_test.go @@ -158,10 +158,11 @@ func TestUpdateMilestone(t *testing.T) { assert.NoError(t, PrepareTestDatabase()) milestone := AssertExistsAndLoadBean(t, &Milestone{ID: 1}).(*Milestone) - milestone.Name = "newMilestoneName" + milestone.Name = " newMilestoneName " milestone.Content = "newMilestoneContent" assert.NoError(t, UpdateMilestone(milestone)) - AssertExistsAndLoadBean(t, milestone) + milestone = AssertExistsAndLoadBean(t, &Milestone{ID: 1}).(*Milestone) + assert.EqualValues(t, "newMilestoneName", milestone.Name) CheckConsistencyFor(t, &Milestone{}) } From 1e73dd2446ba32fa072c22b933ed641cdf83faee Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 28 Jan 2020 23:10:25 +0800 Subject: [PATCH 059/200] Fix wiki raw view on sub path (#10002) (#10040) * Fix wiki raw view on sub path * Add test for subpath wiki raw file * Fix bug --- .../42/3313fbd38093bb10d0c8387db9105409c6f196 | Bin 0 -> 830 bytes .../74/d5a0d73db9b9ef7aa9978eb7a099b08f54d45e | Bin 0 -> 53 bytes .../c4/b38c3e1395393f75bbbc2ed10c7eeb577d3b64 | Bin 0 -> 189 bytes .../user2/repo1.wiki.git/refs/heads/master | 2 +- routers/repo/wiki.go | 28 +++++++----------- routers/repo/wiki_test.go | 1 + 6 files changed, 12 insertions(+), 19 deletions(-) create mode 100644 integrations/gitea-repositories-meta/user2/repo1.wiki.git/objects/42/3313fbd38093bb10d0c8387db9105409c6f196 create mode 100644 integrations/gitea-repositories-meta/user2/repo1.wiki.git/objects/74/d5a0d73db9b9ef7aa9978eb7a099b08f54d45e create mode 100644 integrations/gitea-repositories-meta/user2/repo1.wiki.git/objects/c4/b38c3e1395393f75bbbc2ed10c7eeb577d3b64 diff --git a/integrations/gitea-repositories-meta/user2/repo1.wiki.git/objects/42/3313fbd38093bb10d0c8387db9105409c6f196 b/integrations/gitea-repositories-meta/user2/repo1.wiki.git/objects/42/3313fbd38093bb10d0c8387db9105409c6f196 new file mode 100644 index 0000000000000000000000000000000000000000..bf4ae859f6d05b74726565e3269517d32a6fd1aa GIT binary patch literal 830 zcmV-E1Ht@w0iBb{4y#5GMYHBBdXExD8<6s%fX!qZ493{t9dtMIWCk;Q{c{p!msM(U zRXVDYN>_DZTi5vr7+Ms68GDQYb89M zZ|dKi00hWgb5mqlImj~7a#fw`m`x-|L9GbX(K2TtIq9tRfqbjU6+iiHD<9I*{g)G8 z=enUuDe>^SYAf&KIW=I`ltB|F6nu&btD;rwk`xzxChes)B41oA-cFvONDJyu1fZDX z^$9n44<3WDj;Vdq8H(OAwTP$pedOjnHrHGpHq(`3j(=WQv`KXlC>O1DwD&}S2Z<(2 zkjX;RTaL+c&tR0+`?y79cm2QST(~azM7+#vyZUUcmrMP;fX%UcPy?l}^mnoh;;T{8GMZQTy66N@^7*ZPGxNq6oKw$6l8dwsB};kv2a!>es-nT7_NWd_p8DBR<@j-h#U-NRf1=s_XIeYx8p#C{rQ?#?>jXv zr&r#aN&tf)z(MYnw12TtW4hyn{j?3&{7{s0dF87p@26fNfN(6r&pI0;yXh&SE%ifb zg=EhAcA-;5jY?mgpFYi18+*2yk9@igPUm{NJ1S>kf4mbweb5%lyYIL14r|zCn2?T~ zAjfCzo5MFo({F(&P(rWzqL-DV`)Yp>;76xy2Jug3RQvc}i6J6{z%a#KG-e>LqZALs IPp$}Hf}a9V=y!@Ff%bx$SO!p*UKtMXDFN~{iQwaxP++0L3U0-#`(J$ LHvRzsDiRKo_5~D3 literal 0 HcmV?d00001 diff --git a/integrations/gitea-repositories-meta/user2/repo1.wiki.git/objects/c4/b38c3e1395393f75bbbc2ed10c7eeb577d3b64 b/integrations/gitea-repositories-meta/user2/repo1.wiki.git/objects/c4/b38c3e1395393f75bbbc2ed10c7eeb577d3b64 new file mode 100644 index 0000000000000000000000000000000000000000..6dcfc9667644d517a48b0b24e3c975afe97bb4cb GIT binary patch literal 189 zcmV;u07CzG0V^p=O;s>5Fk&z?FfcPQQSivmP1VayVR+T_r@efUH~XP%EAKClN_3cu z?N&pT1SF=X>V{{QWaxV40+}GyMzKeJyfpDk%lIT}wrp;^tlw3e#TcrC3lfu4Q*`|j zAvP5KNeVoZ(l^mZfMKqov;3mR-Ln)-41ho(6J%^LL&? Date: Tue, 28 Jan 2020 18:46:59 +0000 Subject: [PATCH 060/200] PRs: Move to use a temporary repo for pushing new prs (#10009) (#10042) * Move to use a temporary repo for pushing new prs --- services/pull/pull.go | 44 +++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/services/pull/pull.go b/services/pull/pull.go index b6f6d2a777..347fe077a6 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -218,23 +218,39 @@ func AddTestPullRequestTask(doer *models.User, repoID int64, branch string, isSy func PushToBaseRepo(pr *models.PullRequest) (err error) { log.Trace("PushToBaseRepo[%d]: pushing commits to base repo '%s'", pr.BaseRepoID, pr.GetGitRefName()) + // Clone base repo. + tmpBasePath, err := models.CreateTemporaryPath("pull") + if err != nil { + log.Error("CreateTemporaryPath: %v", err) + return err + } + defer func() { + err := models.RemoveTemporaryPath(tmpBasePath) + if err != nil { + log.Error("Error whilst removing temporary path: %s Error: %v", tmpBasePath, err) + } + }() + headRepoPath := pr.HeadRepo.RepoPath() - headGitRepo, err := git.OpenRepository(headRepoPath) + + if err := git.Clone(headRepoPath, tmpBasePath, git.CloneRepoOptions{ + Bare: true, + Shared: true, + Branch: pr.HeadBranch, + Quiet: true, + }); err != nil { + log.Error("git clone tmpBasePath: %v", err) + return err + } + gitRepo, err := git.OpenRepository(tmpBasePath) if err != nil { return fmt.Errorf("OpenRepository: %v", err) } - defer headGitRepo.Close() - tmpRemoteName := fmt.Sprintf("tmp-pull-%d", pr.ID) - if err = headGitRepo.AddRemote(tmpRemoteName, pr.BaseRepo.RepoPath(), false); err != nil { - return fmt.Errorf("headGitRepo.AddRemote: %v", err) + if err := gitRepo.AddRemote("base", pr.BaseRepo.RepoPath(), false); err != nil { + return fmt.Errorf("tmpGitRepo.AddRemote: %v", err) } - // Make sure to remove the remote even if the push fails - defer func() { - if err := headGitRepo.RemoveRemote(tmpRemoteName); err != nil { - log.Error("PushToBaseRepo: RemoveRemote: %s", err) - } - }() + defer gitRepo.Close() headFile := pr.GetGitRefName() @@ -250,14 +266,14 @@ func PushToBaseRepo(pr *models.PullRequest) (err error) { return fmt.Errorf("unable to load poster %d for pr %d: %v", pr.Issue.PosterID, pr.ID, err) } - if err = git.Push(headRepoPath, git.PushOptions{ - Remote: tmpRemoteName, + if err = git.Push(tmpBasePath, git.PushOptions{ + Remote: "base", Branch: fmt.Sprintf("%s:%s", pr.HeadBranch, headFile), Force: true, // Use InternalPushingEnvironment here because we know that pre-receive and post-receive do not run on a refs/pulls/... Env: models.InternalPushingEnvironment(pr.Issue.Poster, pr.BaseRepo), }); err != nil { - return fmt.Errorf("Push: %v", err) + return fmt.Errorf("Push: %s:%s %s:%s %v", pr.HeadRepo.FullName(), pr.HeadBranch, pr.BaseRepo.FullName(), headFile, err) } return nil From 895d92ffe5fa31cfe97d0b3b822874b5993c7981 Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 28 Jan 2020 21:54:09 +0000 Subject: [PATCH 061/200] Ensure that feeds are appropriately restricted (#10018) (#10019) * Ensure that feeds are appropriately restricted * Placate golangci-lint --- models/action.go | 2 ++ models/repo_list.go | 17 +++++++++++++++++ routers/user/home.go | 14 ++++++++++---- routers/user/profile.go | 12 +++++++++--- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/models/action.go b/models/action.go index dd642c6c1f..3bc88f0063 100644 --- a/models/action.go +++ b/models/action.go @@ -432,6 +432,8 @@ func GetFeeds(opts GetFeedsOptions) ([]*Action, error) { } cond = cond.And(builder.In("repo_id", repoIDs)) + } else { + cond = cond.And(builder.In("repo_id", AccessibleRepoIDsQuery(opts.RequestingUserID))) } cond = cond.And(builder.Eq{"user_id": opts.RequestedUser.ID}) diff --git a/models/repo_list.go b/models/repo_list.go index 7b48834dba..1dd5cf2f06 100644 --- a/models/repo_list.go +++ b/models/repo_list.go @@ -315,6 +315,17 @@ func SearchRepository(opts *SearchRepoOptions) (RepositoryList, int64, error) { // accessibleRepositoryCondition takes a user a returns a condition for checking if a repository is accessible func accessibleRepositoryCondition(userID int64) builder.Cond { + if userID <= 0 { + return builder.And( + builder.Eq{"`repository`.is_private": false}, + builder.Or( + // A. Aren't in organisations __OR__ + builder.NotIn("`repository`.owner_id", builder.Select("id").From("`user`").Where(builder.Eq{"type": UserTypeOrganization})), + // B. Is a public organisation. + builder.In("`repository`.owner_id", builder.Select("id").From("`user`").Where(builder.Eq{"visibility": structs.VisibleTypePublic}))), + ) + } + return builder.Or( // 1. Be able to see all non-private repositories that either: builder.And( @@ -349,6 +360,12 @@ func SearchRepositoryByName(opts *SearchRepoOptions) (RepositoryList, int64, err return SearchRepository(opts) } +// AccessibleRepoIDsQuery queries accessible repository ids. Usable as a subquery wherever repo ids need to be filtered. +func AccessibleRepoIDsQuery(userID int64) *builder.Builder { + // NB: Please note this code needs to still work if user is nil + return builder.Select("id").From("repository").Where(accessibleRepositoryCondition(userID)) +} + // FindUserAccessibleRepoIDs find all accessible repositories' ID by user's id func FindUserAccessibleRepoIDs(userID int64) ([]int64, error) { var accessCond builder.Cond = builder.Eq{"is_private": false} diff --git a/routers/user/home.go b/routers/user/home.go index 512c60716d..ff77bd0032 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -142,11 +142,17 @@ func Dashboard(ctx *context.Context) { ctx.Data["MirrorCount"] = len(mirrors) ctx.Data["Mirrors"] = mirrors + requestingUserID := int64(0) + if ctx.User != nil { + requestingUserID = ctx.User.ID + } + retrieveFeeds(ctx, models.GetFeedsOptions{ - RequestedUser: ctxUser, - IncludePrivate: true, - OnlyPerformedBy: false, - IncludeDeleted: false, + RequestedUser: ctxUser, + RequestingUserID: requestingUserID, + IncludePrivate: true, + OnlyPerformedBy: false, + IncludeDeleted: false, }) if ctx.Written() { diff --git a/routers/user/profile.go b/routers/user/profile.go index 90e832b530..fd29a17622 100644 --- a/routers/user/profile.go +++ b/routers/user/profile.go @@ -156,14 +156,20 @@ func Profile(ctx *context.Context) { orderBy = models.SearchOrderByRecentUpdated } + requestingUserID := int64(0) + if ctx.User != nil { + requestingUserID = ctx.User.ID + } + keyword := strings.Trim(ctx.Query("q"), " ") ctx.Data["Keyword"] = keyword switch tab { case "activity": retrieveFeeds(ctx, models.GetFeedsOptions{RequestedUser: ctxUser, - IncludePrivate: showPrivate, - OnlyPerformedBy: true, - IncludeDeleted: false, + RequestingUserID: requestingUserID, + IncludePrivate: showPrivate, + OnlyPerformedBy: true, + IncludeDeleted: false, }) if ctx.Written() { return From 491cbeca678eef5b55154b85958a72576a95ac39 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 30 Jan 2020 00:01:44 +0800 Subject: [PATCH 062/200] Fix milestone API state parameter unhandled (#10049) (#10052) * Fix milestone API state parameter unhandled * Fix test --- integrations/api_issue_milestone_test.go | 47 ++++++++++++++++++++++++ models/issue_milestone.go | 27 ++++++++++++-- models/issue_milestone_test.go | 2 +- routers/api/v1/repo/milestone.go | 7 +++- routers/repo/milestone.go | 2 +- 5 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 integrations/api_issue_milestone_test.go diff --git a/integrations/api_issue_milestone_test.go b/integrations/api_issue_milestone_test.go new file mode 100644 index 0000000000..35e5053cba --- /dev/null +++ b/integrations/api_issue_milestone_test.go @@ -0,0 +1,47 @@ +// Copyright 2020 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package integrations + +import ( + "fmt" + "net/http" + "testing" + + "code.gitea.io/gitea/models" + "code.gitea.io/gitea/modules/structs" + + "github.com/stretchr/testify/assert" +) + +func TestAPIIssuesMilestone(t *testing.T) { + defer prepareTestEnv(t)() + + milestone := models.AssertExistsAndLoadBean(t, &models.Milestone{ID: 1}).(*models.Milestone) + repo := models.AssertExistsAndLoadBean(t, &models.Repository{ID: milestone.RepoID}).(*models.Repository) + owner := models.AssertExistsAndLoadBean(t, &models.User{ID: repo.OwnerID}).(*models.User) + assert.Equal(t, int64(1), int64(milestone.NumIssues)) + assert.Equal(t, structs.StateOpen, milestone.State()) + + session := loginUser(t, owner.Name) + token := getTokenForLoggedInUser(t, session) + + // update values of issue + milestoneState := "closed" + + urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/milestones/%d?token=%s", owner.Name, repo.Name, milestone.ID, token) + req := NewRequestWithJSON(t, "PATCH", urlStr, structs.EditMilestoneOption{ + State: &milestoneState, + }) + resp := session.MakeRequest(t, req, http.StatusOK) + var apiMilestone structs.Milestone + DecodeJSON(t, resp, &apiMilestone) + assert.EqualValues(t, "closed", apiMilestone.State) + + req = NewRequest(t, "GET", urlStr) + resp = session.MakeRequest(t, req, http.StatusOK) + var apiMilestone2 structs.Milestone + DecodeJSON(t, resp, &apiMilestone2) + assert.EqualValues(t, "closed", apiMilestone2.State) +} diff --git a/models/issue_milestone.go b/models/issue_milestone.go index 38338e9bee..4ceaaa9e76 100644 --- a/models/issue_milestone.go +++ b/models/issue_milestone.go @@ -287,12 +287,33 @@ func updateMilestone(e Engine, m *Milestone) error { } // UpdateMilestone updates information of given milestone. -func UpdateMilestone(m *Milestone) error { - if err := updateMilestone(x, m); err != nil { +func UpdateMilestone(m *Milestone, oldIsClosed bool) error { + sess := x.NewSession() + defer sess.Close() + if err := sess.Begin(); err != nil { return err } - return updateMilestoneCompleteness(x, m.ID) + if m.IsClosed && !oldIsClosed { + m.ClosedDateUnix = timeutil.TimeStampNow() + } + + if err := updateMilestone(sess, m); err != nil { + return err + } + + if err := updateMilestoneCompleteness(sess, m.ID); err != nil { + return err + } + + // if IsClosed changed, update milestone numbers of repository + if oldIsClosed != m.IsClosed { + if err := updateRepoMilestoneNum(sess, m.RepoID); err != nil { + return err + } + } + + return sess.Commit() } func updateMilestoneCompleteness(e Engine, milestoneID int64) error { diff --git a/models/issue_milestone_test.go b/models/issue_milestone_test.go index 00db3a907e..cea2c4ea14 100644 --- a/models/issue_milestone_test.go +++ b/models/issue_milestone_test.go @@ -160,7 +160,7 @@ func TestUpdateMilestone(t *testing.T) { milestone := AssertExistsAndLoadBean(t, &Milestone{ID: 1}).(*Milestone) milestone.Name = " newMilestoneName " milestone.Content = "newMilestoneContent" - assert.NoError(t, UpdateMilestone(milestone)) + assert.NoError(t, UpdateMilestone(milestone, milestone.IsClosed)) milestone = AssertExistsAndLoadBean(t, &Milestone{ID: 1}).(*Milestone) assert.EqualValues(t, "newMilestoneName", milestone.Name) CheckConsistencyFor(t, &Milestone{}) diff --git a/routers/api/v1/repo/milestone.go b/routers/api/v1/repo/milestone.go index a979e2b69b..7dc87e3883 100644 --- a/routers/api/v1/repo/milestone.go +++ b/routers/api/v1/repo/milestone.go @@ -194,7 +194,12 @@ func EditMilestone(ctx *context.APIContext, form api.EditMilestoneOption) { milestone.DeadlineUnix = timeutil.TimeStamp(form.Deadline.Unix()) } - if err := models.UpdateMilestone(milestone); err != nil { + var oldIsClosed = milestone.IsClosed + if form.State != nil { + milestone.IsClosed = *form.State == string(api.StateClosed) + } + + if err := models.UpdateMilestone(milestone, oldIsClosed); err != nil { ctx.ServerError("UpdateMilestone", err) return } diff --git a/routers/repo/milestone.go b/routers/repo/milestone.go index b4056cc6d1..b5c6f12917 100644 --- a/routers/repo/milestone.go +++ b/routers/repo/milestone.go @@ -192,7 +192,7 @@ func EditMilestonePost(ctx *context.Context, form auth.CreateMilestoneForm) { m.Name = form.Title m.Content = form.Content m.DeadlineUnix = timeutil.TimeStamp(deadline.Unix()) - if err = models.UpdateMilestone(m); err != nil { + if err = models.UpdateMilestone(m, m.IsClosed); err != nil { ctx.ServerError("UpdateMilestone", err) return } From b3549bb5eceecf136366003744cff222c0af259d Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 29 Jan 2020 21:40:43 +0100 Subject: [PATCH 063/200] [UI] Show pull icon on pull (#10061) (#10062) --- templates/repo/issue/view_title.tmpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index 635638f325..11bede3713 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -20,6 +20,8 @@
    {{.i18n.Tr "repo.pulls.merged"}}
    {{else if .Issue.IsClosed}}
    {{.i18n.Tr "repo.issues.closed_title"}}
    + {{else if .Issue.IsPull}} +
    {{.i18n.Tr "repo.issues.open_title"}}
    {{else}}
    {{.i18n.Tr "repo.issues.open_title"}}
    {{end}} From 912ce274210727f185478176774f80269af16878 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Fri, 31 Jan 2020 10:04:49 +0200 Subject: [PATCH 064/200] Update topics repo count when deleting repository (#10081) --- models/repo.go | 6 ++++++ models/topic.go | 24 +++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/models/repo.go b/models/repo.go index 3071c11f32..804320a2b7 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1910,6 +1910,12 @@ func DeleteRepository(doer *User, uid, repoID int64) error { return err } + if len(repo.Topics) > 0 { + if err = removeTopicsFromRepo(sess, repo.ID); err != nil { + return err + } + } + // FIXME: Remove repository files should be executed after transaction succeed. repoPath := repo.repoPath(sess) removeAllWithNotice(sess, "Delete repository files", repoPath) diff --git a/models/topic.go b/models/topic.go index e4fda03fc4..f4d414bf30 100644 --- a/models/topic.go +++ b/models/topic.go @@ -129,7 +129,7 @@ func addTopicByNameToRepo(e Engine, repoID int64, topicName string) (*Topic, err } // removeTopicFromRepo remove a topic from a repo and decrements the topic repo count -func removeTopicFromRepo(repoID int64, topic *Topic, e Engine) error { +func removeTopicFromRepo(e Engine, repoID int64, topic *Topic) error { topic.RepoCount-- if _, err := e.ID(topic.ID).Cols("repo_count").Update(topic); err != nil { return err @@ -145,6 +145,24 @@ func removeTopicFromRepo(repoID int64, topic *Topic, e Engine) error { return nil } +// removeTopicsFromRepo remove all topics from the repo and decrements respective topics repo count +func removeTopicsFromRepo(e Engine, repoID int64) error { + _, err := e.Where( + builder.In("id", + builder.Select("topic_id").From("repo_topic").Where(builder.Eq{"repo_id": repoID}), + ), + ).Cols("repo_count").SetExpr("repo_count", "repo_count-1").Update(&Topic{}) + if err != nil { + return err + } + + if _, err = e.Delete(&RepoTopic{RepoID: repoID}); err != nil { + return err + } + + return nil +} + // FindTopicOptions represents the options when fdin topics type FindTopicOptions struct { RepoID int64 @@ -217,7 +235,7 @@ func DeleteTopic(repoID int64, topicName string) (*Topic, error) { return nil, nil } - err = removeTopicFromRepo(repoID, topic, x) + err = removeTopicFromRepo(x, repoID, topic) return topic, err } @@ -278,7 +296,7 @@ func SaveTopics(repoID int64, topicNames ...string) error { } for _, topic := range removeTopics { - err := removeTopicFromRepo(repoID, topic, sess) + err := removeTopicFromRepo(sess, repoID, topic) if err != nil { return err } From f5727d83ddad7890965549d4e3ed8146c9e207c7 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 1 Feb 2020 02:49:45 +0100 Subject: [PATCH 065/200] [BugFix] [API] Pull.API.Convert: Only try to get HeadBranch if HeadRepo exist (#10029) (#10088) --- models/pull.go | 61 ++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/models/pull.go b/models/pull.go index c39ceb6165..9df5b90fc4 100644 --- a/models/pull.go +++ b/models/pull.go @@ -420,7 +420,7 @@ func (pr *PullRequest) apiFormat(e Engine) *api.PullRequest { err error ) if err = pr.Issue.loadRepo(e); err != nil { - log.Error("loadRepo[%d]: %v", pr.ID, err) + log.Error("pr.Issue.loadRepo[%d]: %v", pr.ID, err) return nil } apiIssue := pr.Issue.apiFormat(e) @@ -431,19 +431,14 @@ func (pr *PullRequest) apiFormat(e Engine) *api.PullRequest { return nil } } - if pr.HeadRepo == nil { + if pr.HeadRepoID != 0 && pr.HeadRepo == nil { pr.HeadRepo, err = getRepositoryByID(e, pr.HeadRepoID) - if err != nil { + if err != nil && !IsErrRepoNotExist(err) { log.Error("GetRepositoryById[%d]: %v", pr.ID, err) return nil } } - if err = pr.Issue.loadRepo(e); err != nil { - log.Error("pr.Issue.loadRepo[%d]: %v", pr.ID, err) - return nil - } - apiPullRequest := &api.PullRequest{ ID: pr.ID, URL: pr.Issue.HTMLURL(), @@ -495,33 +490,41 @@ func (pr *PullRequest) apiFormat(e Engine) *api.PullRequest { apiPullRequest.Base = apiBaseBranchInfo } - headBranch, err = pr.HeadRepo.GetBranch(pr.HeadBranch) - if err != nil { - if git.IsErrBranchNotExist(err) { - apiPullRequest.Head = nil - } else { - log.Error("GetBranch[%s]: %v", pr.HeadBranch, err) - return nil - } - } else { - apiHeadBranchInfo := &api.PRBranchInfo{ - Name: pr.HeadBranch, - Ref: pr.HeadBranch, - RepoID: pr.HeadRepoID, - Repository: pr.HeadRepo.innerAPIFormat(e, AccessModeNone, false), - } - headCommit, err = headBranch.GetCommit() + if pr.HeadRepo != nil { + headBranch, err = pr.HeadRepo.GetBranch(pr.HeadBranch) if err != nil { - if git.IsErrNotExist(err) { - apiHeadBranchInfo.Sha = "" + if git.IsErrBranchNotExist(err) { + apiPullRequest.Head = nil } else { - log.Error("GetCommit[%s]: %v", headBranch.Name, err) + log.Error("GetBranch[%s]: %v", pr.HeadBranch, err) return nil } } else { - apiHeadBranchInfo.Sha = headCommit.ID.String() + apiHeadBranchInfo := &api.PRBranchInfo{ + Name: pr.HeadBranch, + Ref: pr.HeadBranch, + RepoID: pr.HeadRepoID, + Repository: pr.HeadRepo.innerAPIFormat(e, AccessModeNone, false), + } + headCommit, err = headBranch.GetCommit() + if err != nil { + if git.IsErrNotExist(err) { + apiHeadBranchInfo.Sha = "" + } else { + log.Error("GetCommit[%s]: %v", headBranch.Name, err) + return nil + } + } else { + apiHeadBranchInfo.Sha = headCommit.ID.String() + } + apiPullRequest.Head = apiHeadBranchInfo + } + } else { + apiPullRequest.Head = &api.PRBranchInfo{ + Name: pr.HeadBranch, + Ref: fmt.Sprintf("refs/pull/%d/head", pr.Index), + RepoID: -1, } - apiPullRequest.Head = apiHeadBranchInfo } if pr.Status != PullRequestStatusChecking { From 049af0d3d0d889331279db2ecab462809f23aab5 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 1 Feb 2020 23:14:56 +0800 Subject: [PATCH 066/200] Fix branch page pull request title and link error (#10092) (#10097) * Fix branch page pull request title and link error (#10092) --- routers/repo/branch.go | 2 +- templates/repo/branch/list.tmpl | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/routers/repo/branch.go b/routers/repo/branch.go index df6e0bf21f..d00f0e0602 100644 --- a/routers/repo/branch.go +++ b/routers/repo/branch.go @@ -238,6 +238,7 @@ func loadBranches(ctx *context.Context) []*Branch { } else { repoIDToRepo[pr.BaseRepoID] = pr.BaseRepo } + pr.Issue.Repo = pr.BaseRepo if pr.HasMerged { baseGitRepo, ok := repoIDToGitRepo[pr.BaseRepoID] @@ -260,7 +261,6 @@ func loadBranches(ctx *context.Context) []*Branch { mergeMovedOn = true } } - } isIncluded := divergence.Ahead == 0 && ctx.Repo.Repository.DefaultBranch != branchName diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 073516f25f..5244bf83e7 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -73,7 +73,7 @@ {{end}} - + {{if not .LatestPullRequest}} {{if .IsIncluded}} @@ -91,13 +91,13 @@ {{end}} {{else}} - #{{.LatestPullRequest.Issue.Index}} + {{if ne .LatestPullRequest.BaseRepoID .LatestPullRequest.HeadRepoID}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}} {{if .LatestPullRequest.HasMerged}} - {{$.i18n.Tr "repo.pulls.merged"}} + {{$.i18n.Tr "repo.pulls.merged"}} {{else if .LatestPullRequest.Issue.IsClosed}} - {{$.i18n.Tr "repo.issues.closed_title"}} + {{$.i18n.Tr "repo.issues.closed_title"}} {{else}} - {{$.i18n.Tr "repo.issues.open_title"}} + {{$.i18n.Tr "repo.issues.open_title"}} {{end}} {{end}} From 1ed432300523982df466a786d446e4e03b0e0820 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 1 Feb 2020 20:24:58 +0000 Subject: [PATCH 067/200] Add button to revert SimpleMDE to plain textarea (#10099) (#10102) --- web_src/js/index.js | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/web_src/js/index.js b/web_src/js/index.js index 619ca74e52..d7abfa2ff1 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -1362,7 +1362,16 @@ function initWikiForm() { }, '|', 'unordered-list', 'ordered-list', '|', 'link', 'image', 'table', 'horizontal-rule', '|', - 'clean-block', 'preview', 'fullscreen', 'side-by-side'] + 'clean-block', 'preview', 'fullscreen', 'side-by-side', '|', + { + name: 'revert-to-textarea', + action(e) { + e.toTextArea(); + }, + className: 'fa fa-file', + title: 'Revert to simple textarea', + }, + ] }); $(simplemde.codemirror.getInputField()).addClass('js-quick-submit'); @@ -1466,7 +1475,16 @@ function setSimpleMDE($editArea) { 'code', 'quote', '|', 'unordered-list', 'ordered-list', '|', 'link', 'image', 'table', 'horizontal-rule', '|', - 'clean-block', 'preview', 'fullscreen', 'side-by-side'] + 'clean-block', 'preview', 'fullscreen', 'side-by-side', '|', + { + name: 'revert-to-textarea', + action(e) { + e.toTextArea(); + }, + className: 'fa fa-file', + title: 'Revert to simple textarea', + }, + ] }); return true; @@ -1488,7 +1506,16 @@ function setCommentSimpleMDE($editArea) { 'code', 'quote', '|', 'unordered-list', 'ordered-list', '|', 'link', 'image', 'table', 'horizontal-rule', '|', - 'clean-block'] + 'clean-block', '|', + { + name: 'revert-to-textarea', + action(e) { + e.toTextArea(); + }, + className: 'fa fa-file', + title: 'Revert to simple textarea', + }, + ] }); simplemde.codemirror.setOption('extraKeys', { Enter: () => { From 6896dad6754e3878f21ccc88cf740b92e8a873a6 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 3 Feb 2020 04:19:04 +0100 Subject: [PATCH 068/200] working part of #9998 (#10114) (#10115) Co-authored-by: zeripath Co-authored-by: zeripath --- routers/user/home.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/routers/user/home.go b/routers/user/home.go index ff77bd0032..819853ac38 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -525,13 +525,17 @@ func Issues(ctx *context.Context) { } } - issueStats, err := models.GetUserIssueStats(models.UserIssueStatsOptions{ + issueStatsOpts := models.UserIssueStatsOptions{ UserID: ctxUser.ID, UserRepoIDs: userRepoIDs, FilterMode: filterMode, IsPull: isPullList, IsClosed: isShowClosed, - }) + } + if len(repoIDs) > 0 { + issueStatsOpts.UserRepoIDs = repoIDs + } + issueStats, err := models.GetUserIssueStats(issueStatsOpts) if err != nil { ctx.ServerError("GetUserIssueStats", err) return From 0129e76ef5bdd6af30207ce7d99bdbe70c108d18 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 3 Feb 2020 18:44:06 +0100 Subject: [PATCH 069/200] Prevent DeleteUser API abuse (#10125) (#10128) * fix & co * word suggestions from @jolheiser --- routers/api/v1/admin/user.go | 6 ++++++ routers/org/setting.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go index 7387037d33..6df8ad9393 100644 --- a/routers/api/v1/admin/user.go +++ b/routers/api/v1/admin/user.go @@ -7,6 +7,7 @@ package admin import ( "errors" + "fmt" "net/http" "code.gitea.io/gitea/models" @@ -226,6 +227,11 @@ func DeleteUser(ctx *context.APIContext) { return } + if u.IsOrganization() { + ctx.Error(http.StatusUnprocessableEntity, "", fmt.Errorf("%s is an organization not a user", u.Name)) + return + } + if err := models.DeleteUser(u); err != nil { if models.IsErrUserOwnRepos(err) || models.IsErrUserHasOrgs(err) { diff --git a/routers/org/setting.go b/routers/org/setting.go index 0aeefb50af..74fa4a7afb 100644 --- a/routers/org/setting.go +++ b/routers/org/setting.go @@ -115,7 +115,7 @@ func SettingsDeleteAvatar(ctx *context.Context) { ctx.Redirect(ctx.Org.OrgLink + "/settings") } -// SettingsDelete response for delete repository +// SettingsDelete response for deleting an organization func SettingsDelete(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("org.settings") ctx.Data["PageIsSettingsDelete"] = true From 2cd2614eaa40bc25880431f6ea56f9c47a938508 Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Wed, 5 Feb 2020 08:50:06 -0600 Subject: [PATCH 070/200] Fix push-create SSH bugs (#10145) (#10151) * Attempt to fix push-create SSH bugs Signed-off-by: jolheiser * Fix binding Signed-off-by: jolheiser * Invalid ctx Signed-off-by: jolheiser --- cmd/serv.go | 6 ++++++ integrations/git_test.go | 16 ++++++++++++++++ routers/private/serv.go | 12 +++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/cmd/serv.go b/cmd/serv.go index 8ffe9b3a4f..fa1e033391 100644 --- a/cmd/serv.go +++ b/cmd/serv.go @@ -12,6 +12,7 @@ import ( "net/url" "os" "os/exec" + "regexp" "strconv" "strings" "time" @@ -72,6 +73,7 @@ var ( "git-receive-pack": models.AccessModeWrite, lfsAuthenticateVerb: models.AccessModeNone, } + alphaDashDotPattern = regexp.MustCompile(`[^\w-\.]`) ) func fail(userMessage, logMessage string, args ...interface{}) { @@ -147,6 +149,10 @@ func runServ(c *cli.Context) error { username := strings.ToLower(rr[0]) reponame := strings.ToLower(strings.TrimSuffix(rr[1], ".git")) + if alphaDashDotPattern.MatchString(reponame) { + fail("Invalid repo name", "Invalid repo name: %s", reponame) + } + if setting.EnablePprof || c.Bool("enable-pprof") { if err := os.MkdirAll(setting.PprofDataPath, os.ModePerm); err != nil { fail("Error while trying to create PPROF_DATA_PATH", "Error while trying to create PPROF_DATA_PATH: %v", err) diff --git a/integrations/git_test.go b/integrations/git_test.go index 7d37555f06..7753b2cb72 100644 --- a/integrations/git_test.go +++ b/integrations/git_test.go @@ -422,6 +422,9 @@ func doPushCreate(ctx APITestContext, u *url.URL) func(t *testing.T) { tmpDir, err := ioutil.TempDir("", ctx.Reponame) assert.NoError(t, err) + _, err = git.NewCommand("clone", u.String()).RunInDir(tmpDir) + assert.Error(t, err) + err = git.InitRepository(tmpDir, false) assert.NoError(t, err) @@ -449,6 +452,13 @@ func doPushCreate(ctx APITestContext, u *url.URL) func(t *testing.T) { _, err = git.NewCommand("remote", "add", "origin", u.String()).RunInDir(tmpDir) assert.NoError(t, err) + invalidCtx := ctx + invalidCtx.Reponame = fmt.Sprintf("invalid/repo-tmp-push-create-%s", u.Scheme) + u.Path = invalidCtx.GitPath() + + _, err = git.NewCommand("remote", "add", "invalid", u.String()).RunInDir(tmpDir) + assert.NoError(t, err) + // Push to create disabled setting.Repository.EnablePushCreateUser = false _, err = git.NewCommand("push", "origin", "master").RunInDir(tmpDir) @@ -456,6 +466,12 @@ func doPushCreate(ctx APITestContext, u *url.URL) func(t *testing.T) { // Push to create enabled setting.Repository.EnablePushCreateUser = true + + // Invalid repo + _, err = git.NewCommand("push", "invalid", "master").RunInDir(tmpDir) + assert.Error(t, err) + + // Valid repo _, err = git.NewCommand("push", "origin", "master").RunInDir(tmpDir) assert.NoError(t, err) diff --git a/routers/private/serv.go b/routers/private/serv.go index c769f30d07..91c28143ee 100644 --- a/routers/private/serv.go +++ b/routers/private/serv.go @@ -68,7 +68,6 @@ func ServNoCommand(ctx *macaron.Context) { // ServCommand returns information about the provided keyid func ServCommand(ctx *macaron.Context) { - // Although we provide the verbs we don't need them at present they're just for logging purposes keyID := ctx.ParamsInt64(":keyid") ownerName := ctx.Params(":owner") repoName := ctx.Params(":repo") @@ -105,6 +104,17 @@ func ServCommand(ctx *macaron.Context) { if err != nil { if models.IsErrRepoNotExist(err) { repoExist = false + for _, verb := range ctx.QueryStrings("verb") { + if "git-upload-pack" == verb { + // User is fetching/cloning a non-existent repository + ctx.JSON(http.StatusNotFound, map[string]interface{}{ + "results": results, + "type": "ErrRepoNotExist", + "err": fmt.Sprintf("Cannot find repository: %s/%s", results.OwnerName, results.RepoName), + }) + return + } + } } else { log.Error("Unable to get repository: %s/%s Error: %v", results.OwnerName, results.RepoName, err) ctx.JSON(http.StatusInternalServerError, map[string]interface{}{ From e48b460a0ae25f6161225e3af10db00e95f02546 Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Fri, 7 Feb 2020 00:51:23 -0300 Subject: [PATCH 071/200] Fix issue/pull link (#10158) (#10173) --- templates/user/dashboard/issues.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index 26020ca0ce..7c95362161 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -89,7 +89,7 @@ {{if .Repo}}
  • {{.Repo.FullName}}#{{.Index}}
    - {{.Title}} + {{.Title}} {{if .IsPull }} {{if (index $.CommitStatus .PullRequest.ID)}} From 6af58022c881457bc018db61ea5eaa67fd720b42 Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Fri, 7 Feb 2020 14:12:49 -0300 Subject: [PATCH 072/200] Prevent double waitgroup decrement (#10170) (#10175) * Prevent double waitgroup decrement Co-authored-by: zeripath --- modules/graceful/server.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/graceful/server.go b/modules/graceful/server.go index 19ce8a866f..09be933999 100644 --- a/modules/graceful/server.go +++ b/modules/graceful/server.go @@ -12,6 +12,7 @@ import ( "os" "strings" "sync" + "sync/atomic" "syscall" "time" @@ -215,9 +216,12 @@ func (wl *wrappedListener) Accept() (net.Conn, error) { } } + closed := int32(0) + c = wrappedConn{ Conn: c, server: wl.server, + closed: &closed, } wl.server.wg.Add(1) @@ -241,12 +245,12 @@ func (wl *wrappedListener) File() (*os.File, error) { type wrappedConn struct { net.Conn server *Server + closed *int32 } func (w wrappedConn) Close() error { - err := w.Conn.Close() - if err == nil { + if atomic.CompareAndSwapInt32(w.closed, 0, 1) { w.server.wg.Done() } - return err + return w.Conn.Close() } From b5b44364e395a4321004721343f1b2a16a0a646e Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Fri, 7 Feb 2020 17:39:24 -0300 Subject: [PATCH 073/200] Allow emoji on review head comments (#10159) (#10174) Co-authored-by: techknowlogick Co-authored-by: techknowlogick Co-authored-by: Antoine GIRARD --- templates/repo/issue/view_content/comments.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 40db434dec..942a5ed051 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -336,7 +336,7 @@ {{if .Content}}
    - {{.Content}} + {{.Content}}
    {{end}} {{ range $filename, $lines := .Review.CodeComments}} From b16c5555417191492b5533a4a7e68b7abb9e590c Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 8 Feb 2020 00:04:03 +0100 Subject: [PATCH 074/200] Fix code-expansion arc-green theme bug (#10180) (#10185) * fix code-expansion theme bug * working solution without important * no new color * the midle --- web_src/less/themes/arc-green.less | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web_src/less/themes/arc-green.less b/web_src/less/themes/arc-green.less index 69e8963fbb..c5f4a43f59 100644 --- a/web_src/less/themes/arc-green.less +++ b/web_src/less/themes/arc-green.less @@ -1111,6 +1111,9 @@ input { .lines-code .hljs { background-color: #2a2e3a !important; } +td.blob-excerpt { + background-color: rgba(0, 0, 0, 0.15); +} .code-view .active { background: #554a00; From 80eb50655a33dd7945ae2cbabf255c4138335dcf Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Sun, 9 Feb 2020 23:00:24 +0200 Subject: [PATCH 075/200] Fix followers and following tabs in profile (#10202) (#10203) --- routers/routes/routes.go | 7 +---- routers/user/profile.go | 50 +++++++++++------------------- templates/repo/user_cards.tmpl | 2 ++ templates/user/meta/followers.tmpl | 6 ---- templates/user/meta/header.tmpl | 24 -------------- templates/user/profile.tmpl | 33 +++++++++----------- 6 files changed, 35 insertions(+), 87 deletions(-) delete mode 100644 templates/user/meta/followers.tmpl delete mode 100644 templates/user/meta/header.tmpl diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 08cc52e0e0..9d59ade3a3 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -475,12 +475,7 @@ func RegisterRoutes(m *macaron.Macaron) { // ***** END: Admin ***** m.Group("", func() { - m.Group("/:username", func() { - m.Get("", user.Profile) - m.Get("/followers", user.Followers) - m.Get("/following", user.Following) - }) - + m.Get("/:username", user.Profile) m.Get("/attachments/:uuid", repo.GetAttachment) }, ignSignIn) diff --git a/routers/user/profile.go b/routers/user/profile.go index fd29a17622..b54a68db70 100644 --- a/routers/user/profile.go +++ b/routers/user/profile.go @@ -11,16 +11,10 @@ import ( "strings" "code.gitea.io/gitea/models" - "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/routers/org" - "code.gitea.io/gitea/routers/repo" -) - -const ( - tplFollowers base.TplName = "user/meta/followers" ) // GetUserByName get user by name @@ -164,6 +158,24 @@ func Profile(ctx *context.Context) { keyword := strings.Trim(ctx.Query("q"), " ") ctx.Data["Keyword"] = keyword switch tab { + case "followers": + items, err := ctxUser.GetFollowers(page) + if err != nil { + ctx.ServerError("GetFollowers", err) + return + } + ctx.Data["Cards"] = items + + total = ctxUser.NumFollowers + case "following": + items, err := ctxUser.GetFollowing(page) + if err != nil { + ctx.ServerError("GetFollowing", err) + return + } + ctx.Data["Cards"] = items + + total = ctxUser.NumFollowing case "activity": retrieveFeeds(ctx, models.GetFeedsOptions{RequestedUser: ctxUser, RequestingUserID: requestingUserID, @@ -229,32 +241,6 @@ func Profile(ctx *context.Context) { ctx.HTML(200, tplProfile) } -// Followers render user's followers page -func Followers(ctx *context.Context) { - u := GetUserByParams(ctx) - if ctx.Written() { - return - } - ctx.Data["Title"] = u.DisplayName() - ctx.Data["CardsTitle"] = ctx.Tr("user.followers") - ctx.Data["PageIsFollowers"] = true - ctx.Data["Owner"] = u - repo.RenderUserCards(ctx, u.NumFollowers, u.GetFollowers, tplFollowers) -} - -// Following render user's followering page -func Following(ctx *context.Context) { - u := GetUserByParams(ctx) - if ctx.Written() { - return - } - ctx.Data["Title"] = u.DisplayName() - ctx.Data["CardsTitle"] = ctx.Tr("user.following") - ctx.Data["PageIsFollowing"] = true - ctx.Data["Owner"] = u - repo.RenderUserCards(ctx, u.NumFollowing, u.GetFollowing, tplFollowers) -} - // Action response for follow/unfollow user request func Action(ctx *context.Context) { u := GetUserByParams(ctx) diff --git a/templates/repo/user_cards.tmpl b/templates/repo/user_cards.tmpl index 3677bab635..cd7f15a710 100644 --- a/templates/repo/user_cards.tmpl +++ b/templates/repo/user_cards.tmpl @@ -1,7 +1,9 @@
    + {{if .CardsTitle}}

    {{.CardsTitle}}

    + {{end}}
      {{range .Cards}}
    • diff --git a/templates/user/meta/followers.tmpl b/templates/user/meta/followers.tmpl deleted file mode 100644 index 40d7e95013..0000000000 --- a/templates/user/meta/followers.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -{{template "base/head" .}} -
      - {{template "user/meta/header" .}} - {{template "repo/user_cards" .}} -
      -{{template "base/footer" .}} diff --git a/templates/user/meta/header.tmpl b/templates/user/meta/header.tmpl deleted file mode 100644 index 36072e8aa1..0000000000 --- a/templates/user/meta/header.tmpl +++ /dev/null @@ -1,24 +0,0 @@ -{{with .Owner}} -
      - - - {{.Name}} - {{with .FullName}}({{.}}){{end}} - - -
      - {{if or $.PageIsFollowers $.PageIsFollowing}} - {{if and $.IsSigned (ne $.SignedUserName .Name)}} - - {{end}} - {{end}} -
      -
      -{{end}} -
      diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 52c6e3ec3f..101a2e7d45 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -49,24 +49,6 @@ {{end}} {{end}}
    • {{.i18n.Tr "user.join_on"}} {{.Owner.CreatedUnix.FormatShort}}
    • -
    • - - - {{.Owner.NumFollowers}} {{.i18n.Tr "user.followers"}} - - - - - {{.Owner.NumFollowing}} {{.i18n.Tr "user.following"}} - -
    • - {{/* -
    • - - - {{.Owner.NumStars}} {{.i18n.Tr "user.starred"}} - -
    • - */}} {{if and .Orgs .HasOrgsVisible}}
      • @@ -95,7 +77,7 @@
    + {{else if eq .TabName "following"}} + {{template "repo/user_cards" .}} + {{else if eq .TabName "followers"}} + {{template "repo/user_cards" .}} {{else}} {{template "explore/repo_search" .}} {{template "explore/repo_list" .}} From 9169b394586fb6dfe07925f21ebf69648b19f902 Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Mon, 10 Feb 2020 05:34:30 -0600 Subject: [PATCH 076/200] Changelog 1.11.0 (#10204) * Changelog 1.11.0 Signed-off-by: jolheiser * Backport snackport Co-Authored-By: techknowlogick * Update CHANGELOG.md Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: techknowlogick Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> --- .changelog.yml | 13 +++++ CHANGELOG.md | 139 ++++++++++++++++++++++++++--------------------- docs/config.yaml | 2 +- 3 files changed, 90 insertions(+), 64 deletions(-) diff --git a/.changelog.yml b/.changelog.yml index 3d61e8ef48..f6eb9372f2 100644 --- a/.changelog.yml +++ b/.changelog.yml @@ -1,4 +1,14 @@ +# The full repository name repo: go-gitea/gitea + +# Service type (gitea or github) +service: github + +# Base URL for Gitea instance if using gitea service type (optional) +# Default: https://gitea.com +base-url: + +# Changelog groups and which labeled PRs to add to each group groups: - name: BREAKING @@ -42,3 +52,6 @@ groups: - name: MISC default: true + +# regex indicating which labels to skip for the changelog +skip-labels: skip-changelog|backport\/.+ diff --git a/CHANGELOG.md b/CHANGELOG.md index add2f9a872..ba83e9384f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,69 +4,22 @@ This changelog goes through all the changes that have been made in each release without substantial changes to our git log; to see the highlights of what has been added to each release, please refer to the [blog](https://blog.gitea.io). -## [1.11.0-RC2](https://github.com/go-gitea/gitea/releases/tag/v1.11.0-rc2) - 2020-01-18 +## [1.11.0](https://github.com/go-gitea/gitea/releases/tag/v1.11.0) - 2020-02-10 * BREAKING + * Fix followers and following tabs in profile (#10202) (#10203) * Make CertFile and KeyFile relative to CustomPath (#9868) (#9874) -* SECURITY - * Never allow an empty password to validate (#9682) (#9683) - * Prevent redirect to Host (#9678) (#9679) -* BUGFIXES - * Don't convert ellipsis in markdown (#9905) (#9937) - * Fixed repo link in generated comment for cross repository dependency (#9863) (#9935) - * Check if diff actually contains sections when rendering (#9926) (#9933) - * Fix wrong hint when status checking is running on pull request view (#9886) (#9928) - * Fix RocketChat (#9908) (#9921) - * Do not try to recreate ldap user if they are already created (#9900) (#9919) - * Create terminated channel in queue_redis (#9910) (#9911) - * Prevent empty LDAP search result from deactivating all users (#9879) (#9896) - * Fix wrong permissions check when issues/prs shared operations (#9885) (#9889) - * Check user != nil before checking values (#9881) (#9883) - * Allow hyphen in language name (#9873) (#9880) - * Ensure that 2fa is checked on reset-password (#9857) (#9876) - * Fix issues/pulls dependencies problems (#9842) (#9864) - * Explicitly refer to PR in squash-merge commit message in case of external tracker (#9844) (#9855) - * Fix markdown anchor links (#9673) (#9840) - * Allow assignee on Pull Creation when Issue Unit is deactivated (#9836) (#9837) - * Fix download file wrong content-type (#9825) (#9834) - * Fix wrong poster identity on a migrated pull request when submit review (#9827) (#9830) - * Fix database dump when log directory is missing (#9818) (#9819) - * Fix compare (#9808) (#9814) - * Fix push-to-create (#9772) (#9797) - * Fix missing msteam webhook on organization (#9781) (#9794) - * Fix missing unlock in uniquequeue (#9790) (#9791) - * Fix add team on collaborator page when same name as organization (#9778) - * DeleteRepoFile incorrectly handles Delete to new branch (#9769) (#9775) - * Fix milestones page (#9771) - * Fix SimpleMDE quote reply (#9757) (#9768) - * Fix missing updated time on migrated issues and comments (#9744) (#9764) - * Move Errored PRs out of StatusChecking (#9675) (#9726) - * Make hook status printing configurable with delay (#9641) (#9725) - * ​Fix /repos​/issues​/search (#9698) (#9724) - * Silence fomantic error regarding tabs (#9713) (#9718) - * Remove unused lock (#9709) (#9710) - * Remove q.lock.Unlock() in setInternal to prevent panic (#9705) (#9706) - * Load milestone in API PR list (#9671) (#9700) - * Don't attempt to close issue if already closed (#9696) (#9699) - * Remove google font call (#9668) (#9681) - * Eliminate horizontal scroll caused by footer (#9674) - * Fix nil reference in repo generation (#9660) (#9666) - * Add HTML URL to API Issues (#9654) (#9661) - * Add PR review webhook to Telegram (#9653) (#9655) - * Use filepath.IsAbs instead of path.IsAbs (#9651) (#9652) -* TRANSLATION - * Fix Korean locales (#9761) (#9780) -* BUILD - * Fix webpack polyfills (#9735) (#9738) -* MISC - * Backport Locales [2020-01-14] (#9773) - -## [1.11.0-RC1](https://github.com/go-gitea/gitea/releases/tag/v1.11.0-rc1) - 2020-01-07 -* BREAKING * Remove unused endpoints (#9538) * Prefix all user-generated IDs in markup (#9477) * Enforce Gitea environment for pushes (#8982) - * Hide some user information via API if user have no enough permission (#8655) + * Hide some user information via API if user have not enough permissions (#8655) * Move startpage/homepage translation to crowdin (#8596) +* SECURITY + * Never allow an empty password to validate (#9682) (#9683) + * Prevent redirect to Host (#9678) (#9679) + * Swagger hide search field (#9554) + * Add "search" to reserved usernames (#9063) + * Switch to fomantic-ui (#9374) + * Only serve attachments when linked to issue/release and if accessible by user (#9340) * FEATURES * Webhooks should only show sender if it makes sense (#9601) * Provide Default messages for merges (#9393) @@ -100,6 +53,68 @@ been added to each release, please refer to the [blog](https://blog.gitea.io). * Sign merges, CRUD, Wiki and Repository initialisation with gpg key (#7631) * Add basic repository lfs management (#7199) * BUGFIXES + * Fix code-expansion arc-green theme bug (#10180) (#10185) + * Prevent double wait-group decrement (#10170) (#10175) + * Allow emoji on review head comments (#10159) (#10174) + * Fix issue/pull link (#10158) (#10173) + * Fix push-create SSH bugs (#10145) (#10151) + * Prevent DeleteUser API abuse (#10125) (#10128) + * Fix issues/pulls dashboard paging error (#10114) (#10115) + * Add button to revert SimpleMDE to plain textarea (#10099) (#10102) + * Fix branch page pull request title and link error (#10092) (#10097) + * Fix PR API: Only try to get HeadBranch if HeadRepo exist (#10029) (#10088) + * Update topics repo count when deleting repository (#10051) (#10081) + * Show pull icon on pull requests (#10061) (#10062) + * Fix milestone API state parameter unhandled (#10049) (#10052) + * Move to using a temporary repo for pushing new PRs (#10009) (#10042) + * Fix wiki raw view on sub path (#10002) (#10040) + * Ensure that feeds are appropriately restricted (#10018) (#10019) + * Sanitize credentials in mirror form (#9975) (#9991) + * Close related pull requests when deleting head repository or head branch (#9927) (#9974) + * Switch to use -f instead of -F for sendmail (#9961) (#9970) + * Fix file rename/copy not supported by indexer (#9965) (#9967) + * Fix repo indexer not updating upon push (#9957) (#9963) + * Don't convert ellipsis in markdown (#9905) (#9937) + * Fixed repo link in generated comment for cross repository dependency (#9863) (#9935) + * Check if diff actually contains sections when rendering (#9926) (#9933) + * Fix wrong hint when status checking is running on pull request view (#9886) (#9928) + * Fix RocketChat (#9908) (#9921) + * Do not try to recreate ldap user if they are already created (#9900) (#9919) + * Create terminated channel in queue_redis (#9910) (#9911) + * Prevent empty LDAP search result from deactivating all users (#9879) (#9896) + * Fix wrong permissions check when issues/prs shared operations (#9885) (#9889) + * Check user != nil before checking values (#9881) (#9883) + * Allow hyphen in language name (#9873) (#9880) + * Ensure that 2fa is checked on reset-password (#9857) (#9876) + * Fix issues/pulls dependencies problems (#9842) (#9864) + * Fix markdown anchor links (#9673) (#9840) + * Allow assignee on Pull Creation when Issue Unit is deactivated (#9836) (#9837) + * Fix download file wrong content-type (#9825) (#9834) + * Fix wrong poster identity on a migrated pull request when submit review (#9827) (#9830) + * Fix database dump when log directory is missing (#9818) (#9819) + * Fix compare (#9808) (#9814) + * Fix push-to-create (#9772) (#9797) + * Fix missing msteam webhook on organization (#9781) (#9794) + * Fix missing unlock in uniquequeue (#9790) (#9791) + * Fix add team on collaborator page when same name as organization (#9778) + * DeleteRepoFile incorrectly handles Delete to new branch (#9769) (#9775) + * Fix milestones page (#9771) + * Fix SimpleMDE quote reply (#9757) (#9768) + * Fix missing updated time on migrated issues and comments (#9744) (#9764) + * Move Errored PRs out of StatusChecking (#9675) (#9726) + * Make hook status printing configurable with delay (#9641) (#9725) + * ​Fix /repos​/issues​/search (#9698) (#9724) + * Silence fomantic error regarding tabs (#9713) (#9718) + * Remove unused lock (#9709) (#9710) + * Remove q.lock.Unlock() in setInternal to prevent panic (#9705) (#9706) + * Load milestone in API PR list (#9671) (#9700) + * Don't attempt to close issue if already closed (#9696) (#9699) + * Remove google font call (#9668) (#9681) + * Eliminate horizontal scroll caused by footer (#9674) + * Fix nil reference in repo generation (#9660) (#9666) + * Add HTML URL to API Issues (#9654) (#9661) + * Add PR review webhook to Telegram (#9653) (#9655) + * Use filepath.IsAbs instead of path.IsAbs (#9651) (#9652) * Disable remove button on repository teams when have access to all (#9640) * Clean up old references on branch delete (#9614) * Hide public repos owned by private orgs (#9609) @@ -231,6 +246,7 @@ been added to each release, please refer to the [blog](https://blog.gitea.io). * Fix migrate mirror 500 bug (#8526) * Fix password complexity regex for special characters (on master) (#8525) * ENHANCEMENTS + * Explicitly refer to PR in squash-merge commit message in case of external tracker (#9844) (#9855) * Add a /user/login landing page option (#9622) * Some more e-mail notification fixes (#9596) * Add branch protection option to block merge on requested changes. (#9592) @@ -347,12 +363,6 @@ been added to each release, please refer to the [blog](https://blog.gitea.io). * wiki - add 'write' 'preview' buttons to wiki edit like in issues (#7241) * Change target branch for pull request (#6488) * Display PR commits and diffs using base repo rather than forked (#3648) -* SECURITY - * Swagger hide search field (#9554) - * Add "search" to reserved usernames (#9063) - * Switch to fomantic-ui (#9374) - * Only serve attachments when linked to issue/release and if accessible by user (#9340) - * Hide credentials when submitting migration through API (#9102) * TESTING * Add debug option to serv to help debug problems (#9492) * Fix the intermittent TestGPGGit failures (#9360) @@ -366,10 +376,12 @@ been added to each release, please refer to the [blog](https://blog.gitea.io). * Update Github Migration Tests (#8893) (#8938) * Update heatmap fixtures to restore tests (#8615) * TRANSLATION + * Fix Korean locales (#9761) (#9780) * Fix placeholders in the error message (#9060) * Fix spelling of admin.users.max_repo_creation (#8934) * Improve german translation of homepage (#8549) * BUILD + * Fix webpack polyfills (#9735) (#9738) * Update gitea.com/macaron to 1.4.0 (#9608) * Upgrade lato fonts to v16. (#9498) * Update alpine to 3.11 (#9440) @@ -400,6 +412,7 @@ been added to each release, please refer to the [blog](https://blog.gitea.io). * Update the provided gitea.service to mention socket activation (#8531) * Doc added how to setup email (#8520) * MISC + * Backport Locales [2020-01-14] (#9773) * Add translatable Powered by Gitea text in footer (#9600) * Add contrib/environment-to-ini (#9519) * Remove unnecessary loading of settings in update hook (#9496) diff --git a/docs/config.yaml b/docs/config.yaml index cbfcd49e6e..f1cd6abddb 100644 --- a/docs/config.yaml +++ b/docs/config.yaml @@ -18,7 +18,7 @@ params: description: Git with a cup of tea author: The Gitea Authors website: https://docs.gitea.io - version: 1.10.2 + version: 1.11.0 outputs: home: From c95d9603ea45ef985090014bde807fb47e3df931 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 10 Feb 2020 14:09:08 +0100 Subject: [PATCH 077/200] Only check for conflicts/merging if the PR has not been merged in the interim (#10132) (#10206) * Only check for conflicts/merging if the PR has not been merged in the interim (#10132) * Only check for merging if the PR has not been merged in the interim * fixup! Only check for merging if the PR has not been merged in the interim * Try to fix test failure * Use PR2 not PR1 in tests as PR1 merges automatically * return already merged error * enforce locking * move pullrequest checking to after merge This might improve the chance that the race does not affect us but does not prevent it. * Remove minor race with getting merge commit id move check pr after merge * Remove unnecessary prepareTestEnv - onGiteaRun does this for us * Add information about when merging occuring * More logging Co-authored-by: Lauris BH Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> * re order Co-authored-by: zeripath Co-authored-by: Lauris BH Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> --- integrations/pull_merge_test.go | 10 +---- models/pull.go | 68 +++++++++++++++++++++++---------- services/pull/check.go | 8 ++-- services/pull/check_test.go | 4 +- services/pull/merge.go | 17 +++++++-- 5 files changed, 70 insertions(+), 37 deletions(-) diff --git a/integrations/pull_merge_test.go b/integrations/pull_merge_test.go index 218f0e4da6..5a9283edcf 100644 --- a/integrations/pull_merge_test.go +++ b/integrations/pull_merge_test.go @@ -105,8 +105,6 @@ func TestPullRebase(t *testing.T) { func TestPullRebaseMerge(t *testing.T) { onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) { - defer prepareTestEnv(t)() - hookTasks, err := models.HookTasks(1, 1) //Retrieve previous hook number assert.NoError(t, err) hookTasksLenBefore := len(hookTasks) @@ -129,8 +127,6 @@ func TestPullRebaseMerge(t *testing.T) { func TestPullSquash(t *testing.T) { onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) { - defer prepareTestEnv(t)() - hookTasks, err := models.HookTasks(1, 1) //Retrieve previous hook number assert.NoError(t, err) hookTasksLenBefore := len(hookTasks) @@ -154,10 +150,9 @@ func TestPullSquash(t *testing.T) { func TestPullCleanUpAfterMerge(t *testing.T) { onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) { - defer prepareTestEnv(t)() session := loginUser(t, "user1") testRepoFork(t, session, "user2", "repo1", "user1", "repo1") - testEditFileToNewBranch(t, session, "user1", "repo1", "master", "feature/test", "README.md", "Hello, World (Edited)\n") + testEditFileToNewBranch(t, session, "user1", "repo1", "master", "feature/test", "README.md", "Hello, World (Edited - TestPullCleanUpAfterMerge)\n") resp := testPullCreate(t, session, "user1", "repo1", "feature/test", "This is a pull title") @@ -190,7 +185,6 @@ func TestPullCleanUpAfterMerge(t *testing.T) { func TestCantMergeWorkInProgress(t *testing.T) { onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) { - defer prepareTestEnv(t)() session := loginUser(t, "user1") testRepoFork(t, session, "user2", "repo1", "user1", "repo1") testEditFile(t, session, "user1", "repo1", "master", "README.md", "Hello, World (Edited)\n") @@ -212,7 +206,6 @@ func TestCantMergeWorkInProgress(t *testing.T) { func TestCantMergeConflict(t *testing.T) { onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) { - defer prepareTestEnv(t)() session := loginUser(t, "user1") testRepoFork(t, session, "user2", "repo1", "user1", "repo1") testEditFileToNewBranch(t, session, "user1", "repo1", "master", "conflict", "README.md", "Hello, World (Edited Once)\n") @@ -258,7 +251,6 @@ func TestCantMergeConflict(t *testing.T) { func TestCantMergeUnrelated(t *testing.T) { onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) { - defer prepareTestEnv(t)() session := loginUser(t, "user1") testRepoFork(t, session, "user2", "repo1", "user1", "repo1") testEditFileToNewBranch(t, session, "user1", "repo1", "master", "base", "README.md", "Hello, World (Edited Twice)\n") diff --git a/models/pull.go b/models/pull.go index 9df5b90fc4..d165fde5f1 100644 --- a/models/pull.go +++ b/models/pull.go @@ -649,44 +649,66 @@ func (pr *PullRequest) CheckUserAllowedToMerge(doer *User) (err error) { } // SetMerged sets a pull request to merged and closes the corresponding issue -func (pr *PullRequest) SetMerged() (err error) { +func (pr *PullRequest) SetMerged() (bool, error) { if pr.HasMerged { - return fmt.Errorf("PullRequest[%d] already merged", pr.Index) + return false, fmt.Errorf("PullRequest[%d] already merged", pr.Index) } if pr.MergedCommitID == "" || pr.MergedUnix == 0 || pr.Merger == nil { - return fmt.Errorf("Unable to merge PullRequest[%d], some required fields are empty", pr.Index) + return false, fmt.Errorf("Unable to merge PullRequest[%d], some required fields are empty", pr.Index) } pr.HasMerged = true sess := x.NewSession() defer sess.Close() - if err = sess.Begin(); err != nil { - return err + if err := sess.Begin(); err != nil { + return false, err } - if err = pr.loadIssue(sess); err != nil { - return err + if _, err := sess.Exec("UPDATE `issue` SET `repo_id` = `repo_id` WHERE `id` = ?", pr.IssueID); err != nil { + return false, err } - if err = pr.Issue.loadRepo(sess); err != nil { - return err - } - if err = pr.Issue.Repo.getOwner(sess); err != nil { - return err + if _, err := sess.Exec("UPDATE `pull_request` SET `issue_id` = `issue_id` WHERE `id` = ?", pr.ID); err != nil { + return false, err } - if _, err = pr.Issue.changeStatus(sess, pr.Merger, true); err != nil { - return fmt.Errorf("Issue.changeStatus: %v", err) - } - if _, err = sess.ID(pr.ID).Cols("has_merged, status, merged_commit_id, merger_id, merged_unix").Update(pr); err != nil { - return fmt.Errorf("update pull request: %v", err) + pr.Issue = nil + if err := pr.loadIssue(sess); err != nil { + return false, err } - if err = sess.Commit(); err != nil { - return fmt.Errorf("Commit: %v", err) + if tmpPr, err := getPullRequestByID(sess, pr.ID); err != nil { + return false, err + } else if tmpPr.HasMerged { + if pr.Issue.IsClosed { + return false, nil + } + return false, fmt.Errorf("PullRequest[%d] already merged but it's associated issue [%d] is not closed", pr.Index, pr.IssueID) + } else if pr.Issue.IsClosed { + return false, fmt.Errorf("PullRequest[%d] already closed", pr.Index) } - return nil + + if err := pr.Issue.loadRepo(sess); err != nil { + return false, err + } + + if err := pr.Issue.Repo.getOwner(sess); err != nil { + return false, err + } + + if _, err := pr.Issue.changeStatus(sess, pr.Merger, true); err != nil { + return false, fmt.Errorf("Issue.changeStatus: %v", err) + } + + if _, err := sess.Where("id = ?", pr.ID).Cols("has_merged, status, merged_commit_id, merger_id, merged_unix").Update(pr); err != nil { + return false, fmt.Errorf("Failed to update pr[%d]: %v", pr.ID, err) + } + + if err := sess.Commit(); err != nil { + return false, fmt.Errorf("Commit: %v", err) + } + return true, nil } // NewPullRequest creates new pull request with labels for repository. @@ -845,6 +867,12 @@ func (pr *PullRequest) UpdateCols(cols ...string) error { return err } +// UpdateColsIfNotMerged updates specific fields of a pull request if it has not been merged +func (pr *PullRequest) UpdateColsIfNotMerged(cols ...string) error { + _, err := x.Where("id = ? AND has_merged = ?", pr.ID, false).Cols(cols...).Update(pr) + return err +} + // IsWorkInProgress determine if the Pull Request is a Work In Progress by its title func (pr *PullRequest) IsWorkInProgress() bool { if err := pr.LoadIssue(); err != nil { diff --git a/services/pull/check.go b/services/pull/check.go index 055403d0df..56561b7bbd 100644 --- a/services/pull/check.go +++ b/services/pull/check.go @@ -31,7 +31,7 @@ var pullRequestQueue = sync.NewUniqueQueue(setting.Repository.PullRequestQueueLe func AddToTaskQueue(pr *models.PullRequest) { go pullRequestQueue.AddFunc(pr.ID, func() { pr.Status = models.PullRequestStatusChecking - if err := pr.UpdateCols("status"); err != nil { + if err := pr.UpdateColsIfNotMerged("status"); err != nil { log.Error("AddToTaskQueue.UpdateCols[%d].(add to queue): %v", pr.ID, err) } }) @@ -142,9 +142,11 @@ func manuallyMerged(pr *models.PullRequest) bool { pr.Merger = merger pr.MergerID = merger.ID - if err = pr.SetMerged(); err != nil { + if merged, err := pr.SetMerged(); err != nil { log.Error("PullRequest[%d].setMerged : %v", pr.ID, err) return false + } else if !merged { + return false } baseGitRepo, err := git.OpenRepository(pr.BaseRepo.RepoPath()) @@ -194,7 +196,7 @@ func TestPullRequests(ctx context.Context) { if err != nil { log.Error("GetPullRequestByID[%s]: %v", prID, err) continue - } else if pr.Status != models.PullRequestStatusChecking { + } else if pr.HasMerged { continue } else if manuallyMerged(pr) { continue diff --git a/services/pull/check_test.go b/services/pull/check_test.go index 48a7774a61..043090249a 100644 --- a/services/pull/check_test.go +++ b/services/pull/check_test.go @@ -18,7 +18,7 @@ import ( func TestPullRequest_AddToTaskQueue(t *testing.T) { assert.NoError(t, models.PrepareTestDatabase()) - pr := models.AssertExistsAndLoadBean(t, &models.PullRequest{ID: 1}).(*models.PullRequest) + pr := models.AssertExistsAndLoadBean(t, &models.PullRequest{ID: 2}).(*models.PullRequest) AddToTaskQueue(pr) select { @@ -29,6 +29,6 @@ func TestPullRequest_AddToTaskQueue(t *testing.T) { } assert.True(t, pullRequestQueue.Exist(pr.ID)) - pr = models.AssertExistsAndLoadBean(t, &models.PullRequest{ID: 1}).(*models.PullRequest) + pr = models.AssertExistsAndLoadBean(t, &models.PullRequest{ID: 2}).(*models.PullRequest) assert.Equal(t, models.PullRequestStatusChecking, pr.Status) } diff --git a/services/pull/merge.go b/services/pull/merge.go index 65a781e54c..3958216b5c 100644 --- a/services/pull/merge.go +++ b/services/pull/merge.go @@ -341,19 +341,30 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor outbuf.Reset() errbuf.Reset() - pr.MergedCommitID, err = baseGitRepo.GetBranchCommitID(pr.BaseBranch) + pr.MergedCommitID, err = git.GetFullCommitID(tmpBasePath, baseBranch) if err != nil { - return fmt.Errorf("GetBranchCommit: %v", err) + return fmt.Errorf("Failed to get full commit id for the new merge: %v", err) } pr.MergedUnix = timeutil.TimeStampNow() pr.Merger = doer pr.MergerID = doer.ID - if err = pr.SetMerged(); err != nil { + if _, err = pr.SetMerged(); err != nil { log.Error("setMerged [%d]: %v", pr.ID, err) } + if err := pr.LoadIssue(); err != nil { + log.Error("loadIssue [%d]: %v", pr.ID, err) + } + + if err := pr.Issue.LoadRepo(); err != nil { + log.Error("loadRepo for issue [%d]: %v", pr.ID, err) + } + if err := pr.Issue.Repo.GetOwner(); err != nil { + log.Error("GetOwner for issue repo [%d]: %v", pr.ID, err) + } + notification.NotifyMergePullRequest(pr, doer, baseGitRepo) // Reset cached commit count From 8efd6b32e2ecbd5c6933242cb0bb66612ecbad24 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Tue, 11 Feb 2020 05:10:12 +0200 Subject: [PATCH 078/200] Fix commit between two commits calculation if there is only last commit (#10225) (#10226) --- modules/git/repo_commit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/git/repo_commit.go b/modules/git/repo_commit.go index 8762b63e2e..d95c67791b 100644 --- a/modules/git/repo_commit.go +++ b/modules/git/repo_commit.go @@ -318,7 +318,7 @@ func (repo *Repository) CommitsBetween(last *Commit, before *Commit) (*list.List var stdout []byte var err error if before == nil { - stdout, err = NewCommand("rev-list", before.ID.String()).RunInDirBytes(repo.Path) + stdout, err = NewCommand("rev-list", last.ID.String()).RunInDirBytes(repo.Path) } else { stdout, err = NewCommand("rev-list", before.ID.String()+"..."+last.ID.String()).RunInDirBytes(repo.Path) } From cb81e39f7a219d850ce0d8ec8f70669770a0ee8f Mon Sep 17 00:00:00 2001 From: James Lakin Date: Tue, 11 Feb 2020 21:26:33 +0000 Subject: [PATCH 079/200] Fix issue sidebar menus having an infinite height (#10240) --- web_src/less/_repository.less | 1 + 1 file changed, 1 insertion(+) diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index cd35b88f3b..9dde108ea6 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -89,6 +89,7 @@ .metas { .menu { overflow-x: auto; + max-height: 300px; } .ui.list { From 1cd6233cef9f7fcefb200f82f9d0990e45684aa5 Mon Sep 17 00:00:00 2001 From: jaqra <48099350+jaqra@users.noreply.github.com> Date: Wed, 12 Feb 2020 02:39:06 +0300 Subject: [PATCH 080/200] fix filter label emoji width (#10241) (#10244) --- web_src/less/_repository.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 9dde108ea6..e03e45222d 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -2067,6 +2067,10 @@ vertical-align: middle; } +.ui.menu .item > img:not(.ui) { + width: auto; +} + .issue.list { list-style: none; From 5cdfde2ebfd958e1e33519da3e0409029231b978 Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 12 Feb 2020 10:22:10 +0000 Subject: [PATCH 081/200] Stop hanging issue indexer initialisation from preventing shutdown (#10243) (#10249) Co-authored-by: Lauris BH Co-authored-by: Antoine GIRARD --- modules/indexer/issues/indexer.go | 32 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/modules/indexer/issues/indexer.go b/modules/indexer/issues/indexer.go index 894f37a963..8321cafc80 100644 --- a/modules/indexer/issues/indexer.go +++ b/modules/indexer/issues/indexer.go @@ -143,25 +143,23 @@ func InitIssueIndexer(syncReindex bool) { var populate bool switch setting.Indexer.IssueType { case "bleve": - graceful.GetManager().RunWithShutdownFns(func(_, atTerminate func(context.Context, func())) { - issueIndexer := NewBleveIndexer(setting.Indexer.IssuePath) - exist, err := issueIndexer.Init() - if err != nil { - holder.cancel() - log.Fatal("Unable to initialize Bleve Issue Indexer: %v", err) + issueIndexer := NewBleveIndexer(setting.Indexer.IssuePath) + exist, err := issueIndexer.Init() + if err != nil { + holder.cancel() + log.Fatal("Unable to initialize Bleve Issue Indexer: %v", err) + } + populate = !exist + holder.set(issueIndexer) + graceful.GetManager().RunAtTerminate(context.Background(), func() { + log.Debug("Closing issue indexer") + issueIndexer := holder.get() + if issueIndexer != nil { + issueIndexer.Close() } - populate = !exist - holder.set(issueIndexer) - atTerminate(context.Background(), func() { - log.Debug("Closing issue indexer") - issueIndexer := holder.get() - if issueIndexer != nil { - issueIndexer.Close() - } - log.Info("PID: %d Issue Indexer closed", os.Getpid()) - }) - log.Debug("Created Bleve Indexer") + log.Info("PID: %d Issue Indexer closed", os.Getpid()) }) + log.Debug("Created Bleve Indexer") case "db": issueIndexer := &DBIndexer{} holder.set(issueIndexer) From 987cd277f69f8f3b76f51109f638e2b1124c2dec Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 13 Feb 2020 17:32:30 +0800 Subject: [PATCH 082/200] Fix reply on code review (#10227) (#10257) Co-authored-by: zeripath Co-authored-by: zeripath --- templates/repo/diff/comment_form.tmpl | 3 ++- web_src/js/index.js | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl index 573e7d4638..69b7039f89 100644 --- a/templates/repo/diff/comment_form.tmpl +++ b/templates/repo/diff/comment_form.tmpl @@ -26,7 +26,8 @@ {{$.root.i18n.Tr "repo.diff.comment.markdown_info"}}
    {{if $.reply}} - + + {{else}} {{if $.root.CurrentReview}} diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index e03e45222d..e75fb0fae7 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -2351,7 +2351,7 @@ tbody.commit-list { vertical-align: baseline; } -.commit-list .message-wrapper { +.message-wrapper { overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 50px); @@ -2359,6 +2359,43 @@ tbody.commit-list { vertical-align: middle; } +@media only screen and (max-width: 767.98px) { + tr.commit-list { + width: 100%; + } + th .message-wrapper { + display: block; + max-width: calc(100vw - 70px); + } +} + +@media only screen and (min-width: 768px) and (max-width: 991.98px) { + tr.commit-list { + width: 723px; + } + th .message-wrapper { + max-width: 280px; + } +} + +@media only screen and (min-width: 992px) and (max-width: 1199.98px) { + tr.commit-list { + width: 933px; + } + th .message-wrapper { + max-width: 490px; + } +} + +@media only screen and (min-width: 1200px) { + tr.commit-list { + width: 1127px; + } + th .message-wrapper { + max-width: 680px; + } +} + .commit-list .commit-summary a { text-decoration: underline; text-decoration-style: dashed; From 457ee1ab5a3abf5da16f6f90f5fcc115323af687 Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Tue, 18 Feb 2020 13:34:50 -0600 Subject: [PATCH 094/200] Fix status check enable (#10341) (#10343) Signed-off-by: jolheiser --- web_src/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/index.js b/web_src/js/index.js index 2e2e1d1e9c..b654af2c73 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -1105,7 +1105,7 @@ function initRepository() { // Branches if ($('.repository.settings.branches').length > 0) { initFilterSearchDropdown('.protected-branches .dropdown'); - $('.enable-protection, .enable-whitelist').change(function () { + $('.enable-protection, .enable-whitelist, .enable-statuscheck').change(function () { if (this.checked) { $($(this).data('target')).removeClass('disabled'); } else { From df5f1d9dca6cd995aa8e71df896c8c4689f1ee1a Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 18 Feb 2020 20:04:10 +0000 Subject: [PATCH 095/200] Prevent nil pointer in GetPullRequestCommitStatusState (#10342) (#10344) Backport #10344 Ensure that pr.HeadRepo is loaded before using it in GetPullRequestCommitStatusState. Fixes error on merging with successful commit merge statuses. --- services/pull/commit_status.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/pull/commit_status.go b/services/pull/commit_status.go index 77aca48556..a4803bfb9f 100644 --- a/services/pull/commit_status.go +++ b/services/pull/commit_status.go @@ -91,6 +91,11 @@ func IsPullCommitStatusPass(pr *models.PullRequest) (bool, error) { // GetPullRequestCommitStatusState returns pull request merged commit status state func GetPullRequestCommitStatusState(pr *models.PullRequest) (structs.CommitStatusState, error) { + // Ensure HeadRepo is loaded + if err := pr.LoadHeadRepo(); err != nil { + return "", errors.Wrap(err, "LoadHeadRepo") + } + // check if all required status checks are successful headGitRepo, err := git.OpenRepository(pr.HeadRepo.RepoPath()) if err != nil { From 3e40f8bebc98009259ec822b94759c25f43d3024 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 19 Feb 2020 01:59:14 +0100 Subject: [PATCH 096/200] Set max-width on review-box comment box (#10348) (#10353) Co-authored-by: zeripath --- web_src/less/_review.less | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/web_src/less/_review.less b/web_src/less/_review.less index a5e299accc..475fa59656 100644 --- a/web_src/less/_review.less +++ b/web_src/less/_review.less @@ -132,3 +132,36 @@ .ui.blob-excerpt:hover { color: #428bca; } + +@media only screen and (max-width: 768px) { + #review-box > .menu { + > .ui.segment { + width: 94vw; + } + .editor-toolbar { + overflow-x: auto; + } + } + + #review-box .CodeMirror-scroll { + max-width: calc(100vw - 70px); + } +} + +@media only screen and (min-width: 768px) and (max-width: 992px) { + #review-box .CodeMirror-scroll { + max-width: 700px; + } +} + +@media only screen and (min-width: 992px) and (max-width: 1200px) { + #review-box .CodeMirror-scroll { + max-width: 800px; + } +} + +@media only screen and (min-width: 1200px) { + #review-box .CodeMirror-scroll { + max-width: 900px; + } +} From 14bd120cdc5dab2a7c854346b7f4bf69507627ae Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Wed, 19 Feb 2020 00:02:50 -0300 Subject: [PATCH 097/200] Reading pull attachments should depend on read UnitTypePullRequests (#10346) (#10354) Co-authored-by: zeripath --- models/attachment.go | 6 +++++- models/attachment_test.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/models/attachment.go b/models/attachment.go index 6cfa6cb64e..81f2e15dad 100644 --- a/models/attachment.go +++ b/models/attachment.go @@ -79,7 +79,11 @@ func (a *Attachment) LinkedRepository() (*Repository, UnitType, error) { return nil, UnitTypeIssues, err } repo, err := GetRepositoryByID(iss.RepoID) - return repo, UnitTypeIssues, err + unitType := UnitTypeIssues + if iss.IsPull { + unitType = UnitTypePullRequests + } + return repo, unitType, err } else if a.ReleaseID != 0 { rel, err := GetReleaseByID(a.ReleaseID) if err != nil { diff --git a/models/attachment_test.go b/models/attachment_test.go index ddb6abad32..7d681e0519 100644 --- a/models/attachment_test.go +++ b/models/attachment_test.go @@ -138,7 +138,7 @@ func TestLinkedRepository(t *testing.T) { expectedUnitType UnitType }{ {"LinkedIssue", 1, &Repository{ID: 1}, UnitTypeIssues}, - {"LinkedComment", 3, &Repository{ID: 1}, UnitTypeIssues}, + {"LinkedComment", 3, &Repository{ID: 1}, UnitTypePullRequests}, {"LinkedRelease", 9, &Repository{ID: 1}, UnitTypeReleases}, {"Notlinked", 10, nil, -1}, } From 34e3644adacd0823b18969517a3dafb29b0bd303 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 20 Feb 2020 22:52:19 +0800 Subject: [PATCH 098/200] Fix wrong num closed issues on repository when close issue via commit (#10364) (#10380) Co-authored-by: Lauris BH Co-authored-by: Lauris BH --- integrations/api_issue_test.go | 22 +++++++++++++++------- models/issue.go | 4 ++++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/integrations/api_issue_test.go b/integrations/api_issue_test.go index ce1c4b7d33..ed96b58bc9 100644 --- a/integrations/api_issue_test.go +++ b/integrations/api_issue_test.go @@ -39,12 +39,12 @@ func TestAPICreateIssue(t *testing.T) { defer prepareTestEnv(t)() const body, title = "apiTestBody", "apiTestTitle" - repo := models.AssertExistsAndLoadBean(t, &models.Repository{ID: 1}).(*models.Repository) - owner := models.AssertExistsAndLoadBean(t, &models.User{ID: repo.OwnerID}).(*models.User) + repoBefore := models.AssertExistsAndLoadBean(t, &models.Repository{ID: 1}).(*models.Repository) + owner := models.AssertExistsAndLoadBean(t, &models.User{ID: repoBefore.OwnerID}).(*models.User) session := loginUser(t, owner.Name) token := getTokenForLoggedInUser(t, session) - urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/issues?state=all&token=%s", owner.Name, repo.Name, token) + urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/issues?state=all&token=%s", owner.Name, repoBefore.Name, token) req := NewRequestWithJSON(t, "POST", urlStr, &api.CreateIssueOption{ Body: body, Title: title, @@ -57,19 +57,23 @@ func TestAPICreateIssue(t *testing.T) { assert.Equal(t, apiIssue.Title, title) models.AssertExistsAndLoadBean(t, &models.Issue{ - RepoID: repo.ID, + RepoID: repoBefore.ID, AssigneeID: owner.ID, Content: body, Title: title, }) + + repoAfter := models.AssertExistsAndLoadBean(t, &models.Repository{ID: 1}).(*models.Repository) + assert.Equal(t, repoBefore.NumIssues+1, repoAfter.NumIssues) + assert.Equal(t, repoBefore.NumClosedIssues, repoAfter.NumClosedIssues) } func TestAPIEditIssue(t *testing.T) { defer prepareTestEnv(t)() issueBefore := models.AssertExistsAndLoadBean(t, &models.Issue{ID: 10}).(*models.Issue) - repo := models.AssertExistsAndLoadBean(t, &models.Repository{ID: issueBefore.RepoID}).(*models.Repository) - owner := models.AssertExistsAndLoadBean(t, &models.User{ID: repo.OwnerID}).(*models.User) + repoBefore := models.AssertExistsAndLoadBean(t, &models.Repository{ID: issueBefore.RepoID}).(*models.Repository) + owner := models.AssertExistsAndLoadBean(t, &models.User{ID: repoBefore.OwnerID}).(*models.User) assert.NoError(t, issueBefore.LoadAttributes()) assert.Equal(t, int64(1019307200), int64(issueBefore.DeadlineUnix)) assert.Equal(t, api.StateOpen, issueBefore.State()) @@ -84,7 +88,7 @@ func TestAPIEditIssue(t *testing.T) { body := "new content!" title := "new title from api set" - urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/issues/%d?token=%s", owner.Name, repo.Name, issueBefore.Index, token) + urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/issues/%d?token=%s", owner.Name, repoBefore.Name, issueBefore.Index, token) req := NewRequestWithJSON(t, "PATCH", urlStr, api.EditIssueOption{ State: &issueState, RemoveDeadline: &removeDeadline, @@ -99,6 +103,7 @@ func TestAPIEditIssue(t *testing.T) { DecodeJSON(t, resp, &apiIssue) issueAfter := models.AssertExistsAndLoadBean(t, &models.Issue{ID: 10}).(*models.Issue) + repoAfter := models.AssertExistsAndLoadBean(t, &models.Repository{ID: issueBefore.RepoID}).(*models.Repository) // check deleted user assert.Equal(t, int64(500), issueAfter.PosterID) @@ -107,6 +112,9 @@ func TestAPIEditIssue(t *testing.T) { assert.Equal(t, int64(-1), issueBefore.PosterID) assert.Equal(t, int64(-1), apiIssue.Poster.ID) + // check repo change + assert.Equal(t, repoBefore.NumClosedIssues+1, repoAfter.NumClosedIssues) + // API response assert.Equal(t, api.StateClosed, apiIssue.State) assert.Equal(t, milestone, apiIssue.Milestone.ID) diff --git a/models/issue.go b/models/issue.go index 5d6c9a83e2..de3243cd58 100644 --- a/models/issue.go +++ b/models/issue.go @@ -673,6 +673,10 @@ func (issue *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (*C return nil, err } + if err := issue.updateClosedNum(e); err != nil { + return nil, err + } + // New action comment cmtType := CommentTypeClose if !issue.IsClosed { From 3cee15e6f9931df6c009dd802a4e12ea494286fc Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Fri, 21 Feb 2020 10:35:17 -0300 Subject: [PATCH 099/200] Ensure only own addresses are updated (#10397) (#10399) --- models/user.go | 2 +- models/user_mail.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/user.go b/models/user.go index 5760bab57d..c515bd222b 100644 --- a/models/user.go +++ b/models/user.go @@ -989,7 +989,7 @@ func VerifyActiveEmailCode(code, email string) *EmailAddress { data := com.ToStr(user.ID) + email + user.LowerName + user.Passwd + user.Rands if base.VerifyTimeLimitCode(data, minutes, prefix) { - emailAddress := &EmailAddress{Email: email} + emailAddress := &EmailAddress{UID: user.ID, Email: email} if has, _ := x.Get(emailAddress); has { return emailAddress } diff --git a/models/user_mail.go b/models/user_mail.go index d929ba5a5d..41f08c9db2 100644 --- a/models/user_mail.go +++ b/models/user_mail.go @@ -201,7 +201,7 @@ func MakeEmailPrimary(email *EmailAddress) error { } // Make sure the former primary email doesn't disappear. - formerPrimaryEmail := &EmailAddress{Email: user.Email} + formerPrimaryEmail := &EmailAddress{UID: user.ID, Email: user.Email} has, err = x.Get(formerPrimaryEmail) if err != nil { return err From 919f3f11e2922d84025a436ec6cb328a8db78ffa Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Fri, 21 Feb 2020 11:27:19 -0300 Subject: [PATCH 100/200] update crypto vendors (#10398) Co-authored-by: @techknowlogick --- go.mod | 4 +- go.sum | 8 +- vendor/golang.org/x/crypto/acme/acme.go | 7 +- .../x/crypto/acme/autocert/listener.go | 2 - .../x/crypto/openpgp/armor/armor.go | 21 +- .../golang.org/x/crypto/poly1305/sum_arm.go | 19 - vendor/golang.org/x/crypto/poly1305/sum_arm.s | 427 ------------------ .../golang.org/x/crypto/poly1305/sum_noasm.go | 2 +- .../ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go | 93 ++++ vendor/golang.org/x/crypto/ssh/keys.go | 170 ++++++- vendor/golang.org/x/sys/cpu/cpu_arm64.go | 138 ++++++ vendor/golang.org/x/sys/cpu/cpu_arm64.s | 31 ++ vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go | 11 + .../golang.org/x/sys/cpu/cpu_gccgo_arm64.go | 11 + .../sys/cpu/{cpu_gccgo.c => cpu_gccgo_x86.c} | 0 .../cpu/{cpu_gccgo.go => cpu_gccgo_x86.go} | 0 vendor/golang.org/x/sys/cpu/cpu_linux.go | 48 +- .../golang.org/x/sys/cpu/cpu_linux_arm64.go | 8 +- .../golang.org/x/sys/cpu/cpu_other_arm64.go | 2 +- vendor/golang.org/x/sys/cpu/hwcap_linux.go | 56 +++ .../golang.org/x/sys/unix/asm_linux_riscv64.s | 7 - vendor/golang.org/x/sys/unix/fcntl.go | 12 +- vendor/golang.org/x/sys/unix/mkall.sh | 2 +- vendor/golang.org/x/sys/unix/mkerrors.sh | 4 +- vendor/golang.org/x/sys/unix/syscall_bsd.go | 19 +- .../golang.org/x/sys/unix/syscall_darwin.go | 19 +- .../x/sys/unix/syscall_darwin_arm.1_11.go | 2 +- .../golang.org/x/sys/unix/syscall_freebsd.go | 6 - .../x/sys/unix/syscall_freebsd_386.go | 6 + .../x/sys/unix/syscall_freebsd_amd64.go | 6 + .../x/sys/unix/syscall_freebsd_arm.go | 6 + .../x/sys/unix/syscall_freebsd_arm64.go | 6 + vendor/golang.org/x/sys/unix/syscall_linux.go | 157 ++++++- .../x/sys/unix/syscall_linux_386.go | 4 +- .../x/sys/unix/syscall_linux_amd64.go | 4 +- .../x/sys/unix/syscall_linux_arm.go | 4 +- .../x/sys/unix/syscall_linux_arm64.go | 4 +- .../x/sys/unix/syscall_linux_mips64x.go | 8 +- .../x/sys/unix/syscall_linux_mipsx.go | 4 +- .../x/sys/unix/syscall_linux_ppc64x.go | 4 +- .../x/sys/unix/syscall_linux_riscv64.go | 4 +- .../x/sys/unix/syscall_linux_s390x.go | 4 +- .../x/sys/unix/syscall_linux_sparc64.go | 4 +- .../golang.org/x/sys/unix/syscall_netbsd.go | 28 +- .../golang.org/x/sys/unix/syscall_openbsd.go | 29 +- .../x/sys/unix/zerrors_linux_386.go | 53 ++- .../x/sys/unix/zerrors_linux_amd64.go | 53 ++- .../x/sys/unix/zerrors_linux_arm.go | 53 ++- .../x/sys/unix/zerrors_linux_arm64.go | 53 ++- .../x/sys/unix/zerrors_linux_mips.go | 53 ++- .../x/sys/unix/zerrors_linux_mips64.go | 53 ++- .../x/sys/unix/zerrors_linux_mips64le.go | 53 ++- .../x/sys/unix/zerrors_linux_mipsle.go | 53 ++- .../x/sys/unix/zerrors_linux_ppc64.go | 54 ++- .../x/sys/unix/zerrors_linux_ppc64le.go | 54 ++- .../x/sys/unix/zerrors_linux_riscv64.go | 53 ++- .../x/sys/unix/zerrors_linux_s390x.go | 53 ++- .../x/sys/unix/zerrors_linux_sparc64.go | 54 ++- ...acearm_linux.go => zptrace_armnn_linux.go} | 2 +- .../x/sys/unix/zptrace_linux_arm64.go | 17 + ...emips_linux.go => zptrace_mipsnn_linux.go} | 2 +- ...sle_linux.go => zptrace_mipsnnle_linux.go} | 2 +- ...trace386_linux.go => zptrace_x86_linux.go} | 2 +- .../x/sys/unix/zsyscall_darwin_386.1_11.go | 22 +- .../x/sys/unix/zsyscall_darwin_386.go | 32 +- .../x/sys/unix/zsyscall_darwin_386.s | 6 +- .../x/sys/unix/zsyscall_darwin_amd64.1_11.go | 22 +- .../x/sys/unix/zsyscall_darwin_amd64.go | 32 +- .../x/sys/unix/zsyscall_darwin_amd64.s | 4 +- .../x/sys/unix/zsyscall_darwin_arm.1_11.go | 22 +- .../x/sys/unix/zsyscall_darwin_arm.go | 32 +- .../x/sys/unix/zsyscall_darwin_arm.s | 6 +- .../x/sys/unix/zsyscall_darwin_arm64.1_11.go | 22 +- .../x/sys/unix/zsyscall_darwin_arm64.go | 32 +- .../x/sys/unix/zsyscall_darwin_arm64.s | 6 +- .../x/sys/unix/zsyscall_dragonfly_amd64.go | 11 - .../x/sys/unix/zsyscall_freebsd_386.go | 11 - .../x/sys/unix/zsyscall_freebsd_amd64.go | 11 - .../x/sys/unix/zsyscall_freebsd_arm.go | 11 - .../x/sys/unix/zsyscall_freebsd_arm64.go | 11 - .../x/sys/unix/zsyscall_linux_386.go | 127 +++++- .../x/sys/unix/zsyscall_linux_amd64.go | 127 +++++- .../x/sys/unix/zsyscall_linux_arm.go | 127 +++++- .../x/sys/unix/zsyscall_linux_arm64.go | 127 +++++- .../x/sys/unix/zsyscall_linux_mips.go | 127 +++++- .../x/sys/unix/zsyscall_linux_mips64.go | 127 +++++- .../x/sys/unix/zsyscall_linux_mips64le.go | 127 +++++- .../x/sys/unix/zsyscall_linux_mipsle.go | 127 +++++- .../x/sys/unix/zsyscall_linux_ppc64.go | 127 +++++- .../x/sys/unix/zsyscall_linux_ppc64le.go | 127 +++++- .../x/sys/unix/zsyscall_linux_riscv64.go | 127 +++++- .../x/sys/unix/zsyscall_linux_s390x.go | 127 +++++- .../x/sys/unix/zsyscall_linux_sparc64.go | 127 +++++- .../x/sys/unix/zsyscall_netbsd_386.go | 78 ++-- .../x/sys/unix/zsyscall_netbsd_amd64.go | 78 ++-- .../x/sys/unix/zsyscall_netbsd_arm.go | 78 ++-- .../x/sys/unix/zsyscall_netbsd_arm64.go | 78 ++-- .../x/sys/unix/zsyscall_openbsd_386.go | 57 ++- .../x/sys/unix/zsyscall_openbsd_amd64.go | 57 ++- .../x/sys/unix/zsyscall_openbsd_arm.go | 57 ++- .../x/sys/unix/zsyscall_openbsd_arm64.go | 57 ++- .../x/sys/unix/zsysnum_linux_arm64.go | 1 + .../x/sys/unix/ztypes_dragonfly_amd64.go | 10 + .../x/sys/unix/ztypes_freebsd_386.go | 12 +- .../x/sys/unix/ztypes_freebsd_amd64.go | 12 +- .../x/sys/unix/ztypes_freebsd_arm.go | 12 +- .../x/sys/unix/ztypes_freebsd_arm64.go | 12 +- .../golang.org/x/sys/unix/ztypes_linux_386.go | 4 +- .../x/sys/unix/ztypes_linux_amd64.go | 4 +- .../golang.org/x/sys/unix/ztypes_linux_arm.go | 4 +- .../x/sys/unix/ztypes_linux_arm64.go | 4 +- .../x/sys/unix/ztypes_linux_mips.go | 4 +- .../x/sys/unix/ztypes_linux_mips64.go | 4 +- .../x/sys/unix/ztypes_linux_mips64le.go | 4 +- .../x/sys/unix/ztypes_linux_mipsle.go | 4 +- .../x/sys/unix/ztypes_linux_ppc64.go | 4 +- .../x/sys/unix/ztypes_linux_ppc64le.go | 4 +- .../x/sys/unix/ztypes_linux_riscv64.go | 4 +- .../x/sys/unix/ztypes_linux_s390x.go | 4 +- .../x/sys/unix/ztypes_linux_sparc64.go | 4 +- .../x/sys/unix/ztypes_netbsd_386.go | 32 ++ .../x/sys/unix/ztypes_netbsd_amd64.go | 33 ++ .../x/sys/unix/ztypes_netbsd_arm.go | 32 ++ .../x/sys/unix/ztypes_netbsd_arm64.go | 33 ++ .../x/sys/unix/ztypes_solaris_amd64.go | 7 + .../x/sys/windows/syscall_windows.go | 23 +- .../golang.org/x/sys/windows/types_windows.go | 19 +- .../x/sys/windows/zsyscall_windows.go | 35 ++ vendor/modules.txt | 5 +- 129 files changed, 3568 insertions(+), 1374 deletions(-) delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_arm.go delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_arm.s create mode 100644 vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_arm64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_arm64.s create mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go rename vendor/golang.org/x/sys/cpu/{cpu_gccgo.c => cpu_gccgo_x86.c} (100%) rename vendor/golang.org/x/sys/cpu/{cpu_gccgo.go => cpu_gccgo_x86.go} (100%) create mode 100644 vendor/golang.org/x/sys/cpu/hwcap_linux.go rename vendor/golang.org/x/sys/unix/{zptracearm_linux.go => zptrace_armnn_linux.go} (93%) create mode 100644 vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go rename vendor/golang.org/x/sys/unix/{zptracemips_linux.go => zptrace_mipsnn_linux.go} (93%) rename vendor/golang.org/x/sys/unix/{zptracemipsle_linux.go => zptrace_mipsnnle_linux.go} (93%) rename vendor/golang.org/x/sys/unix/{zptrace386_linux.go => zptrace_x86_linux.go} (95%) diff --git a/go.mod b/go.mod index 8af6890691..eb7acc4a32 100644 --- a/go.mod +++ b/go.mod @@ -95,10 +95,10 @@ require ( github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53 github.com/yuin/goldmark v1.1.19 go.etcd.io/bbolt v1.3.3 // indirect - golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 + golang.org/x/crypto v0.0.0-20200219234226-1ad67e1f0ef4 golang.org/x/net v0.0.0-20191101175033-0deb6923b6d9 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 - golang.org/x/sys v0.0.0-20191127021746-63cb32ae39b2 + golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c golang.org/x/text v0.3.2 golang.org/x/tools v0.0.0-20191213221258-04c2e8eff935 // indirect gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect diff --git a/go.sum b/go.sum index b945bb7edb..46d8788588 100644 --- a/go.sum +++ b/go.sum @@ -581,8 +581,8 @@ golang.org/x/crypto v0.0.0-20190907121410-71b5226ff739/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad h1:5E5raQxcv+6CZ11RrBYQe5WRbUIWpScjh0kvHZkZIrQ= golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 h1:sKJQZMuxjOAR/Uo2LBfU90onWEf1dF4C+0hPJCc9Mpc= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200219234226-1ad67e1f0ef4 h1:4icQlpeqbz3WxfgP6Eq3szTj95KTrlH/CwzBzoxuFd0= +golang.org/x/crypto v0.0.0-20200219234226-1ad67e1f0ef4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -652,8 +652,8 @@ golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190907184412-d223b2b6db03/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/ntt0swNk5oYBziWeTCvY= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191127021746-63cb32ae39b2 h1:/J2nHFg1MTqaRLFO7M+J78ASNsJoz3r0cvHBPQ77fsE= -golang.org/x/sys v0.0.0-20191127021746-63cb32ae39b2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c h1:jceGD5YNJGgGMkJz79agzOln1K9TaZUjv5ird16qniQ= +golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= diff --git a/vendor/golang.org/x/crypto/acme/acme.go b/vendor/golang.org/x/crypto/acme/acme.go index 02fde12db5..6e6c9d1319 100644 --- a/vendor/golang.org/x/crypto/acme/acme.go +++ b/vendor/golang.org/x/crypto/acme/acme.go @@ -55,8 +55,9 @@ const ( ALPNProto = "acme-tls/1" ) -// idPeACMEIdentifierV1 is the OID for the ACME extension for the TLS-ALPN challenge. -var idPeACMEIdentifierV1 = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 1, 30, 1} +// idPeACMEIdentifier is the OID for the ACME extension for the TLS-ALPN challenge. +// https://tools.ietf.org/html/draft-ietf-acme-tls-alpn-05#section-5.1 +var idPeACMEIdentifier = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 1, 31} const ( maxChainLen = 5 // max depth and breadth of a certificate chain @@ -778,7 +779,7 @@ func (c *Client) TLSALPN01ChallengeCert(token, domain string, opt ...CertOption) return tls.Certificate{}, err } acmeExtension := pkix.Extension{ - Id: idPeACMEIdentifierV1, + Id: idPeACMEIdentifier, Critical: true, Value: extValue, } diff --git a/vendor/golang.org/x/crypto/acme/autocert/listener.go b/vendor/golang.org/x/crypto/acme/autocert/listener.go index 1e069818a5..cb48609737 100644 --- a/vendor/golang.org/x/crypto/acme/autocert/listener.go +++ b/vendor/golang.org/x/crypto/acme/autocert/listener.go @@ -72,7 +72,6 @@ func NewListener(domains ...string) net.Listener { // the Manager m's Prompt, Cache, HostPolicy, and other desired options. func (m *Manager) Listener() net.Listener { ln := &listener{ - m: m, conf: m.TLSConfig(), } ln.tcpListener, ln.tcpListenErr = net.Listen("tcp", ":443") @@ -80,7 +79,6 @@ func (m *Manager) Listener() net.Listener { } type listener struct { - m *Manager conf *tls.Config tcpListener net.Listener diff --git a/vendor/golang.org/x/crypto/openpgp/armor/armor.go b/vendor/golang.org/x/crypto/openpgp/armor/armor.go index 592d186436..36a6804364 100644 --- a/vendor/golang.org/x/crypto/openpgp/armor/armor.go +++ b/vendor/golang.org/x/crypto/openpgp/armor/armor.go @@ -62,10 +62,11 @@ var armorEndOfLine = []byte("-----") // lineReader wraps a line based reader. It watches for the end of an armor // block and records the expected CRC value. type lineReader struct { - in *bufio.Reader - buf []byte - eof bool - crc uint32 + in *bufio.Reader + buf []byte + eof bool + crc uint32 + crcSet bool } func (l *lineReader) Read(p []byte) (n int, err error) { @@ -87,6 +88,11 @@ func (l *lineReader) Read(p []byte) (n int, err error) { return 0, ArmorCorrupt } + if bytes.HasPrefix(line, armorEnd) { + l.eof = true + return 0, io.EOF + } + if len(line) == 5 && line[0] == '=' { // This is the checksum line var expectedBytes [3]byte @@ -108,6 +114,7 @@ func (l *lineReader) Read(p []byte) (n int, err error) { } l.eof = true + l.crcSet = true return 0, io.EOF } @@ -141,10 +148,8 @@ func (r *openpgpReader) Read(p []byte) (n int, err error) { n, err = r.b64Reader.Read(p) r.currentCRC = crc24(r.currentCRC, p[:n]) - if err == io.EOF { - if r.lReader.crc != uint32(r.currentCRC&crc24Mask) { - return 0, ArmorCorrupt - } + if err == io.EOF && r.lReader.crcSet && r.lReader.crc != uint32(r.currentCRC&crc24Mask) { + return 0, ArmorCorrupt } return diff --git a/vendor/golang.org/x/crypto/poly1305/sum_arm.go b/vendor/golang.org/x/crypto/poly1305/sum_arm.go deleted file mode 100644 index 6e695e4272..0000000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_arm.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build arm,!gccgo,!appengine,!nacl - -package poly1305 - -// poly1305_auth_armv6 is implemented in sum_arm.s -//go:noescape -func poly1305_auth_armv6(out *[16]byte, m *byte, mlen uint32, key *[32]byte) - -func sum(out *[16]byte, m []byte, key *[32]byte) { - var mPtr *byte - if len(m) > 0 { - mPtr = &m[0] - } - poly1305_auth_armv6(out, mPtr, uint32(len(m)), key) -} diff --git a/vendor/golang.org/x/crypto/poly1305/sum_arm.s b/vendor/golang.org/x/crypto/poly1305/sum_arm.s deleted file mode 100644 index f70b4ac484..0000000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_arm.s +++ /dev/null @@ -1,427 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build arm,!gccgo,!appengine,!nacl - -#include "textflag.h" - -// This code was translated into a form compatible with 5a from the public -// domain source by Andrew Moon: github.com/floodyberry/poly1305-opt/blob/master/app/extensions/poly1305. - -DATA ·poly1305_init_constants_armv6<>+0x00(SB)/4, $0x3ffffff -DATA ·poly1305_init_constants_armv6<>+0x04(SB)/4, $0x3ffff03 -DATA ·poly1305_init_constants_armv6<>+0x08(SB)/4, $0x3ffc0ff -DATA ·poly1305_init_constants_armv6<>+0x0c(SB)/4, $0x3f03fff -DATA ·poly1305_init_constants_armv6<>+0x10(SB)/4, $0x00fffff -GLOBL ·poly1305_init_constants_armv6<>(SB), 8, $20 - -// Warning: the linker may use R11 to synthesize certain instructions. Please -// take care and verify that no synthetic instructions use it. - -TEXT poly1305_init_ext_armv6<>(SB), NOSPLIT, $0 - // Needs 16 bytes of stack and 64 bytes of space pointed to by R0. (It - // might look like it's only 60 bytes of space but the final four bytes - // will be written by another function.) We need to skip over four - // bytes of stack because that's saving the value of 'g'. - ADD $4, R13, R8 - MOVM.IB [R4-R7], (R8) - MOVM.IA.W (R1), [R2-R5] - MOVW $·poly1305_init_constants_armv6<>(SB), R7 - MOVW R2, R8 - MOVW R2>>26, R9 - MOVW R3>>20, g - MOVW R4>>14, R11 - MOVW R5>>8, R12 - ORR R3<<6, R9, R9 - ORR R4<<12, g, g - ORR R5<<18, R11, R11 - MOVM.IA (R7), [R2-R6] - AND R8, R2, R2 - AND R9, R3, R3 - AND g, R4, R4 - AND R11, R5, R5 - AND R12, R6, R6 - MOVM.IA.W [R2-R6], (R0) - EOR R2, R2, R2 - EOR R3, R3, R3 - EOR R4, R4, R4 - EOR R5, R5, R5 - EOR R6, R6, R6 - MOVM.IA.W [R2-R6], (R0) - MOVM.IA.W (R1), [R2-R5] - MOVM.IA [R2-R6], (R0) - ADD $20, R13, R0 - MOVM.DA (R0), [R4-R7] - RET - -#define MOVW_UNALIGNED(Rsrc, Rdst, Rtmp, offset) \ - MOVBU (offset+0)(Rsrc), Rtmp; \ - MOVBU Rtmp, (offset+0)(Rdst); \ - MOVBU (offset+1)(Rsrc), Rtmp; \ - MOVBU Rtmp, (offset+1)(Rdst); \ - MOVBU (offset+2)(Rsrc), Rtmp; \ - MOVBU Rtmp, (offset+2)(Rdst); \ - MOVBU (offset+3)(Rsrc), Rtmp; \ - MOVBU Rtmp, (offset+3)(Rdst) - -TEXT poly1305_blocks_armv6<>(SB), NOSPLIT, $0 - // Needs 24 bytes of stack for saved registers and then 88 bytes of - // scratch space after that. We assume that 24 bytes at (R13) have - // already been used: four bytes for the link register saved in the - // prelude of poly1305_auth_armv6, four bytes for saving the value of g - // in that function and 16 bytes of scratch space used around - // poly1305_finish_ext_armv6_skip1. - ADD $24, R13, R12 - MOVM.IB [R4-R8, R14], (R12) - MOVW R0, 88(R13) - MOVW R1, 92(R13) - MOVW R2, 96(R13) - MOVW R1, R14 - MOVW R2, R12 - MOVW 56(R0), R8 - WORD $0xe1180008 // TST R8, R8 not working see issue 5921 - EOR R6, R6, R6 - MOVW.EQ $(1<<24), R6 - MOVW R6, 84(R13) - ADD $116, R13, g - MOVM.IA (R0), [R0-R9] - MOVM.IA [R0-R4], (g) - CMP $16, R12 - BLO poly1305_blocks_armv6_done - -poly1305_blocks_armv6_mainloop: - WORD $0xe31e0003 // TST R14, #3 not working see issue 5921 - BEQ poly1305_blocks_armv6_mainloop_aligned - ADD $100, R13, g - MOVW_UNALIGNED(R14, g, R0, 0) - MOVW_UNALIGNED(R14, g, R0, 4) - MOVW_UNALIGNED(R14, g, R0, 8) - MOVW_UNALIGNED(R14, g, R0, 12) - MOVM.IA (g), [R0-R3] - ADD $16, R14 - B poly1305_blocks_armv6_mainloop_loaded - -poly1305_blocks_armv6_mainloop_aligned: - MOVM.IA.W (R14), [R0-R3] - -poly1305_blocks_armv6_mainloop_loaded: - MOVW R0>>26, g - MOVW R1>>20, R11 - MOVW R2>>14, R12 - MOVW R14, 92(R13) - MOVW R3>>8, R4 - ORR R1<<6, g, g - ORR R2<<12, R11, R11 - ORR R3<<18, R12, R12 - BIC $0xfc000000, R0, R0 - BIC $0xfc000000, g, g - MOVW 84(R13), R3 - BIC $0xfc000000, R11, R11 - BIC $0xfc000000, R12, R12 - ADD R0, R5, R5 - ADD g, R6, R6 - ORR R3, R4, R4 - ADD R11, R7, R7 - ADD $116, R13, R14 - ADD R12, R8, R8 - ADD R4, R9, R9 - MOVM.IA (R14), [R0-R4] - MULLU R4, R5, (R11, g) - MULLU R3, R5, (R14, R12) - MULALU R3, R6, (R11, g) - MULALU R2, R6, (R14, R12) - MULALU R2, R7, (R11, g) - MULALU R1, R7, (R14, R12) - ADD R4<<2, R4, R4 - ADD R3<<2, R3, R3 - MULALU R1, R8, (R11, g) - MULALU R0, R8, (R14, R12) - MULALU R0, R9, (R11, g) - MULALU R4, R9, (R14, R12) - MOVW g, 76(R13) - MOVW R11, 80(R13) - MOVW R12, 68(R13) - MOVW R14, 72(R13) - MULLU R2, R5, (R11, g) - MULLU R1, R5, (R14, R12) - MULALU R1, R6, (R11, g) - MULALU R0, R6, (R14, R12) - MULALU R0, R7, (R11, g) - MULALU R4, R7, (R14, R12) - ADD R2<<2, R2, R2 - ADD R1<<2, R1, R1 - MULALU R4, R8, (R11, g) - MULALU R3, R8, (R14, R12) - MULALU R3, R9, (R11, g) - MULALU R2, R9, (R14, R12) - MOVW g, 60(R13) - MOVW R11, 64(R13) - MOVW R12, 52(R13) - MOVW R14, 56(R13) - MULLU R0, R5, (R11, g) - MULALU R4, R6, (R11, g) - MULALU R3, R7, (R11, g) - MULALU R2, R8, (R11, g) - MULALU R1, R9, (R11, g) - ADD $52, R13, R0 - MOVM.IA (R0), [R0-R7] - MOVW g>>26, R12 - MOVW R4>>26, R14 - ORR R11<<6, R12, R12 - ORR R5<<6, R14, R14 - BIC $0xfc000000, g, g - BIC $0xfc000000, R4, R4 - ADD.S R12, R0, R0 - ADC $0, R1, R1 - ADD.S R14, R6, R6 - ADC $0, R7, R7 - MOVW R0>>26, R12 - MOVW R6>>26, R14 - ORR R1<<6, R12, R12 - ORR R7<<6, R14, R14 - BIC $0xfc000000, R0, R0 - BIC $0xfc000000, R6, R6 - ADD R14<<2, R14, R14 - ADD.S R12, R2, R2 - ADC $0, R3, R3 - ADD R14, g, g - MOVW R2>>26, R12 - MOVW g>>26, R14 - ORR R3<<6, R12, R12 - BIC $0xfc000000, g, R5 - BIC $0xfc000000, R2, R7 - ADD R12, R4, R4 - ADD R14, R0, R0 - MOVW R4>>26, R12 - BIC $0xfc000000, R4, R8 - ADD R12, R6, R9 - MOVW 96(R13), R12 - MOVW 92(R13), R14 - MOVW R0, R6 - CMP $32, R12 - SUB $16, R12, R12 - MOVW R12, 96(R13) - BHS poly1305_blocks_armv6_mainloop - -poly1305_blocks_armv6_done: - MOVW 88(R13), R12 - MOVW R5, 20(R12) - MOVW R6, 24(R12) - MOVW R7, 28(R12) - MOVW R8, 32(R12) - MOVW R9, 36(R12) - ADD $48, R13, R0 - MOVM.DA (R0), [R4-R8, R14] - RET - -#define MOVHUP_UNALIGNED(Rsrc, Rdst, Rtmp) \ - MOVBU.P 1(Rsrc), Rtmp; \ - MOVBU.P Rtmp, 1(Rdst); \ - MOVBU.P 1(Rsrc), Rtmp; \ - MOVBU.P Rtmp, 1(Rdst) - -#define MOVWP_UNALIGNED(Rsrc, Rdst, Rtmp) \ - MOVHUP_UNALIGNED(Rsrc, Rdst, Rtmp); \ - MOVHUP_UNALIGNED(Rsrc, Rdst, Rtmp) - -// func poly1305_auth_armv6(out *[16]byte, m *byte, mlen uint32, key *[32]key) -TEXT ·poly1305_auth_armv6(SB), $196-16 - // The value 196, just above, is the sum of 64 (the size of the context - // structure) and 132 (the amount of stack needed). - // - // At this point, the stack pointer (R13) has been moved down. It - // points to the saved link register and there's 196 bytes of free - // space above it. - // - // The stack for this function looks like: - // - // +--------------------- - // | - // | 64 bytes of context structure - // | - // +--------------------- - // | - // | 112 bytes for poly1305_blocks_armv6 - // | - // +--------------------- - // | 16 bytes of final block, constructed at - // | poly1305_finish_ext_armv6_skip8 - // +--------------------- - // | four bytes of saved 'g' - // +--------------------- - // | lr, saved by prelude <- R13 points here - // +--------------------- - MOVW g, 4(R13) - - MOVW out+0(FP), R4 - MOVW m+4(FP), R5 - MOVW mlen+8(FP), R6 - MOVW key+12(FP), R7 - - ADD $136, R13, R0 // 136 = 4 + 4 + 16 + 112 - MOVW R7, R1 - - // poly1305_init_ext_armv6 will write to the stack from R13+4, but - // that's ok because none of the other values have been written yet. - BL poly1305_init_ext_armv6<>(SB) - BIC.S $15, R6, R2 - BEQ poly1305_auth_armv6_noblocks - ADD $136, R13, R0 - MOVW R5, R1 - ADD R2, R5, R5 - SUB R2, R6, R6 - BL poly1305_blocks_armv6<>(SB) - -poly1305_auth_armv6_noblocks: - ADD $136, R13, R0 - MOVW R5, R1 - MOVW R6, R2 - MOVW R4, R3 - - MOVW R0, R5 - MOVW R1, R6 - MOVW R2, R7 - MOVW R3, R8 - AND.S R2, R2, R2 - BEQ poly1305_finish_ext_armv6_noremaining - EOR R0, R0 - ADD $8, R13, R9 // 8 = offset to 16 byte scratch space - MOVW R0, (R9) - MOVW R0, 4(R9) - MOVW R0, 8(R9) - MOVW R0, 12(R9) - WORD $0xe3110003 // TST R1, #3 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_aligned - WORD $0xe3120008 // TST R2, #8 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip8 - MOVWP_UNALIGNED(R1, R9, g) - MOVWP_UNALIGNED(R1, R9, g) - -poly1305_finish_ext_armv6_skip8: - WORD $0xe3120004 // TST $4, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip4 - MOVWP_UNALIGNED(R1, R9, g) - -poly1305_finish_ext_armv6_skip4: - WORD $0xe3120002 // TST $2, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip2 - MOVHUP_UNALIGNED(R1, R9, g) - B poly1305_finish_ext_armv6_skip2 - -poly1305_finish_ext_armv6_aligned: - WORD $0xe3120008 // TST R2, #8 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip8_aligned - MOVM.IA.W (R1), [g-R11] - MOVM.IA.W [g-R11], (R9) - -poly1305_finish_ext_armv6_skip8_aligned: - WORD $0xe3120004 // TST $4, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip4_aligned - MOVW.P 4(R1), g - MOVW.P g, 4(R9) - -poly1305_finish_ext_armv6_skip4_aligned: - WORD $0xe3120002 // TST $2, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip2 - MOVHU.P 2(R1), g - MOVH.P g, 2(R9) - -poly1305_finish_ext_armv6_skip2: - WORD $0xe3120001 // TST $1, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip1 - MOVBU.P 1(R1), g - MOVBU.P g, 1(R9) - -poly1305_finish_ext_armv6_skip1: - MOVW $1, R11 - MOVBU R11, 0(R9) - MOVW R11, 56(R5) - MOVW R5, R0 - ADD $8, R13, R1 - MOVW $16, R2 - BL poly1305_blocks_armv6<>(SB) - -poly1305_finish_ext_armv6_noremaining: - MOVW 20(R5), R0 - MOVW 24(R5), R1 - MOVW 28(R5), R2 - MOVW 32(R5), R3 - MOVW 36(R5), R4 - MOVW R4>>26, R12 - BIC $0xfc000000, R4, R4 - ADD R12<<2, R12, R12 - ADD R12, R0, R0 - MOVW R0>>26, R12 - BIC $0xfc000000, R0, R0 - ADD R12, R1, R1 - MOVW R1>>26, R12 - BIC $0xfc000000, R1, R1 - ADD R12, R2, R2 - MOVW R2>>26, R12 - BIC $0xfc000000, R2, R2 - ADD R12, R3, R3 - MOVW R3>>26, R12 - BIC $0xfc000000, R3, R3 - ADD R12, R4, R4 - ADD $5, R0, R6 - MOVW R6>>26, R12 - BIC $0xfc000000, R6, R6 - ADD R12, R1, R7 - MOVW R7>>26, R12 - BIC $0xfc000000, R7, R7 - ADD R12, R2, g - MOVW g>>26, R12 - BIC $0xfc000000, g, g - ADD R12, R3, R11 - MOVW $-(1<<26), R12 - ADD R11>>26, R12, R12 - BIC $0xfc000000, R11, R11 - ADD R12, R4, R9 - MOVW R9>>31, R12 - SUB $1, R12 - AND R12, R6, R6 - AND R12, R7, R7 - AND R12, g, g - AND R12, R11, R11 - AND R12, R9, R9 - MVN R12, R12 - AND R12, R0, R0 - AND R12, R1, R1 - AND R12, R2, R2 - AND R12, R3, R3 - AND R12, R4, R4 - ORR R6, R0, R0 - ORR R7, R1, R1 - ORR g, R2, R2 - ORR R11, R3, R3 - ORR R9, R4, R4 - ORR R1<<26, R0, R0 - MOVW R1>>6, R1 - ORR R2<<20, R1, R1 - MOVW R2>>12, R2 - ORR R3<<14, R2, R2 - MOVW R3>>18, R3 - ORR R4<<8, R3, R3 - MOVW 40(R5), R6 - MOVW 44(R5), R7 - MOVW 48(R5), g - MOVW 52(R5), R11 - ADD.S R6, R0, R0 - ADC.S R7, R1, R1 - ADC.S g, R2, R2 - ADC.S R11, R3, R3 - MOVM.IA [R0-R3], (R8) - MOVW R5, R12 - EOR R0, R0, R0 - EOR R1, R1, R1 - EOR R2, R2, R2 - EOR R3, R3, R3 - EOR R4, R4, R4 - EOR R5, R5, R5 - EOR R6, R6, R6 - EOR R7, R7, R7 - MOVM.IA.W [R0-R7], (R12) - MOVM.IA [R0-R7], (R12) - MOVW 4(R13), g - RET diff --git a/vendor/golang.org/x/crypto/poly1305/sum_noasm.go b/vendor/golang.org/x/crypto/poly1305/sum_noasm.go index 1682eda45f..32a9cef6bb 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_noasm.go +++ b/vendor/golang.org/x/crypto/poly1305/sum_noasm.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build s390x,!go1.11 !arm,!amd64,!s390x,!ppc64le gccgo appengine nacl +// +build s390x,!go1.11 !amd64,!s390x,!ppc64le gccgo appengine nacl package poly1305 diff --git a/vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go b/vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go new file mode 100644 index 0000000000..af81d26654 --- /dev/null +++ b/vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go @@ -0,0 +1,93 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package bcrypt_pbkdf implements bcrypt_pbkdf(3) from OpenBSD. +// +// See https://flak.tedunangst.com/post/bcrypt-pbkdf and +// https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libutil/bcrypt_pbkdf.c. +package bcrypt_pbkdf + +import ( + "crypto/sha512" + "errors" + "golang.org/x/crypto/blowfish" +) + +const blockSize = 32 + +// Key derives a key from the password, salt and rounds count, returning a +// []byte of length keyLen that can be used as cryptographic key. +func Key(password, salt []byte, rounds, keyLen int) ([]byte, error) { + if rounds < 1 { + return nil, errors.New("bcrypt_pbkdf: number of rounds is too small") + } + if len(password) == 0 { + return nil, errors.New("bcrypt_pbkdf: empty password") + } + if len(salt) == 0 || len(salt) > 1<<20 { + return nil, errors.New("bcrypt_pbkdf: bad salt length") + } + if keyLen > 1024 { + return nil, errors.New("bcrypt_pbkdf: keyLen is too large") + } + + numBlocks := (keyLen + blockSize - 1) / blockSize + key := make([]byte, numBlocks*blockSize) + + h := sha512.New() + h.Write(password) + shapass := h.Sum(nil) + + shasalt := make([]byte, 0, sha512.Size) + cnt, tmp := make([]byte, 4), make([]byte, blockSize) + for block := 1; block <= numBlocks; block++ { + h.Reset() + h.Write(salt) + cnt[0] = byte(block >> 24) + cnt[1] = byte(block >> 16) + cnt[2] = byte(block >> 8) + cnt[3] = byte(block) + h.Write(cnt) + bcryptHash(tmp, shapass, h.Sum(shasalt)) + + out := make([]byte, blockSize) + copy(out, tmp) + for i := 2; i <= rounds; i++ { + h.Reset() + h.Write(tmp) + bcryptHash(tmp, shapass, h.Sum(shasalt)) + for j := 0; j < len(out); j++ { + out[j] ^= tmp[j] + } + } + + for i, v := range out { + key[i*numBlocks+(block-1)] = v + } + } + return key[:keyLen], nil +} + +var magic = []byte("OxychromaticBlowfishSwatDynamite") + +func bcryptHash(out, shapass, shasalt []byte) { + c, err := blowfish.NewSaltedCipher(shapass, shasalt) + if err != nil { + panic(err) + } + for i := 0; i < 64; i++ { + blowfish.ExpandKey(shasalt, c) + blowfish.ExpandKey(shapass, c) + } + copy(out, magic) + for i := 0; i < 32; i += 8 { + for j := 0; j < 64; j++ { + c.Encrypt(out[i:i+8], out[i:i+8]) + } + } + // Swap bytes due to different endianness. + for i := 0; i < 32; i += 4 { + out[i+3], out[i+2], out[i+1], out[i] = out[i], out[i+1], out[i+2], out[i+3] + } +} diff --git a/vendor/golang.org/x/crypto/ssh/keys.go b/vendor/golang.org/x/crypto/ssh/keys.go index c148ad4c4f..d63cbf60b7 100644 --- a/vendor/golang.org/x/crypto/ssh/keys.go +++ b/vendor/golang.org/x/crypto/ssh/keys.go @@ -7,6 +7,8 @@ package ssh import ( "bytes" "crypto" + "crypto/aes" + "crypto/cipher" "crypto/dsa" "crypto/ecdsa" "crypto/elliptic" @@ -25,6 +27,7 @@ import ( "strings" "golang.org/x/crypto/ed25519" + "golang.org/x/crypto/ssh/internal/bcrypt_pbkdf" ) // These constants represent the algorithm names for key types supported by this @@ -1122,21 +1125,25 @@ func ParseRawPrivateKey(pemBytes []byte) (interface{}, error) { case "DSA PRIVATE KEY": return ParseDSAPrivateKey(block.Bytes) case "OPENSSH PRIVATE KEY": - return parseOpenSSHPrivateKey(block.Bytes) + return parseOpenSSHPrivateKey(block.Bytes, unencryptedOpenSSHKey) default: return nil, fmt.Errorf("ssh: unsupported key type %q", block.Type) } } // ParseRawPrivateKeyWithPassphrase returns a private key decrypted with -// passphrase from a PEM encoded private key. If wrong passphrase, return -// x509.IncorrectPasswordError. +// passphrase from a PEM encoded private key. If the passphrase is wrong, it +// will return x509.IncorrectPasswordError. func ParseRawPrivateKeyWithPassphrase(pemBytes, passphrase []byte) (interface{}, error) { block, _ := pem.Decode(pemBytes) if block == nil { return nil, errors.New("ssh: no key found") } + if block.Type == "OPENSSH PRIVATE KEY" { + return parseOpenSSHPrivateKey(block.Bytes, passphraseProtectedOpenSSHKey(passphrase)) + } + if !encryptedBlock(block) || !x509.IsEncryptedPEMBlock(block) { return nil, errors.New("ssh: not an encrypted key") } @@ -1193,9 +1200,60 @@ func ParseDSAPrivateKey(der []byte) (*dsa.PrivateKey, error) { }, nil } -// Implemented based on the documentation at -// https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key -func parseOpenSSHPrivateKey(key []byte) (crypto.PrivateKey, error) { +func unencryptedOpenSSHKey(cipherName, kdfName, kdfOpts string, privKeyBlock []byte) ([]byte, error) { + if kdfName != "none" || cipherName != "none" { + return nil, &PassphraseMissingError{} + } + if kdfOpts != "" { + return nil, errors.New("ssh: invalid openssh private key") + } + return privKeyBlock, nil +} + +func passphraseProtectedOpenSSHKey(passphrase []byte) openSSHDecryptFunc { + return func(cipherName, kdfName, kdfOpts string, privKeyBlock []byte) ([]byte, error) { + if kdfName == "none" || cipherName == "none" { + return nil, errors.New("ssh: key is not password protected") + } + if kdfName != "bcrypt" { + return nil, fmt.Errorf("ssh: unknown KDF %q, only supports %q", kdfName, "bcrypt") + } + + var opts struct { + Salt string + Rounds uint32 + } + if err := Unmarshal([]byte(kdfOpts), &opts); err != nil { + return nil, err + } + + k, err := bcrypt_pbkdf.Key(passphrase, []byte(opts.Salt), int(opts.Rounds), 32+16) + if err != nil { + return nil, err + } + key, iv := k[:32], k[32:] + + if cipherName != "aes256-ctr" { + return nil, fmt.Errorf("ssh: unknown cipher %q, only supports %q", cipherName, "aes256-ctr") + } + c, err := aes.NewCipher(key) + if err != nil { + return nil, err + } + ctr := cipher.NewCTR(c, iv) + ctr.XORKeyStream(privKeyBlock, privKeyBlock) + + return privKeyBlock, nil + } +} + +type openSSHDecryptFunc func(CipherName, KdfName, KdfOpts string, PrivKeyBlock []byte) ([]byte, error) + +// parseOpenSSHPrivateKey parses an OpenSSH private key, using the decrypt +// function to unwrap the encrypted portion. unencryptedOpenSSHKey can be used +// as the decrypt function to parse an unencrypted private key. See +// https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key. +func parseOpenSSHPrivateKey(key []byte, decrypt openSSHDecryptFunc) (crypto.PrivateKey, error) { const magic = "openssh-key-v1\x00" if len(key) < len(magic) || string(key[:len(magic)]) != magic { return nil, errors.New("ssh: invalid openssh private key format") @@ -1214,9 +1272,22 @@ func parseOpenSSHPrivateKey(key []byte) (crypto.PrivateKey, error) { if err := Unmarshal(remaining, &w); err != nil { return nil, err } + if w.NumKeys != 1 { + // We only support single key files, and so does OpenSSH. + // https://github.com/openssh/openssh-portable/blob/4103a3ec7/sshkey.c#L4171 + return nil, errors.New("ssh: multi-key files are not supported") + } - if w.KdfName != "none" || w.CipherName != "none" { - return nil, errors.New("ssh: cannot decode encrypted private keys") + privKeyBlock, err := decrypt(w.CipherName, w.KdfName, w.KdfOpts, w.PrivKeyBlock) + if err != nil { + if err, ok := err.(*PassphraseMissingError); ok { + pub, errPub := ParsePublicKey(w.PubKey) + if errPub != nil { + return nil, fmt.Errorf("ssh: failed to parse embedded public key: %v", errPub) + } + err.PublicKey = pub + } + return nil, err } pk1 := struct { @@ -1226,12 +1297,11 @@ func parseOpenSSHPrivateKey(key []byte) (crypto.PrivateKey, error) { Rest []byte `ssh:"rest"` }{} - if err := Unmarshal(w.PrivKeyBlock, &pk1); err != nil { - return nil, err - } - - if pk1.Check1 != pk1.Check2 { - return nil, errors.New("ssh: checkint mismatch") + if err := Unmarshal(privKeyBlock, &pk1); err != nil || pk1.Check1 != pk1.Check2 { + if w.CipherName != "none" { + return nil, x509.IncorrectPasswordError + } + return nil, errors.New("ssh: malformed OpenSSH key") } // we only handle ed25519 and rsa keys currently @@ -1253,10 +1323,8 @@ func parseOpenSSHPrivateKey(key []byte) (crypto.PrivateKey, error) { return nil, err } - for i, b := range key.Pad { - if int(b) != i+1 { - return nil, errors.New("ssh: padding not as expected") - } + if err := checkOpenSSHKeyPadding(key.Pad); err != nil { + return nil, err } pk := &rsa.PrivateKey{ @@ -1291,20 +1359,78 @@ func parseOpenSSHPrivateKey(key []byte) (crypto.PrivateKey, error) { return nil, errors.New("ssh: private key unexpected length") } - for i, b := range key.Pad { - if int(b) != i+1 { - return nil, errors.New("ssh: padding not as expected") - } + if err := checkOpenSSHKeyPadding(key.Pad); err != nil { + return nil, err } pk := ed25519.PrivateKey(make([]byte, ed25519.PrivateKeySize)) copy(pk, key.Priv) return &pk, nil + case KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521: + key := struct { + Curve string + Pub []byte + D *big.Int + Comment string + Pad []byte `ssh:"rest"` + }{} + + if err := Unmarshal(pk1.Rest, &key); err != nil { + return nil, err + } + + if err := checkOpenSSHKeyPadding(key.Pad); err != nil { + return nil, err + } + + var curve elliptic.Curve + switch key.Curve { + case "nistp256": + curve = elliptic.P256() + case "nistp384": + curve = elliptic.P384() + case "nistp521": + curve = elliptic.P521() + default: + return nil, errors.New("ssh: unhandled elliptic curve: " + key.Curve) + } + + X, Y := elliptic.Unmarshal(curve, key.Pub) + if X == nil || Y == nil { + return nil, errors.New("ssh: failed to unmarshal public key") + } + + if key.D.Cmp(curve.Params().N) >= 0 { + return nil, errors.New("ssh: scalar is out of range") + } + + x, y := curve.ScalarBaseMult(key.D.Bytes()) + if x.Cmp(X) != 0 || y.Cmp(Y) != 0 { + return nil, errors.New("ssh: public key does not match private key") + } + + return &ecdsa.PrivateKey{ + PublicKey: ecdsa.PublicKey{ + Curve: curve, + X: X, + Y: Y, + }, + D: key.D, + }, nil default: return nil, errors.New("ssh: unhandled key type") } } +func checkOpenSSHKeyPadding(pad []byte) error { + for i, b := range pad { + if int(b) != i+1 { + return errors.New("ssh: padding not as expected") + } + } + return nil +} + // FingerprintLegacyMD5 returns the user presentation of the key's // fingerprint as described by RFC 4716 section 4. func FingerprintLegacyMD5(pubKey PublicKey) string { diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go new file mode 100644 index 0000000000..9c87677aef --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go @@ -0,0 +1,138 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cpu + +import "runtime" + +const cacheLineSize = 64 + +func init() { + switch runtime.GOOS { + case "android", "darwin": + // Android and iOS don't seem to allow reading these registers. + // Fake the minimal features expected by + // TestARM64minimalFeatures. + ARM64.HasASIMD = true + ARM64.HasFP = true + case "linux": + doinit() + default: + readARM64Registers() + } +} + +func readARM64Registers() { + Initialized = true + + // ID_AA64ISAR0_EL1 + isar0 := getisar0() + + switch extractBits(isar0, 4, 7) { + case 1: + ARM64.HasAES = true + case 2: + ARM64.HasAES = true + ARM64.HasPMULL = true + } + + switch extractBits(isar0, 8, 11) { + case 1: + ARM64.HasSHA1 = true + } + + switch extractBits(isar0, 12, 15) { + case 1: + ARM64.HasSHA2 = true + case 2: + ARM64.HasSHA2 = true + ARM64.HasSHA512 = true + } + + switch extractBits(isar0, 16, 19) { + case 1: + ARM64.HasCRC32 = true + } + + switch extractBits(isar0, 20, 23) { + case 2: + ARM64.HasATOMICS = true + } + + switch extractBits(isar0, 28, 31) { + case 1: + ARM64.HasASIMDRDM = true + } + + switch extractBits(isar0, 32, 35) { + case 1: + ARM64.HasSHA3 = true + } + + switch extractBits(isar0, 36, 39) { + case 1: + ARM64.HasSM3 = true + } + + switch extractBits(isar0, 40, 43) { + case 1: + ARM64.HasSM4 = true + } + + switch extractBits(isar0, 44, 47) { + case 1: + ARM64.HasASIMDDP = true + } + + // ID_AA64ISAR1_EL1 + isar1 := getisar1() + + switch extractBits(isar1, 0, 3) { + case 1: + ARM64.HasDCPOP = true + } + + switch extractBits(isar1, 12, 15) { + case 1: + ARM64.HasJSCVT = true + } + + switch extractBits(isar1, 16, 19) { + case 1: + ARM64.HasFCMA = true + } + + switch extractBits(isar1, 20, 23) { + case 1: + ARM64.HasLRCPC = true + } + + // ID_AA64PFR0_EL1 + pfr0 := getpfr0() + + switch extractBits(pfr0, 16, 19) { + case 0: + ARM64.HasFP = true + case 1: + ARM64.HasFP = true + ARM64.HasFPHP = true + } + + switch extractBits(pfr0, 20, 23) { + case 0: + ARM64.HasASIMD = true + case 1: + ARM64.HasASIMD = true + ARM64.HasASIMDHP = true + } + + switch extractBits(pfr0, 32, 35) { + case 1: + ARM64.HasSVE = true + } +} + +func extractBits(data uint64, start, end uint) uint { + return (uint)(data>>start) & ((1 << (end - start + 1)) - 1) +} diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.s b/vendor/golang.org/x/sys/cpu/cpu_arm64.s new file mode 100644 index 0000000000..a54436e390 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.s @@ -0,0 +1,31 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !gccgo + +#include "textflag.h" + +// func getisar0() uint64 +TEXT ·getisar0(SB),NOSPLIT,$0-8 + // get Instruction Set Attributes 0 into x0 + // mrs x0, ID_AA64ISAR0_EL1 = d5380600 + WORD $0xd5380600 + MOVD R0, ret+0(FP) + RET + +// func getisar1() uint64 +TEXT ·getisar1(SB),NOSPLIT,$0-8 + // get Instruction Set Attributes 1 into x0 + // mrs x0, ID_AA64ISAR1_EL1 = d5380620 + WORD $0xd5380620 + MOVD R0, ret+0(FP) + RET + +// func getpfr0() uint64 +TEXT ·getpfr0(SB),NOSPLIT,$0-8 + // get Processor Feature Register 0 into x0 + // mrs x0, ID_AA64PFR0_EL1 = d5380400 + WORD $0xd5380400 + MOVD R0, ret+0(FP) + RET diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go new file mode 100644 index 0000000000..7b88e865a4 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go @@ -0,0 +1,11 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !gccgo + +package cpu + +func getisar0() uint64 +func getisar1() uint64 +func getpfr0() uint64 diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go new file mode 100644 index 0000000000..53ca8d65c3 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go @@ -0,0 +1,11 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build gccgo + +package cpu + +func getisar0() uint64 { return 0 } +func getisar1() uint64 { return 0 } +func getpfr0() uint64 { return 0 } diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo.c b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c similarity index 100% rename from vendor/golang.org/x/sys/cpu/cpu_gccgo.c rename to vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go similarity index 100% rename from vendor/golang.org/x/sys/cpu/cpu_gccgo.go rename to vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux.go b/vendor/golang.org/x/sys/cpu/cpu_linux.go index 10e712dc5d..fe139182c8 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux.go @@ -2,58 +2,14 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !amd64,!amd64p32,!386 +// +build !386,!amd64,!amd64p32,!arm64 package cpu -import ( - "io/ioutil" -) - -const ( - _AT_HWCAP = 16 - _AT_HWCAP2 = 26 - - procAuxv = "/proc/self/auxv" - - uintSize = int(32 << (^uint(0) >> 63)) -) - -// For those platforms don't have a 'cpuid' equivalent we use HWCAP/HWCAP2 -// These are initialized in cpu_$GOARCH.go -// and should not be changed after they are initialized. -var hwCap uint -var hwCap2 uint - func init() { - buf, err := ioutil.ReadFile(procAuxv) - if err != nil { - // e.g. on android /proc/self/auxv is not accessible, so silently - // ignore the error and leave Initialized = false + if err := readHWCAP(); err != nil { return } - - bo := hostByteOrder() - for len(buf) >= 2*(uintSize/8) { - var tag, val uint - switch uintSize { - case 32: - tag = uint(bo.Uint32(buf[0:])) - val = uint(bo.Uint32(buf[4:])) - buf = buf[8:] - case 64: - tag = uint(bo.Uint64(buf[0:])) - val = uint(bo.Uint64(buf[8:])) - buf = buf[16:] - } - switch tag { - case _AT_HWCAP: - hwCap = val - case _AT_HWCAP2: - hwCap2 = val - } - } doinit() - Initialized = true } diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go index fa7fb1bd7b..79a38a0b9b 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go @@ -4,8 +4,6 @@ package cpu -const cacheLineSize = 64 - // HWCAP/HWCAP2 bits. These are exposed by Linux. const ( hwcap_FP = 1 << 0 @@ -35,6 +33,12 @@ const ( ) func doinit() { + if err := readHWCAP(); err != nil { + // failed to read /proc/self/auxv, try reading registers directly + readARM64Registers() + return + } + // HWCAP feature bits ARM64.HasFP = isSet(hwCap, hwcap_FP) ARM64.HasASIMD = isSet(hwCap, hwcap_ASIMD) diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go index e1f31dd2d7..3ffc4afa03 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go @@ -6,4 +6,4 @@ package cpu -const cacheLineSize = 64 +func doinit() {} diff --git a/vendor/golang.org/x/sys/cpu/hwcap_linux.go b/vendor/golang.org/x/sys/cpu/hwcap_linux.go new file mode 100644 index 0000000000..f3baa37932 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/hwcap_linux.go @@ -0,0 +1,56 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cpu + +import ( + "io/ioutil" +) + +const ( + _AT_HWCAP = 16 + _AT_HWCAP2 = 26 + + procAuxv = "/proc/self/auxv" + + uintSize = int(32 << (^uint(0) >> 63)) +) + +// For those platforms don't have a 'cpuid' equivalent we use HWCAP/HWCAP2 +// These are initialized in cpu_$GOARCH.go +// and should not be changed after they are initialized. +var hwCap uint +var hwCap2 uint + +func readHWCAP() error { + buf, err := ioutil.ReadFile(procAuxv) + if err != nil { + // e.g. on android /proc/self/auxv is not accessible, so silently + // ignore the error and leave Initialized = false. On some + // architectures (e.g. arm64) doinit() implements a fallback + // readout and will set Initialized = true again. + return err + } + bo := hostByteOrder() + for len(buf) >= 2*(uintSize/8) { + var tag, val uint + switch uintSize { + case 32: + tag = uint(bo.Uint32(buf[0:])) + val = uint(bo.Uint32(buf[4:])) + buf = buf[8:] + case 64: + tag = uint(bo.Uint64(buf[0:])) + val = uint(bo.Uint64(buf[8:])) + buf = buf[16:] + } + switch tag { + case _AT_HWCAP: + hwCap = val + case _AT_HWCAP2: + hwCap2 = val + } + } + return nil +} diff --git a/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s b/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s index 6db717de53..3cfefed2ec 100644 --- a/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s +++ b/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s @@ -23,10 +23,6 @@ TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 MOV a1+8(FP), A0 MOV a2+16(FP), A1 MOV a3+24(FP), A2 - MOV $0, A3 - MOV $0, A4 - MOV $0, A5 - MOV $0, A6 MOV trap+0(FP), A7 // syscall entry ECALL MOV A0, r1+32(FP) // r1 @@ -44,9 +40,6 @@ TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 MOV a1+8(FP), A0 MOV a2+16(FP), A1 MOV a3+24(FP), A2 - MOV ZERO, A3 - MOV ZERO, A4 - MOV ZERO, A5 MOV trap+0(FP), A7 // syscall entry ECALL MOV A0, r1+32(FP) diff --git a/vendor/golang.org/x/sys/unix/fcntl.go b/vendor/golang.org/x/sys/unix/fcntl.go index 39c03f1ef1..4dc5348643 100644 --- a/vendor/golang.org/x/sys/unix/fcntl.go +++ b/vendor/golang.org/x/sys/unix/fcntl.go @@ -9,12 +9,11 @@ package unix import "unsafe" // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux -// systems by flock_linux_32bit.go to be SYS_FCNTL64. +// systems by fcntl_linux_32bit.go to be SYS_FCNTL64. var fcntl64Syscall uintptr = SYS_FCNTL -// FcntlInt performs a fcntl syscall on fd with the provided command and argument. -func FcntlInt(fd uintptr, cmd, arg int) (int, error) { - valptr, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg)) +func fcntl(fd int, cmd, arg int) (int, error) { + valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) var err error if errno != 0 { err = errno @@ -22,6 +21,11 @@ func FcntlInt(fd uintptr, cmd, arg int) (int, error) { return int(valptr), err } +// FcntlInt performs a fcntl syscall on fd with the provided command and argument. +func FcntlInt(fd uintptr, cmd, arg int) (int, error) { + return fcntl(int(fd), cmd, arg) +} + // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh index 890ec464c7..fa0c69b9da 100644 --- a/vendor/golang.org/x/sys/unix/mkall.sh +++ b/vendor/golang.org/x/sys/unix/mkall.sh @@ -50,7 +50,7 @@ if [[ "$GOOS" = "linux" ]]; then # Use the Docker-based build system # Files generated through docker (use $cmd so you can Ctl-C the build or run) $cmd docker build --tag generate:$GOOS $GOOS - $cmd docker run --interactive --tty --volume $(dirname "$(readlink -f "$0")"):/build generate:$GOOS + $cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")" && /bin/pwd):/build generate:$GOOS exit fi diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index b5462b85f1..96bf2a9197 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -186,6 +186,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -485,7 +486,7 @@ ccflags="$@" $2 ~ /^TCSET/ || $2 ~ /^TC(FLSH|SBRKP?|XONC)$/ || $2 !~ "RTF_BITS" && - $2 ~ /^(IFF|IFT|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ || + $2 ~ /^(IFF|IFT|NET_RT|RTM(GRP)?|RTF|RTV|RTA|RTAX)_/ || $2 ~ /^BIOC/ || $2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ || $2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ || @@ -526,6 +527,7 @@ ccflags="$@" $2 ~ /^WDIOC_/ || $2 ~ /^NFN/ || $2 ~ /^XDP_/ || + $2 ~ /^RWF_/ || $2 ~ /^(HDIO|WIN|SMART)_/ || $2 ~ /^CRYPTO_/ || $2 ~ /^TIPC_/ || diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go index d52bcc41c3..68605db624 100644 --- a/vendor/golang.org/x/sys/unix/syscall_bsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_bsd.go @@ -510,6 +510,23 @@ func SysctlRaw(name string, args ...int) ([]byte, error) { return buf[:n], nil } +func SysctlClockinfo(name string) (*Clockinfo, error) { + mib, err := sysctlmib(name) + if err != nil { + return nil, err + } + + n := uintptr(SizeofClockinfo) + var ci Clockinfo + if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil { + return nil, err + } + if n != SizeofClockinfo { + return nil, EIO + } + return &ci, nil +} + //sys utimes(path string, timeval *[2]Timeval) (err error) func Utimes(path string, tv []Timeval) error { @@ -577,8 +594,6 @@ func Futimes(fd int, tv []Timeval) error { return futimes(fd, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } -//sys fcntl(fd int, cmd int, arg int) (val int, err error) - //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) func Poll(fds []PollFd, timeout int) (n int, err error) { diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 0a1cc74b3e..9a5a6ee544 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -155,23 +155,6 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) ( //sys getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) -func SysctlClockinfo(name string) (*Clockinfo, error) { - mib, err := sysctlmib(name) - if err != nil { - return nil, err - } - - n := uintptr(SizeofClockinfo) - var ci Clockinfo - if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil { - return nil, err - } - if n != SizeofClockinfo { - return nil, EIO - } - return &ci, nil -} - //sysnb pipe() (r int, w int, err error) func Pipe(p []int) (err error) { @@ -333,6 +316,8 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error { * Wrapped */ +//sys fcntl(fd int, cmd int, arg int) (val int, err error) + //sys kill(pid int, signum int, posix int) (err error) func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) } diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go index c81510da27..0e3f25aca1 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin,386,!go1.12 +// +build darwin,arm,!go1.12 package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/vendor/golang.org/x/sys/unix/syscall_freebsd.go index 34918d8ed7..6b2eca493d 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd.go @@ -529,12 +529,6 @@ func PtraceGetRegs(pid int, regsout *Reg) (err error) { return ptrace(PTRACE_GETREGS, pid, uintptr(unsafe.Pointer(regsout)), 0) } -func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { - ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint(countin)} - err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) - return int(ioDesc.Len), err -} - func PtraceLwpEvents(pid int, enable int) (err error) { return ptrace(PTRACE_LWPEVENTS, pid, 0, enable) } diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go index dcc56457a0..0a5a66fabd 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go @@ -54,3 +54,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) + +func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { + ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)} + err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) + return int(ioDesc.Len), err +} diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go index 321c3baceb..8025b22d08 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go @@ -54,3 +54,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) + +func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { + ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)} + err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) + return int(ioDesc.Len), err +} diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go index 6977008313..4ea45bce52 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go @@ -54,3 +54,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) + +func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { + ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)} + err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) + return int(ioDesc.Len), err +} diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go index dbbbfd6035..aa5326db19 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go @@ -54,3 +54,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) + +func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { + ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)} + err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) + return int(ioDesc.Len), err +} diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 26903bca8c..95f7a159ad 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -1555,8 +1555,8 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Acct(path string) (err error) //sys AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) //sys Adjtimex(buf *Timex) (state int, err error) -//sys Capget(hdr *CapUserHeader, data *CapUserData) (err error) -//sys Capset(hdr *CapUserHeader, data *CapUserData) (err error) +//sysnb Capget(hdr *CapUserHeader, data *CapUserData) (err error) +//sysnb Capset(hdr *CapUserHeader, data *CapUserData) (err error) //sys Chdir(path string) (err error) //sys Chroot(path string) (err error) //sys ClockGetres(clockid int32, res *Timespec) (err error) @@ -1575,7 +1575,6 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Fchdir(fd int) (err error) //sys Fchmod(fd int, mode uint32) (err error) //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) -//sys fcntl(fd int, cmd int, arg int) (val int, err error) //sys Fdatasync(fd int) (err error) //sys Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) //sys FinitModule(fd int, params string, flags int) (err error) @@ -1631,6 +1630,17 @@ func Getpgrp() (pid int) { //sysnb Settimeofday(tv *Timeval) (err error) //sys Setns(fd int, nstype int) (err error) +// PrctlRetInt performs a prctl operation specified by option and further +// optional arguments arg2 through arg5 depending on option. It returns a +// non-negative integer that is returned by the prctl syscall. +func PrctlRetInt(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (int, error) { + ret, _, err := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) + if err != 0 { + return 0, err + } + return int(ret), nil +} + // issue 1435. // On linux Setuid and Setgid only affects the current thread, not the process. // This does not match what most callers expect so we must return an error @@ -1644,6 +1654,30 @@ func Setgid(uid int) (err error) { return EOPNOTSUPP } +// SetfsgidRetGid sets fsgid for current thread and returns previous fsgid set. +// setfsgid(2) will return a non-nil error only if its caller lacks CAP_SETUID capability. +// If the call fails due to other reasons, current fsgid will be returned. +func SetfsgidRetGid(gid int) (int, error) { + return setfsgid(gid) +} + +// SetfsuidRetUid sets fsuid for current thread and returns previous fsuid set. +// setfsgid(2) will return a non-nil error only if its caller lacks CAP_SETUID capability +// If the call fails due to other reasons, current fsuid will be returned. +func SetfsuidRetUid(uid int) (int, error) { + return setfsuid(uid) +} + +func Setfsgid(gid int) error { + _, err := setfsgid(gid) + return err +} + +func Setfsuid(uid int) error { + _, err := setfsuid(uid) + return err +} + func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) { return signalfd(fd, sigmask, _C__NSIG/8, flags) } @@ -1666,6 +1700,123 @@ func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) { //sys exitThread(code int) (err error) = SYS_EXIT //sys readlen(fd int, p *byte, np int) (n int, err error) = SYS_READ //sys writelen(fd int, p *byte, np int) (n int, err error) = SYS_WRITE +//sys readv(fd int, iovs []Iovec) (n int, err error) = SYS_READV +//sys writev(fd int, iovs []Iovec) (n int, err error) = SYS_WRITEV +//sys preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PREADV +//sys pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PWRITEV +//sys preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PREADV2 +//sys pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PWRITEV2 + +func bytes2iovec(bs [][]byte) []Iovec { + iovecs := make([]Iovec, len(bs)) + for i, b := range bs { + iovecs[i].SetLen(len(b)) + if len(b) > 0 { + iovecs[i].Base = &b[0] + } else { + iovecs[i].Base = (*byte)(unsafe.Pointer(&_zero)) + } + } + return iovecs +} + +// offs2lohi splits offs into its lower and upper unsigned long. On 64-bit +// systems, hi will always be 0. On 32-bit systems, offs will be split in half. +// preadv/pwritev chose this calling convention so they don't need to add a +// padding-register for alignment on ARM. +func offs2lohi(offs int64) (lo, hi uintptr) { + return uintptr(offs), uintptr(uint64(offs) >> SizeofLong) +} + +func Readv(fd int, iovs [][]byte) (n int, err error) { + iovecs := bytes2iovec(iovs) + n, err = readv(fd, iovecs) + readvRacedetect(iovecs, n, err) + return n, err +} + +func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { + iovecs := bytes2iovec(iovs) + lo, hi := offs2lohi(offset) + n, err = preadv(fd, iovecs, lo, hi) + readvRacedetect(iovecs, n, err) + return n, err +} + +func Preadv2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) { + iovecs := bytes2iovec(iovs) + lo, hi := offs2lohi(offset) + n, err = preadv2(fd, iovecs, lo, hi, flags) + readvRacedetect(iovecs, n, err) + return n, err +} + +func readvRacedetect(iovecs []Iovec, n int, err error) { + if !raceenabled { + return + } + for i := 0; n > 0 && i < len(iovecs); i++ { + m := int(iovecs[i].Len) + if m > n { + m = n + } + n -= m + if m > 0 { + raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) + } + } + if err == nil { + raceAcquire(unsafe.Pointer(&ioSync)) + } +} + +func Writev(fd int, iovs [][]byte) (n int, err error) { + iovecs := bytes2iovec(iovs) + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + n, err = writev(fd, iovecs) + writevRacedetect(iovecs, n) + return n, err +} + +func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { + iovecs := bytes2iovec(iovs) + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + lo, hi := offs2lohi(offset) + n, err = pwritev(fd, iovecs, lo, hi) + writevRacedetect(iovecs, n) + return n, err +} + +func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) { + iovecs := bytes2iovec(iovs) + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + lo, hi := offs2lohi(offset) + n, err = pwritev2(fd, iovecs, lo, hi, flags) + writevRacedetect(iovecs, n) + return n, err +} + +func writevRacedetect(iovecs []Iovec, n int) { + if !raceenabled { + return + } + for i := 0; n > 0 && i < len(iovecs); i++ { + m := int(iovecs[i].Len) + if m > n { + m = n + } + n -= m + if m > 0 { + raceReadRange(unsafe.Pointer(iovecs[i].Base), m) + } + } +} // mmap varies by architecture; see syscall_linux_*.go. //sys munmap(addr uintptr, length uintptr) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_386.go index e7fa665e68..a8374b67cf 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_386.go @@ -70,8 +70,8 @@ func Pipe2(p []int, flags int) (err error) { //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 -//sys Setfsgid(gid int) (err error) = SYS_SETFSGID32 -//sys Setfsuid(uid int) (err error) = SYS_SETFSUID32 +//sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32 +//sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32 //sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32 //sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32 //sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go index 088ce0f935..8ed1d546f0 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go @@ -55,8 +55,8 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err } //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) -//sys Setfsgid(gid int) (err error) -//sys Setfsuid(uid int) (err error) +//sys setfsgid(gid int) (prev int, err error) +//sys setfsuid(uid int) (prev int, err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go index 11930fc8fa..99ae613733 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go @@ -98,8 +98,8 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT -//sys Setfsgid(gid int) (err error) = SYS_SETFSGID32 -//sys Setfsuid(uid int) (err error) = SYS_SETFSUID32 +//sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32 +//sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32 //sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32 //sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32 //sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go index 251e2d9715..807a0b20c3 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go @@ -42,8 +42,8 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err } //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) -//sys Setfsgid(gid int) (err error) -//sys Setfsuid(uid int) (err error) +//sys setfsgid(gid int) (prev int, err error) +//sys setfsuid(uid int) (prev int, err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go index 7562fe97b8..af77e6e25e 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go @@ -36,8 +36,8 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err } //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) -//sys Setfsgid(gid int) (err error) -//sys Setfsuid(uid int) (err error) +//sys setfsgid(gid int) (prev int, err error) +//sys setfsuid(uid int) (prev int, err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) @@ -216,6 +216,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func InotifyInit() (fd int, err error) { + return InotifyInit1(0) +} + //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) func Poll(fds []PollFd, timeout int) (n int, err error) { diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go index a939ff8f21..e286c6ba31 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go @@ -31,8 +31,8 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 -//sys Setfsgid(gid int) (err error) -//sys Setfsuid(uid int) (err error) +//sys setfsgid(gid int) (prev int, err error) +//sys setfsuid(uid int) (prev int, err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go index 28d6d0f229..ca0345aabf 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go @@ -34,8 +34,8 @@ package unix //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) -//sys Setfsgid(gid int) (err error) -//sys Setfsuid(uid int) (err error) +//sys setfsgid(gid int) (prev int, err error) +//sys setfsuid(uid int) (prev int, err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go index 6798c26258..abdabbac3f 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go @@ -41,8 +41,8 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err } //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) -//sys Setfsgid(gid int) (err error) -//sys Setfsuid(uid int) (err error) +//sys setfsgid(gid int) (prev int, err error) +//sys setfsuid(uid int) (prev int, err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go index eb5cb1a71d..533e9305e7 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go @@ -34,8 +34,8 @@ import ( //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) -//sys Setfsgid(gid int) (err error) -//sys Setfsuid(uid int) (err error) +//sys setfsgid(gid int) (prev int, err error) +//sys setfsuid(uid int) (prev int, err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go index 37321c12ef..d890a227bf 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go @@ -30,8 +30,8 @@ package unix //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) -//sys Setfsgid(gid int) (err error) -//sys Setfsuid(uid int) (err error) +//sys setfsgid(gid int) (prev int, err error) +//sys setfsuid(uid int) (prev int, err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/vendor/golang.org/x/sys/unix/syscall_netbsd.go index 211131d9cf..45b50a6105 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd.go @@ -106,23 +106,6 @@ func direntNamlen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) } -func SysctlClockinfo(name string) (*Clockinfo, error) { - mib, err := sysctlmib(name) - if err != nil { - return nil, err - } - - n := uintptr(SizeofClockinfo) - var ci Clockinfo - if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil { - return nil, err - } - if n != SizeofClockinfo { - return nil, EIO - } - return &ci, nil -} - //sysnb pipe() (fd1 int, fd2 int, err error) func Pipe(p []int) (err error) { if len(p) != 2 { @@ -249,6 +232,14 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e return sendfile(outfd, infd, offset, count) } +func Fstatvfs(fd int, buf *Statvfs_t) (err error) { + return Fstatvfs1(fd, buf, ST_WAIT) +} + +func Statvfs(path string, buf *Statvfs_t) (err error) { + return Statvfs1(path, buf, ST_WAIT) +} + /* * Exposed directly */ @@ -262,6 +253,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Close(fd int) (err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) +//sys Dup3(from int, to int, flags int) (err error) //sys Exit(code int) //sys ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) //sys ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) @@ -287,6 +279,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Fpathconf(fd int, name int) (val int, err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) +//sys Fstatvfs1(fd int, buf *Statvfs_t, flags int) (err error) = SYS_FSTATVFS1 //sys Fsync(fd int) (err error) //sys Ftruncate(fd int, length int64) (err error) //sysnb Getegid() (egid int) @@ -343,6 +336,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sysnb Settimeofday(tp *Timeval) (err error) //sysnb Setuid(uid int) (err error) //sys Stat(path string, stat *Stat_t) (err error) +//sys Statvfs1(path string, buf *Statvfs_t, flags int) (err error) = SYS_STATVFS1 //sys Symlink(path string, link string) (err error) //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) //sys Sync() (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go index 92ed67de0b..a266e92a9b 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -55,23 +55,6 @@ func direntNamlen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) } -func SysctlClockinfo(name string) (*Clockinfo, error) { - mib, err := sysctlmib(name) - if err != nil { - return nil, err - } - - n := uintptr(SizeofClockinfo) - var ci Clockinfo - if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil { - return nil, err - } - if n != SizeofClockinfo { - return nil, EIO - } - return &ci, nil -} - func SysctlUvmexp(name string) (*Uvmexp, error) { mib, err := sysctlmib(name) if err != nil { @@ -89,16 +72,20 @@ func SysctlUvmexp(name string) (*Uvmexp, error) { return &u, nil } -//sysnb pipe(p *[2]_C_int) (err error) func Pipe(p []int) (err error) { + return Pipe2(p, 0) +} + +//sysnb pipe2(p *[2]_C_int, flags int) (err error) +func Pipe2(p []int, flags int) error { if len(p) != 2 { return EINVAL } var pp [2]_C_int - err = pipe(&pp) + err := pipe2(&pp, flags) p[0] = int(pp[0]) p[1] = int(pp[1]) - return + return err } //sys Getdents(fd int, buf []byte) (n int, err error) @@ -248,6 +235,7 @@ func Uname(uname *Utsname) error { //sys Close(fd int) (err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) +//sys Dup3(from int, to int, flags int) (err error) //sys Exit(code int) //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchdir(fd int) (err error) @@ -352,7 +340,6 @@ func Uname(uname *Utsname) error { // clock_settime // closefrom // execve -// fcntl // fhopen // fhstat // fhstatfs diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 9ac5230001..72066f808a 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -243,6 +243,7 @@ const ( BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 + BPF_F_MMAPABLE = 0x400 BPF_F_NO_COMMON_LRU = 0x2 BPF_F_NO_PREALLOC = 0x1 BPF_F_NUMA_NODE = 0x4 @@ -417,8 +418,10 @@ const ( CLOCK_TXFROMRX = 0x4 CLOCK_TXINT = 0x3 CLONE_ARGS_SIZE_VER0 = 0x40 + CLONE_ARGS_SIZE_VER1 = 0x50 CLONE_CHILD_CLEARTID = 0x200000 CLONE_CHILD_SETTID = 0x1000000 + CLONE_CLEAR_SIGHAND = 0x100000000 CLONE_DETACHED = 0x400000 CLONE_FILES = 0x400 CLONE_FS = 0x200 @@ -716,8 +719,9 @@ const ( FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 - FSCRYPT_POLICY_FLAGS_VALID = 0x7 + FSCRYPT_POLICY_FLAGS_VALID = 0xf FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 + FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 FSCRYPT_POLICY_V1 = 0x0 FSCRYPT_POLICY_V2 = 0x2 FS_ENCRYPTION_MODE_ADIANTUM = 0x9 @@ -747,7 +751,7 @@ const ( FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 - FS_POLICY_FLAGS_VALID = 0x7 + FS_POLICY_FLAGS_VALID = 0xf FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -1229,6 +1233,7 @@ const ( LOOP_SET_STATUS64 = 0x4c04 LO_KEY_SIZE = 0x20 LO_NAME_SIZE = 0x40 + MADV_COLD = 0x14 MADV_DODUMP = 0x11 MADV_DOFORK = 0xb MADV_DONTDUMP = 0x10 @@ -1241,6 +1246,7 @@ const ( MADV_MERGEABLE = 0xc MADV_NOHUGEPAGE = 0xf MADV_NORMAL = 0x0 + MADV_PAGEOUT = 0x15 MADV_RANDOM = 0x1 MADV_REMOVE = 0x9 MADV_SEQUENTIAL = 0x2 @@ -1583,6 +1589,7 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40042406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPC_CMM_MAGIC = 0xc7571590 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 PPPIOCCONNECT = 0x4004743a @@ -1593,6 +1600,8 @@ const ( PPPIOCGDEBUG = 0x80047441 PPPIOCGFLAGS = 0x8004745a PPPIOCGIDLE = 0x8008743f + PPPIOCGIDLE32 = 0x8008743f + PPPIOCGIDLE64 = 0x8010743f PPPIOCGL2TPSTATS = 0x80487436 PPPIOCGMRU = 0x80047453 PPPIOCGNPMODE = 0xc008744c @@ -1929,12 +1938,28 @@ const ( RTF_UP = 0x1 RTF_WINDOW = 0x80 RTF_XRESOLVE = 0x800 + RTMGRP_DECnet_IFADDR = 0x1000 + RTMGRP_DECnet_ROUTE = 0x4000 + RTMGRP_IPV4_IFADDR = 0x10 + RTMGRP_IPV4_MROUTE = 0x20 + RTMGRP_IPV4_ROUTE = 0x40 + RTMGRP_IPV4_RULE = 0x80 + RTMGRP_IPV6_IFADDR = 0x100 + RTMGRP_IPV6_IFINFO = 0x800 + RTMGRP_IPV6_MROUTE = 0x200 + RTMGRP_IPV6_PREFIX = 0x20000 + RTMGRP_IPV6_ROUTE = 0x400 + RTMGRP_LINK = 0x1 + RTMGRP_NEIGH = 0x4 + RTMGRP_NOTIFY = 0x2 + RTMGRP_TC = 0x8 RTM_BASE = 0x10 RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 + RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 @@ -1958,6 +1983,7 @@ const ( RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 + RTM_GETLINKPROP = 0x6e RTM_GETMDB = 0x56 RTM_GETMULTICAST = 0x3a RTM_GETNEIGH = 0x1e @@ -1971,13 +1997,14 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6b + RTM_MAX = 0x6f RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 + RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c @@ -1992,8 +2019,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x17 - RTM_NR_MSGTYPES = 0x5c + RTM_NR_FAMILIES = 0x18 + RTM_NR_MSGTYPES = 0x60 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2035,6 +2062,13 @@ const ( RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 + RWF_APPEND = 0x10 + RWF_DSYNC = 0x2 + RWF_HIPRI = 0x1 + RWF_NOWAIT = 0x8 + RWF_SUPPORTED = 0x1f + RWF_SYNC = 0x4 + RWF_WRITE_LIFE_NOT_SET = 0x0 SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x1d @@ -2201,7 +2235,7 @@ const ( SOL_TLS = 0x11a SOL_X25 = 0x106 SOL_XDP = 0x11b - SOMAXCONN = 0x80 + SOMAXCONN = 0x1000 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_FILTER = 0x1a @@ -2307,6 +2341,7 @@ const ( STATX_ATTR_ENCRYPTED = 0x800 STATX_ATTR_IMMUTABLE = 0x10 STATX_ATTR_NODUMP = 0x40 + STATX_ATTR_VERITY = 0x100000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -2427,6 +2462,7 @@ const ( TCP_THIN_DUPACK = 0x11 TCP_THIN_LINEAR_TIMEOUTS = 0x10 TCP_TIMESTAMP = 0x18 + TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa @@ -2523,6 +2559,10 @@ const ( TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 TIPC_ADDR_NAMESEQ = 0x1 + TIPC_AEAD_ALG_NAME = 0x20 + TIPC_AEAD_KEYLEN_MAX = 0x24 + TIPC_AEAD_KEYLEN_MIN = 0x14 + TIPC_AEAD_KEY_SIZE_MAX = 0x48 TIPC_CFG_SRV = 0x0 TIPC_CLUSTER_BITS = 0xc TIPC_CLUSTER_MASK = 0xfff000 @@ -2555,6 +2595,7 @@ const ( TIPC_MCAST_REPLICAST = 0x86 TIPC_MEDIUM_IMPORTANCE = 0x1 TIPC_NODEID_LEN = 0x10 + TIPC_NODELAY = 0x8a TIPC_NODE_BITS = 0xc TIPC_NODE_MASK = 0xfff TIPC_NODE_OFFSET = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index 47622b9557..ea6bb88dea 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -243,6 +243,7 @@ const ( BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 + BPF_F_MMAPABLE = 0x400 BPF_F_NO_COMMON_LRU = 0x2 BPF_F_NO_PREALLOC = 0x1 BPF_F_NUMA_NODE = 0x4 @@ -417,8 +418,10 @@ const ( CLOCK_TXFROMRX = 0x4 CLOCK_TXINT = 0x3 CLONE_ARGS_SIZE_VER0 = 0x40 + CLONE_ARGS_SIZE_VER1 = 0x50 CLONE_CHILD_CLEARTID = 0x200000 CLONE_CHILD_SETTID = 0x1000000 + CLONE_CLEAR_SIGHAND = 0x100000000 CLONE_DETACHED = 0x400000 CLONE_FILES = 0x400 CLONE_FS = 0x200 @@ -716,8 +719,9 @@ const ( FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 - FSCRYPT_POLICY_FLAGS_VALID = 0x7 + FSCRYPT_POLICY_FLAGS_VALID = 0xf FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 + FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 FSCRYPT_POLICY_V1 = 0x0 FSCRYPT_POLICY_V2 = 0x2 FS_ENCRYPTION_MODE_ADIANTUM = 0x9 @@ -747,7 +751,7 @@ const ( FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 - FS_POLICY_FLAGS_VALID = 0x7 + FS_POLICY_FLAGS_VALID = 0xf FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -1229,6 +1233,7 @@ const ( LOOP_SET_STATUS64 = 0x4c04 LO_KEY_SIZE = 0x20 LO_NAME_SIZE = 0x40 + MADV_COLD = 0x14 MADV_DODUMP = 0x11 MADV_DOFORK = 0xb MADV_DONTDUMP = 0x10 @@ -1241,6 +1246,7 @@ const ( MADV_MERGEABLE = 0xc MADV_NOHUGEPAGE = 0xf MADV_NORMAL = 0x0 + MADV_PAGEOUT = 0x15 MADV_RANDOM = 0x1 MADV_REMOVE = 0x9 MADV_SEQUENTIAL = 0x2 @@ -1583,6 +1589,7 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPC_CMM_MAGIC = 0xc7571590 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 PPPIOCCONNECT = 0x4004743a @@ -1593,6 +1600,8 @@ const ( PPPIOCGDEBUG = 0x80047441 PPPIOCGFLAGS = 0x8004745a PPPIOCGIDLE = 0x8010743f + PPPIOCGIDLE32 = 0x8008743f + PPPIOCGIDLE64 = 0x8010743f PPPIOCGL2TPSTATS = 0x80487436 PPPIOCGMRU = 0x80047453 PPPIOCGNPMODE = 0xc008744c @@ -1930,12 +1939,28 @@ const ( RTF_UP = 0x1 RTF_WINDOW = 0x80 RTF_XRESOLVE = 0x800 + RTMGRP_DECnet_IFADDR = 0x1000 + RTMGRP_DECnet_ROUTE = 0x4000 + RTMGRP_IPV4_IFADDR = 0x10 + RTMGRP_IPV4_MROUTE = 0x20 + RTMGRP_IPV4_ROUTE = 0x40 + RTMGRP_IPV4_RULE = 0x80 + RTMGRP_IPV6_IFADDR = 0x100 + RTMGRP_IPV6_IFINFO = 0x800 + RTMGRP_IPV6_MROUTE = 0x200 + RTMGRP_IPV6_PREFIX = 0x20000 + RTMGRP_IPV6_ROUTE = 0x400 + RTMGRP_LINK = 0x1 + RTMGRP_NEIGH = 0x4 + RTMGRP_NOTIFY = 0x2 + RTMGRP_TC = 0x8 RTM_BASE = 0x10 RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 + RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 @@ -1959,6 +1984,7 @@ const ( RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 + RTM_GETLINKPROP = 0x6e RTM_GETMDB = 0x56 RTM_GETMULTICAST = 0x3a RTM_GETNEIGH = 0x1e @@ -1972,13 +1998,14 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6b + RTM_MAX = 0x6f RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 + RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c @@ -1993,8 +2020,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x17 - RTM_NR_MSGTYPES = 0x5c + RTM_NR_FAMILIES = 0x18 + RTM_NR_MSGTYPES = 0x60 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2036,6 +2063,13 @@ const ( RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 + RWF_APPEND = 0x10 + RWF_DSYNC = 0x2 + RWF_HIPRI = 0x1 + RWF_NOWAIT = 0x8 + RWF_SUPPORTED = 0x1f + RWF_SYNC = 0x4 + RWF_WRITE_LIFE_NOT_SET = 0x0 SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x1d @@ -2202,7 +2236,7 @@ const ( SOL_TLS = 0x11a SOL_X25 = 0x106 SOL_XDP = 0x11b - SOMAXCONN = 0x80 + SOMAXCONN = 0x1000 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_FILTER = 0x1a @@ -2308,6 +2342,7 @@ const ( STATX_ATTR_ENCRYPTED = 0x800 STATX_ATTR_IMMUTABLE = 0x10 STATX_ATTR_NODUMP = 0x40 + STATX_ATTR_VERITY = 0x100000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -2428,6 +2463,7 @@ const ( TCP_THIN_DUPACK = 0x11 TCP_THIN_LINEAR_TIMEOUTS = 0x10 TCP_TIMESTAMP = 0x18 + TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa @@ -2524,6 +2560,10 @@ const ( TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 TIPC_ADDR_NAMESEQ = 0x1 + TIPC_AEAD_ALG_NAME = 0x20 + TIPC_AEAD_KEYLEN_MAX = 0x24 + TIPC_AEAD_KEYLEN_MIN = 0x14 + TIPC_AEAD_KEY_SIZE_MAX = 0x48 TIPC_CFG_SRV = 0x0 TIPC_CLUSTER_BITS = 0xc TIPC_CLUSTER_MASK = 0xfff000 @@ -2556,6 +2596,7 @@ const ( TIPC_MCAST_REPLICAST = 0x86 TIPC_MEDIUM_IMPORTANCE = 0x1 TIPC_NODEID_LEN = 0x10 + TIPC_NODELAY = 0x8a TIPC_NODE_BITS = 0xc TIPC_NODE_MASK = 0xfff TIPC_NODE_OFFSET = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index 56cd2ebe1e..76b3d3b0e2 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -243,6 +243,7 @@ const ( BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 + BPF_F_MMAPABLE = 0x400 BPF_F_NO_COMMON_LRU = 0x2 BPF_F_NO_PREALLOC = 0x1 BPF_F_NUMA_NODE = 0x4 @@ -417,8 +418,10 @@ const ( CLOCK_TXFROMRX = 0x4 CLOCK_TXINT = 0x3 CLONE_ARGS_SIZE_VER0 = 0x40 + CLONE_ARGS_SIZE_VER1 = 0x50 CLONE_CHILD_CLEARTID = 0x200000 CLONE_CHILD_SETTID = 0x1000000 + CLONE_CLEAR_SIGHAND = 0x100000000 CLONE_DETACHED = 0x400000 CLONE_FILES = 0x400 CLONE_FS = 0x200 @@ -715,8 +718,9 @@ const ( FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 - FSCRYPT_POLICY_FLAGS_VALID = 0x7 + FSCRYPT_POLICY_FLAGS_VALID = 0xf FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 + FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 FSCRYPT_POLICY_V1 = 0x0 FSCRYPT_POLICY_V2 = 0x2 FS_ENCRYPTION_MODE_ADIANTUM = 0x9 @@ -746,7 +750,7 @@ const ( FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 - FS_POLICY_FLAGS_VALID = 0x7 + FS_POLICY_FLAGS_VALID = 0xf FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -1228,6 +1232,7 @@ const ( LOOP_SET_STATUS64 = 0x4c04 LO_KEY_SIZE = 0x20 LO_NAME_SIZE = 0x40 + MADV_COLD = 0x14 MADV_DODUMP = 0x11 MADV_DOFORK = 0xb MADV_DONTDUMP = 0x10 @@ -1240,6 +1245,7 @@ const ( MADV_MERGEABLE = 0xc MADV_NOHUGEPAGE = 0xf MADV_NORMAL = 0x0 + MADV_PAGEOUT = 0x15 MADV_RANDOM = 0x1 MADV_REMOVE = 0x9 MADV_SEQUENTIAL = 0x2 @@ -1581,6 +1587,7 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40042406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPC_CMM_MAGIC = 0xc7571590 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 PPPIOCCONNECT = 0x4004743a @@ -1591,6 +1598,8 @@ const ( PPPIOCGDEBUG = 0x80047441 PPPIOCGFLAGS = 0x8004745a PPPIOCGIDLE = 0x8008743f + PPPIOCGIDLE32 = 0x8008743f + PPPIOCGIDLE64 = 0x8010743f PPPIOCGL2TPSTATS = 0x80487436 PPPIOCGMRU = 0x80047453 PPPIOCGNPMODE = 0xc008744c @@ -1936,12 +1945,28 @@ const ( RTF_UP = 0x1 RTF_WINDOW = 0x80 RTF_XRESOLVE = 0x800 + RTMGRP_DECnet_IFADDR = 0x1000 + RTMGRP_DECnet_ROUTE = 0x4000 + RTMGRP_IPV4_IFADDR = 0x10 + RTMGRP_IPV4_MROUTE = 0x20 + RTMGRP_IPV4_ROUTE = 0x40 + RTMGRP_IPV4_RULE = 0x80 + RTMGRP_IPV6_IFADDR = 0x100 + RTMGRP_IPV6_IFINFO = 0x800 + RTMGRP_IPV6_MROUTE = 0x200 + RTMGRP_IPV6_PREFIX = 0x20000 + RTMGRP_IPV6_ROUTE = 0x400 + RTMGRP_LINK = 0x1 + RTMGRP_NEIGH = 0x4 + RTMGRP_NOTIFY = 0x2 + RTMGRP_TC = 0x8 RTM_BASE = 0x10 RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 + RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 @@ -1965,6 +1990,7 @@ const ( RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 + RTM_GETLINKPROP = 0x6e RTM_GETMDB = 0x56 RTM_GETMULTICAST = 0x3a RTM_GETNEIGH = 0x1e @@ -1978,13 +2004,14 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6b + RTM_MAX = 0x6f RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 + RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c @@ -1999,8 +2026,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x17 - RTM_NR_MSGTYPES = 0x5c + RTM_NR_FAMILIES = 0x18 + RTM_NR_MSGTYPES = 0x60 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2042,6 +2069,13 @@ const ( RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 + RWF_APPEND = 0x10 + RWF_DSYNC = 0x2 + RWF_HIPRI = 0x1 + RWF_NOWAIT = 0x8 + RWF_SUPPORTED = 0x1f + RWF_SYNC = 0x4 + RWF_WRITE_LIFE_NOT_SET = 0x0 SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x1d @@ -2208,7 +2242,7 @@ const ( SOL_TLS = 0x11a SOL_X25 = 0x106 SOL_XDP = 0x11b - SOMAXCONN = 0x80 + SOMAXCONN = 0x1000 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_FILTER = 0x1a @@ -2314,6 +2348,7 @@ const ( STATX_ATTR_ENCRYPTED = 0x800 STATX_ATTR_IMMUTABLE = 0x10 STATX_ATTR_NODUMP = 0x40 + STATX_ATTR_VERITY = 0x100000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -2434,6 +2469,7 @@ const ( TCP_THIN_DUPACK = 0x11 TCP_THIN_LINEAR_TIMEOUTS = 0x10 TCP_TIMESTAMP = 0x18 + TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa @@ -2530,6 +2566,10 @@ const ( TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 TIPC_ADDR_NAMESEQ = 0x1 + TIPC_AEAD_ALG_NAME = 0x20 + TIPC_AEAD_KEYLEN_MAX = 0x24 + TIPC_AEAD_KEYLEN_MIN = 0x14 + TIPC_AEAD_KEY_SIZE_MAX = 0x48 TIPC_CFG_SRV = 0x0 TIPC_CLUSTER_BITS = 0xc TIPC_CLUSTER_MASK = 0xfff000 @@ -2562,6 +2602,7 @@ const ( TIPC_MCAST_REPLICAST = 0x86 TIPC_MEDIUM_IMPORTANCE = 0x1 TIPC_NODEID_LEN = 0x10 + TIPC_NODELAY = 0x8a TIPC_NODE_BITS = 0xc TIPC_NODE_MASK = 0xfff TIPC_NODE_OFFSET = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 39712d7777..1405ea5709 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -243,6 +243,7 @@ const ( BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 + BPF_F_MMAPABLE = 0x400 BPF_F_NO_COMMON_LRU = 0x2 BPF_F_NO_PREALLOC = 0x1 BPF_F_NUMA_NODE = 0x4 @@ -417,8 +418,10 @@ const ( CLOCK_TXFROMRX = 0x4 CLOCK_TXINT = 0x3 CLONE_ARGS_SIZE_VER0 = 0x40 + CLONE_ARGS_SIZE_VER1 = 0x50 CLONE_CHILD_CLEARTID = 0x200000 CLONE_CHILD_SETTID = 0x1000000 + CLONE_CLEAR_SIGHAND = 0x100000000 CLONE_DETACHED = 0x400000 CLONE_FILES = 0x400 CLONE_FS = 0x200 @@ -718,8 +721,9 @@ const ( FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 - FSCRYPT_POLICY_FLAGS_VALID = 0x7 + FSCRYPT_POLICY_FLAGS_VALID = 0xf FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 + FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 FSCRYPT_POLICY_V1 = 0x0 FSCRYPT_POLICY_V2 = 0x2 FS_ENCRYPTION_MODE_ADIANTUM = 0x9 @@ -749,7 +753,7 @@ const ( FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 - FS_POLICY_FLAGS_VALID = 0x7 + FS_POLICY_FLAGS_VALID = 0xf FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -1231,6 +1235,7 @@ const ( LOOP_SET_STATUS64 = 0x4c04 LO_KEY_SIZE = 0x20 LO_NAME_SIZE = 0x40 + MADV_COLD = 0x14 MADV_DODUMP = 0x11 MADV_DOFORK = 0xb MADV_DONTDUMP = 0x10 @@ -1243,6 +1248,7 @@ const ( MADV_MERGEABLE = 0xc MADV_NOHUGEPAGE = 0xf MADV_NORMAL = 0x0 + MADV_PAGEOUT = 0x15 MADV_RANDOM = 0x1 MADV_REMOVE = 0x9 MADV_SEQUENTIAL = 0x2 @@ -1584,6 +1590,7 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPC_CMM_MAGIC = 0xc7571590 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 PPPIOCCONNECT = 0x4004743a @@ -1594,6 +1601,8 @@ const ( PPPIOCGDEBUG = 0x80047441 PPPIOCGFLAGS = 0x8004745a PPPIOCGIDLE = 0x8010743f + PPPIOCGIDLE32 = 0x8008743f + PPPIOCGIDLE64 = 0x8010743f PPPIOCGL2TPSTATS = 0x80487436 PPPIOCGMRU = 0x80047453 PPPIOCGNPMODE = 0xc008744c @@ -1922,12 +1931,28 @@ const ( RTF_UP = 0x1 RTF_WINDOW = 0x80 RTF_XRESOLVE = 0x800 + RTMGRP_DECnet_IFADDR = 0x1000 + RTMGRP_DECnet_ROUTE = 0x4000 + RTMGRP_IPV4_IFADDR = 0x10 + RTMGRP_IPV4_MROUTE = 0x20 + RTMGRP_IPV4_ROUTE = 0x40 + RTMGRP_IPV4_RULE = 0x80 + RTMGRP_IPV6_IFADDR = 0x100 + RTMGRP_IPV6_IFINFO = 0x800 + RTMGRP_IPV6_MROUTE = 0x200 + RTMGRP_IPV6_PREFIX = 0x20000 + RTMGRP_IPV6_ROUTE = 0x400 + RTMGRP_LINK = 0x1 + RTMGRP_NEIGH = 0x4 + RTMGRP_NOTIFY = 0x2 + RTMGRP_TC = 0x8 RTM_BASE = 0x10 RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 + RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 @@ -1951,6 +1976,7 @@ const ( RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 + RTM_GETLINKPROP = 0x6e RTM_GETMDB = 0x56 RTM_GETMULTICAST = 0x3a RTM_GETNEIGH = 0x1e @@ -1964,13 +1990,14 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6b + RTM_MAX = 0x6f RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 + RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c @@ -1985,8 +2012,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x17 - RTM_NR_MSGTYPES = 0x5c + RTM_NR_FAMILIES = 0x18 + RTM_NR_MSGTYPES = 0x60 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2028,6 +2055,13 @@ const ( RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 + RWF_APPEND = 0x10 + RWF_DSYNC = 0x2 + RWF_HIPRI = 0x1 + RWF_NOWAIT = 0x8 + RWF_SUPPORTED = 0x1f + RWF_SYNC = 0x4 + RWF_WRITE_LIFE_NOT_SET = 0x0 SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x1d @@ -2194,7 +2228,7 @@ const ( SOL_TLS = 0x11a SOL_X25 = 0x106 SOL_XDP = 0x11b - SOMAXCONN = 0x80 + SOMAXCONN = 0x1000 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_FILTER = 0x1a @@ -2300,6 +2334,7 @@ const ( STATX_ATTR_ENCRYPTED = 0x800 STATX_ATTR_IMMUTABLE = 0x10 STATX_ATTR_NODUMP = 0x40 + STATX_ATTR_VERITY = 0x100000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -2421,6 +2456,7 @@ const ( TCP_THIN_DUPACK = 0x11 TCP_THIN_LINEAR_TIMEOUTS = 0x10 TCP_TIMESTAMP = 0x18 + TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa @@ -2517,6 +2553,10 @@ const ( TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 TIPC_ADDR_NAMESEQ = 0x1 + TIPC_AEAD_ALG_NAME = 0x20 + TIPC_AEAD_KEYLEN_MAX = 0x24 + TIPC_AEAD_KEYLEN_MIN = 0x14 + TIPC_AEAD_KEY_SIZE_MAX = 0x48 TIPC_CFG_SRV = 0x0 TIPC_CLUSTER_BITS = 0xc TIPC_CLUSTER_MASK = 0xfff000 @@ -2549,6 +2589,7 @@ const ( TIPC_MCAST_REPLICAST = 0x86 TIPC_MEDIUM_IMPORTANCE = 0x1 TIPC_NODEID_LEN = 0x10 + TIPC_NODELAY = 0x8a TIPC_NODE_BITS = 0xc TIPC_NODE_MASK = 0xfff TIPC_NODE_OFFSET = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 89163c4100..a6cd090e93 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -243,6 +243,7 @@ const ( BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 + BPF_F_MMAPABLE = 0x400 BPF_F_NO_COMMON_LRU = 0x2 BPF_F_NO_PREALLOC = 0x1 BPF_F_NUMA_NODE = 0x4 @@ -417,8 +418,10 @@ const ( CLOCK_TXFROMRX = 0x4 CLOCK_TXINT = 0x3 CLONE_ARGS_SIZE_VER0 = 0x40 + CLONE_ARGS_SIZE_VER1 = 0x50 CLONE_CHILD_CLEARTID = 0x200000 CLONE_CHILD_SETTID = 0x1000000 + CLONE_CLEAR_SIGHAND = 0x100000000 CLONE_DETACHED = 0x400000 CLONE_FILES = 0x400 CLONE_FS = 0x200 @@ -715,8 +718,9 @@ const ( FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 - FSCRYPT_POLICY_FLAGS_VALID = 0x7 + FSCRYPT_POLICY_FLAGS_VALID = 0xf FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 + FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 FSCRYPT_POLICY_V1 = 0x0 FSCRYPT_POLICY_V2 = 0x2 FS_ENCRYPTION_MODE_ADIANTUM = 0x9 @@ -746,7 +750,7 @@ const ( FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 - FS_POLICY_FLAGS_VALID = 0x7 + FS_POLICY_FLAGS_VALID = 0xf FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -1228,6 +1232,7 @@ const ( LOOP_SET_STATUS64 = 0x4c04 LO_KEY_SIZE = 0x20 LO_NAME_SIZE = 0x40 + MADV_COLD = 0x14 MADV_DODUMP = 0x11 MADV_DOFORK = 0xb MADV_DONTDUMP = 0x10 @@ -1240,6 +1245,7 @@ const ( MADV_MERGEABLE = 0xc MADV_NOHUGEPAGE = 0xf MADV_NORMAL = 0x0 + MADV_PAGEOUT = 0x15 MADV_RANDOM = 0x1 MADV_REMOVE = 0x9 MADV_SEQUENTIAL = 0x2 @@ -1581,6 +1587,7 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80042406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPC_CMM_MAGIC = 0xc7571590 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCCONNECT = 0x8004743a @@ -1591,6 +1598,8 @@ const ( PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4008743f + PPPIOCGIDLE32 = 0x4008743f + PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGNPMODE = 0xc008744c @@ -1929,12 +1938,28 @@ const ( RTF_UP = 0x1 RTF_WINDOW = 0x80 RTF_XRESOLVE = 0x800 + RTMGRP_DECnet_IFADDR = 0x1000 + RTMGRP_DECnet_ROUTE = 0x4000 + RTMGRP_IPV4_IFADDR = 0x10 + RTMGRP_IPV4_MROUTE = 0x20 + RTMGRP_IPV4_ROUTE = 0x40 + RTMGRP_IPV4_RULE = 0x80 + RTMGRP_IPV6_IFADDR = 0x100 + RTMGRP_IPV6_IFINFO = 0x800 + RTMGRP_IPV6_MROUTE = 0x200 + RTMGRP_IPV6_PREFIX = 0x20000 + RTMGRP_IPV6_ROUTE = 0x400 + RTMGRP_LINK = 0x1 + RTMGRP_NEIGH = 0x4 + RTMGRP_NOTIFY = 0x2 + RTMGRP_TC = 0x8 RTM_BASE = 0x10 RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 + RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 @@ -1958,6 +1983,7 @@ const ( RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 + RTM_GETLINKPROP = 0x6e RTM_GETMDB = 0x56 RTM_GETMULTICAST = 0x3a RTM_GETNEIGH = 0x1e @@ -1971,13 +1997,14 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6b + RTM_MAX = 0x6f RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 + RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c @@ -1992,8 +2019,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x17 - RTM_NR_MSGTYPES = 0x5c + RTM_NR_FAMILIES = 0x18 + RTM_NR_MSGTYPES = 0x60 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2035,6 +2062,13 @@ const ( RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 + RWF_APPEND = 0x10 + RWF_DSYNC = 0x2 + RWF_HIPRI = 0x1 + RWF_NOWAIT = 0x8 + RWF_SUPPORTED = 0x1f + RWF_SYNC = 0x4 + RWF_WRITE_LIFE_NOT_SET = 0x0 SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x1d @@ -2201,7 +2235,7 @@ const ( SOL_TLS = 0x11a SOL_X25 = 0x106 SOL_XDP = 0x11b - SOMAXCONN = 0x80 + SOMAXCONN = 0x1000 SO_ACCEPTCONN = 0x1009 SO_ATTACH_BPF = 0x32 SO_ATTACH_FILTER = 0x1a @@ -2308,6 +2342,7 @@ const ( STATX_ATTR_ENCRYPTED = 0x800 STATX_ATTR_IMMUTABLE = 0x10 STATX_ATTR_NODUMP = 0x40 + STATX_ATTR_VERITY = 0x100000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -2427,6 +2462,7 @@ const ( TCP_THIN_DUPACK = 0x11 TCP_THIN_LINEAR_TIMEOUTS = 0x10 TCP_TIMESTAMP = 0x18 + TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa @@ -2525,6 +2561,10 @@ const ( TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 TIPC_ADDR_NAMESEQ = 0x1 + TIPC_AEAD_ALG_NAME = 0x20 + TIPC_AEAD_KEYLEN_MAX = 0x24 + TIPC_AEAD_KEYLEN_MIN = 0x14 + TIPC_AEAD_KEY_SIZE_MAX = 0x48 TIPC_CFG_SRV = 0x0 TIPC_CLUSTER_BITS = 0xc TIPC_CLUSTER_MASK = 0xfff000 @@ -2557,6 +2597,7 @@ const ( TIPC_MCAST_REPLICAST = 0x86 TIPC_MEDIUM_IMPORTANCE = 0x1 TIPC_NODEID_LEN = 0x10 + TIPC_NODELAY = 0x8a TIPC_NODE_BITS = 0xc TIPC_NODE_MASK = 0xfff TIPC_NODE_OFFSET = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 15284ff416..9152b5f12f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -243,6 +243,7 @@ const ( BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 + BPF_F_MMAPABLE = 0x400 BPF_F_NO_COMMON_LRU = 0x2 BPF_F_NO_PREALLOC = 0x1 BPF_F_NUMA_NODE = 0x4 @@ -417,8 +418,10 @@ const ( CLOCK_TXFROMRX = 0x4 CLOCK_TXINT = 0x3 CLONE_ARGS_SIZE_VER0 = 0x40 + CLONE_ARGS_SIZE_VER1 = 0x50 CLONE_CHILD_CLEARTID = 0x200000 CLONE_CHILD_SETTID = 0x1000000 + CLONE_CLEAR_SIGHAND = 0x100000000 CLONE_DETACHED = 0x400000 CLONE_FILES = 0x400 CLONE_FS = 0x200 @@ -715,8 +718,9 @@ const ( FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 - FSCRYPT_POLICY_FLAGS_VALID = 0x7 + FSCRYPT_POLICY_FLAGS_VALID = 0xf FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 + FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 FSCRYPT_POLICY_V1 = 0x0 FSCRYPT_POLICY_V2 = 0x2 FS_ENCRYPTION_MODE_ADIANTUM = 0x9 @@ -746,7 +750,7 @@ const ( FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 - FS_POLICY_FLAGS_VALID = 0x7 + FS_POLICY_FLAGS_VALID = 0xf FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -1228,6 +1232,7 @@ const ( LOOP_SET_STATUS64 = 0x4c04 LO_KEY_SIZE = 0x20 LO_NAME_SIZE = 0x40 + MADV_COLD = 0x14 MADV_DODUMP = 0x11 MADV_DOFORK = 0xb MADV_DONTDUMP = 0x10 @@ -1240,6 +1245,7 @@ const ( MADV_MERGEABLE = 0xc MADV_NOHUGEPAGE = 0xf MADV_NORMAL = 0x0 + MADV_PAGEOUT = 0x15 MADV_RANDOM = 0x1 MADV_REMOVE = 0x9 MADV_SEQUENTIAL = 0x2 @@ -1581,6 +1587,7 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPC_CMM_MAGIC = 0xc7571590 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCCONNECT = 0x8004743a @@ -1591,6 +1598,8 @@ const ( PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4010743f + PPPIOCGIDLE32 = 0x4008743f + PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGNPMODE = 0xc008744c @@ -1929,12 +1938,28 @@ const ( RTF_UP = 0x1 RTF_WINDOW = 0x80 RTF_XRESOLVE = 0x800 + RTMGRP_DECnet_IFADDR = 0x1000 + RTMGRP_DECnet_ROUTE = 0x4000 + RTMGRP_IPV4_IFADDR = 0x10 + RTMGRP_IPV4_MROUTE = 0x20 + RTMGRP_IPV4_ROUTE = 0x40 + RTMGRP_IPV4_RULE = 0x80 + RTMGRP_IPV6_IFADDR = 0x100 + RTMGRP_IPV6_IFINFO = 0x800 + RTMGRP_IPV6_MROUTE = 0x200 + RTMGRP_IPV6_PREFIX = 0x20000 + RTMGRP_IPV6_ROUTE = 0x400 + RTMGRP_LINK = 0x1 + RTMGRP_NEIGH = 0x4 + RTMGRP_NOTIFY = 0x2 + RTMGRP_TC = 0x8 RTM_BASE = 0x10 RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 + RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 @@ -1958,6 +1983,7 @@ const ( RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 + RTM_GETLINKPROP = 0x6e RTM_GETMDB = 0x56 RTM_GETMULTICAST = 0x3a RTM_GETNEIGH = 0x1e @@ -1971,13 +1997,14 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6b + RTM_MAX = 0x6f RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 + RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c @@ -1992,8 +2019,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x17 - RTM_NR_MSGTYPES = 0x5c + RTM_NR_FAMILIES = 0x18 + RTM_NR_MSGTYPES = 0x60 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2035,6 +2062,13 @@ const ( RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 + RWF_APPEND = 0x10 + RWF_DSYNC = 0x2 + RWF_HIPRI = 0x1 + RWF_NOWAIT = 0x8 + RWF_SUPPORTED = 0x1f + RWF_SYNC = 0x4 + RWF_WRITE_LIFE_NOT_SET = 0x0 SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x1d @@ -2201,7 +2235,7 @@ const ( SOL_TLS = 0x11a SOL_X25 = 0x106 SOL_XDP = 0x11b - SOMAXCONN = 0x80 + SOMAXCONN = 0x1000 SO_ACCEPTCONN = 0x1009 SO_ATTACH_BPF = 0x32 SO_ATTACH_FILTER = 0x1a @@ -2308,6 +2342,7 @@ const ( STATX_ATTR_ENCRYPTED = 0x800 STATX_ATTR_IMMUTABLE = 0x10 STATX_ATTR_NODUMP = 0x40 + STATX_ATTR_VERITY = 0x100000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -2427,6 +2462,7 @@ const ( TCP_THIN_DUPACK = 0x11 TCP_THIN_LINEAR_TIMEOUTS = 0x10 TCP_TIMESTAMP = 0x18 + TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa @@ -2525,6 +2561,10 @@ const ( TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 TIPC_ADDR_NAMESEQ = 0x1 + TIPC_AEAD_ALG_NAME = 0x20 + TIPC_AEAD_KEYLEN_MAX = 0x24 + TIPC_AEAD_KEYLEN_MIN = 0x14 + TIPC_AEAD_KEY_SIZE_MAX = 0x48 TIPC_CFG_SRV = 0x0 TIPC_CLUSTER_BITS = 0xc TIPC_CLUSTER_MASK = 0xfff000 @@ -2557,6 +2597,7 @@ const ( TIPC_MCAST_REPLICAST = 0x86 TIPC_MEDIUM_IMPORTANCE = 0x1 TIPC_NODEID_LEN = 0x10 + TIPC_NODELAY = 0x8a TIPC_NODE_BITS = 0xc TIPC_NODE_MASK = 0xfff TIPC_NODE_OFFSET = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 1ec7769406..e1aa146bcf 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -243,6 +243,7 @@ const ( BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 + BPF_F_MMAPABLE = 0x400 BPF_F_NO_COMMON_LRU = 0x2 BPF_F_NO_PREALLOC = 0x1 BPF_F_NUMA_NODE = 0x4 @@ -417,8 +418,10 @@ const ( CLOCK_TXFROMRX = 0x4 CLOCK_TXINT = 0x3 CLONE_ARGS_SIZE_VER0 = 0x40 + CLONE_ARGS_SIZE_VER1 = 0x50 CLONE_CHILD_CLEARTID = 0x200000 CLONE_CHILD_SETTID = 0x1000000 + CLONE_CLEAR_SIGHAND = 0x100000000 CLONE_DETACHED = 0x400000 CLONE_FILES = 0x400 CLONE_FS = 0x200 @@ -715,8 +718,9 @@ const ( FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 - FSCRYPT_POLICY_FLAGS_VALID = 0x7 + FSCRYPT_POLICY_FLAGS_VALID = 0xf FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 + FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 FSCRYPT_POLICY_V1 = 0x0 FSCRYPT_POLICY_V2 = 0x2 FS_ENCRYPTION_MODE_ADIANTUM = 0x9 @@ -746,7 +750,7 @@ const ( FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 - FS_POLICY_FLAGS_VALID = 0x7 + FS_POLICY_FLAGS_VALID = 0xf FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -1228,6 +1232,7 @@ const ( LOOP_SET_STATUS64 = 0x4c04 LO_KEY_SIZE = 0x20 LO_NAME_SIZE = 0x40 + MADV_COLD = 0x14 MADV_DODUMP = 0x11 MADV_DOFORK = 0xb MADV_DONTDUMP = 0x10 @@ -1240,6 +1245,7 @@ const ( MADV_MERGEABLE = 0xc MADV_NOHUGEPAGE = 0xf MADV_NORMAL = 0x0 + MADV_PAGEOUT = 0x15 MADV_RANDOM = 0x1 MADV_REMOVE = 0x9 MADV_SEQUENTIAL = 0x2 @@ -1581,6 +1587,7 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPC_CMM_MAGIC = 0xc7571590 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCCONNECT = 0x8004743a @@ -1591,6 +1598,8 @@ const ( PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4010743f + PPPIOCGIDLE32 = 0x4008743f + PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGNPMODE = 0xc008744c @@ -1929,12 +1938,28 @@ const ( RTF_UP = 0x1 RTF_WINDOW = 0x80 RTF_XRESOLVE = 0x800 + RTMGRP_DECnet_IFADDR = 0x1000 + RTMGRP_DECnet_ROUTE = 0x4000 + RTMGRP_IPV4_IFADDR = 0x10 + RTMGRP_IPV4_MROUTE = 0x20 + RTMGRP_IPV4_ROUTE = 0x40 + RTMGRP_IPV4_RULE = 0x80 + RTMGRP_IPV6_IFADDR = 0x100 + RTMGRP_IPV6_IFINFO = 0x800 + RTMGRP_IPV6_MROUTE = 0x200 + RTMGRP_IPV6_PREFIX = 0x20000 + RTMGRP_IPV6_ROUTE = 0x400 + RTMGRP_LINK = 0x1 + RTMGRP_NEIGH = 0x4 + RTMGRP_NOTIFY = 0x2 + RTMGRP_TC = 0x8 RTM_BASE = 0x10 RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 + RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 @@ -1958,6 +1983,7 @@ const ( RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 + RTM_GETLINKPROP = 0x6e RTM_GETMDB = 0x56 RTM_GETMULTICAST = 0x3a RTM_GETNEIGH = 0x1e @@ -1971,13 +1997,14 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6b + RTM_MAX = 0x6f RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 + RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c @@ -1992,8 +2019,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x17 - RTM_NR_MSGTYPES = 0x5c + RTM_NR_FAMILIES = 0x18 + RTM_NR_MSGTYPES = 0x60 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2035,6 +2062,13 @@ const ( RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 + RWF_APPEND = 0x10 + RWF_DSYNC = 0x2 + RWF_HIPRI = 0x1 + RWF_NOWAIT = 0x8 + RWF_SUPPORTED = 0x1f + RWF_SYNC = 0x4 + RWF_WRITE_LIFE_NOT_SET = 0x0 SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x1d @@ -2201,7 +2235,7 @@ const ( SOL_TLS = 0x11a SOL_X25 = 0x106 SOL_XDP = 0x11b - SOMAXCONN = 0x80 + SOMAXCONN = 0x1000 SO_ACCEPTCONN = 0x1009 SO_ATTACH_BPF = 0x32 SO_ATTACH_FILTER = 0x1a @@ -2308,6 +2342,7 @@ const ( STATX_ATTR_ENCRYPTED = 0x800 STATX_ATTR_IMMUTABLE = 0x10 STATX_ATTR_NODUMP = 0x40 + STATX_ATTR_VERITY = 0x100000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -2427,6 +2462,7 @@ const ( TCP_THIN_DUPACK = 0x11 TCP_THIN_LINEAR_TIMEOUTS = 0x10 TCP_TIMESTAMP = 0x18 + TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa @@ -2525,6 +2561,10 @@ const ( TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 TIPC_ADDR_NAMESEQ = 0x1 + TIPC_AEAD_ALG_NAME = 0x20 + TIPC_AEAD_KEYLEN_MAX = 0x24 + TIPC_AEAD_KEYLEN_MIN = 0x14 + TIPC_AEAD_KEY_SIZE_MAX = 0x48 TIPC_CFG_SRV = 0x0 TIPC_CLUSTER_BITS = 0xc TIPC_CLUSTER_MASK = 0xfff000 @@ -2557,6 +2597,7 @@ const ( TIPC_MCAST_REPLICAST = 0x86 TIPC_MEDIUM_IMPORTANCE = 0x1 TIPC_NODEID_LEN = 0x10 + TIPC_NODELAY = 0x8a TIPC_NODE_BITS = 0xc TIPC_NODE_MASK = 0xfff TIPC_NODE_OFFSET = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index f96d54563d..d23b3a9441 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -243,6 +243,7 @@ const ( BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 + BPF_F_MMAPABLE = 0x400 BPF_F_NO_COMMON_LRU = 0x2 BPF_F_NO_PREALLOC = 0x1 BPF_F_NUMA_NODE = 0x4 @@ -417,8 +418,10 @@ const ( CLOCK_TXFROMRX = 0x4 CLOCK_TXINT = 0x3 CLONE_ARGS_SIZE_VER0 = 0x40 + CLONE_ARGS_SIZE_VER1 = 0x50 CLONE_CHILD_CLEARTID = 0x200000 CLONE_CHILD_SETTID = 0x1000000 + CLONE_CLEAR_SIGHAND = 0x100000000 CLONE_DETACHED = 0x400000 CLONE_FILES = 0x400 CLONE_FS = 0x200 @@ -715,8 +718,9 @@ const ( FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 - FSCRYPT_POLICY_FLAGS_VALID = 0x7 + FSCRYPT_POLICY_FLAGS_VALID = 0xf FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 + FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 FSCRYPT_POLICY_V1 = 0x0 FSCRYPT_POLICY_V2 = 0x2 FS_ENCRYPTION_MODE_ADIANTUM = 0x9 @@ -746,7 +750,7 @@ const ( FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 - FS_POLICY_FLAGS_VALID = 0x7 + FS_POLICY_FLAGS_VALID = 0xf FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -1228,6 +1232,7 @@ const ( LOOP_SET_STATUS64 = 0x4c04 LO_KEY_SIZE = 0x20 LO_NAME_SIZE = 0x40 + MADV_COLD = 0x14 MADV_DODUMP = 0x11 MADV_DOFORK = 0xb MADV_DONTDUMP = 0x10 @@ -1240,6 +1245,7 @@ const ( MADV_MERGEABLE = 0xc MADV_NOHUGEPAGE = 0xf MADV_NORMAL = 0x0 + MADV_PAGEOUT = 0x15 MADV_RANDOM = 0x1 MADV_REMOVE = 0x9 MADV_SEQUENTIAL = 0x2 @@ -1581,6 +1587,7 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80042406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPC_CMM_MAGIC = 0xc7571590 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCCONNECT = 0x8004743a @@ -1591,6 +1598,8 @@ const ( PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4008743f + PPPIOCGIDLE32 = 0x4008743f + PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGNPMODE = 0xc008744c @@ -1929,12 +1938,28 @@ const ( RTF_UP = 0x1 RTF_WINDOW = 0x80 RTF_XRESOLVE = 0x800 + RTMGRP_DECnet_IFADDR = 0x1000 + RTMGRP_DECnet_ROUTE = 0x4000 + RTMGRP_IPV4_IFADDR = 0x10 + RTMGRP_IPV4_MROUTE = 0x20 + RTMGRP_IPV4_ROUTE = 0x40 + RTMGRP_IPV4_RULE = 0x80 + RTMGRP_IPV6_IFADDR = 0x100 + RTMGRP_IPV6_IFINFO = 0x800 + RTMGRP_IPV6_MROUTE = 0x200 + RTMGRP_IPV6_PREFIX = 0x20000 + RTMGRP_IPV6_ROUTE = 0x400 + RTMGRP_LINK = 0x1 + RTMGRP_NEIGH = 0x4 + RTMGRP_NOTIFY = 0x2 + RTMGRP_TC = 0x8 RTM_BASE = 0x10 RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 + RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 @@ -1958,6 +1983,7 @@ const ( RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 + RTM_GETLINKPROP = 0x6e RTM_GETMDB = 0x56 RTM_GETMULTICAST = 0x3a RTM_GETNEIGH = 0x1e @@ -1971,13 +1997,14 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6b + RTM_MAX = 0x6f RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 + RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c @@ -1992,8 +2019,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x17 - RTM_NR_MSGTYPES = 0x5c + RTM_NR_FAMILIES = 0x18 + RTM_NR_MSGTYPES = 0x60 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2035,6 +2062,13 @@ const ( RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 + RWF_APPEND = 0x10 + RWF_DSYNC = 0x2 + RWF_HIPRI = 0x1 + RWF_NOWAIT = 0x8 + RWF_SUPPORTED = 0x1f + RWF_SYNC = 0x4 + RWF_WRITE_LIFE_NOT_SET = 0x0 SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x1d @@ -2201,7 +2235,7 @@ const ( SOL_TLS = 0x11a SOL_X25 = 0x106 SOL_XDP = 0x11b - SOMAXCONN = 0x80 + SOMAXCONN = 0x1000 SO_ACCEPTCONN = 0x1009 SO_ATTACH_BPF = 0x32 SO_ATTACH_FILTER = 0x1a @@ -2308,6 +2342,7 @@ const ( STATX_ATTR_ENCRYPTED = 0x800 STATX_ATTR_IMMUTABLE = 0x10 STATX_ATTR_NODUMP = 0x40 + STATX_ATTR_VERITY = 0x100000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -2427,6 +2462,7 @@ const ( TCP_THIN_DUPACK = 0x11 TCP_THIN_LINEAR_TIMEOUTS = 0x10 TCP_TIMESTAMP = 0x18 + TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa @@ -2525,6 +2561,10 @@ const ( TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 TIPC_ADDR_NAMESEQ = 0x1 + TIPC_AEAD_ALG_NAME = 0x20 + TIPC_AEAD_KEYLEN_MAX = 0x24 + TIPC_AEAD_KEYLEN_MIN = 0x14 + TIPC_AEAD_KEY_SIZE_MAX = 0x48 TIPC_CFG_SRV = 0x0 TIPC_CLUSTER_BITS = 0xc TIPC_CLUSTER_MASK = 0xfff000 @@ -2557,6 +2597,7 @@ const ( TIPC_MCAST_REPLICAST = 0x86 TIPC_MEDIUM_IMPORTANCE = 0x1 TIPC_NODEID_LEN = 0x10 + TIPC_NODELAY = 0x8a TIPC_NODE_BITS = 0xc TIPC_NODE_MASK = 0xfff TIPC_NODE_OFFSET = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 9adb20e3f1..ab6134ebb9 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -243,6 +243,7 @@ const ( BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 + BPF_F_MMAPABLE = 0x400 BPF_F_NO_COMMON_LRU = 0x2 BPF_F_NO_PREALLOC = 0x1 BPF_F_NUMA_NODE = 0x4 @@ -417,8 +418,10 @@ const ( CLOCK_TXFROMRX = 0x4 CLOCK_TXINT = 0x3 CLONE_ARGS_SIZE_VER0 = 0x40 + CLONE_ARGS_SIZE_VER1 = 0x50 CLONE_CHILD_CLEARTID = 0x200000 CLONE_CHILD_SETTID = 0x1000000 + CLONE_CLEAR_SIGHAND = 0x100000000 CLONE_DETACHED = 0x400000 CLONE_FILES = 0x400 CLONE_FS = 0x200 @@ -715,8 +718,9 @@ const ( FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 - FSCRYPT_POLICY_FLAGS_VALID = 0x7 + FSCRYPT_POLICY_FLAGS_VALID = 0xf FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 + FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 FSCRYPT_POLICY_V1 = 0x0 FSCRYPT_POLICY_V2 = 0x2 FS_ENCRYPTION_MODE_ADIANTUM = 0x9 @@ -746,7 +750,7 @@ const ( FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 - FS_POLICY_FLAGS_VALID = 0x7 + FS_POLICY_FLAGS_VALID = 0xf FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -1228,6 +1232,7 @@ const ( LOOP_SET_STATUS64 = 0x4c04 LO_KEY_SIZE = 0x20 LO_NAME_SIZE = 0x40 + MADV_COLD = 0x14 MADV_DODUMP = 0x11 MADV_DOFORK = 0xb MADV_DONTDUMP = 0x10 @@ -1240,6 +1245,7 @@ const ( MADV_MERGEABLE = 0xc MADV_NOHUGEPAGE = 0xf MADV_NORMAL = 0x0 + MADV_PAGEOUT = 0x15 MADV_RANDOM = 0x1 MADV_REMOVE = 0x9 MADV_SEQUENTIAL = 0x2 @@ -1265,6 +1271,7 @@ const ( MAP_SHARED = 0x1 MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x20000 + MAP_SYNC = 0x80000 MAP_TYPE = 0xf MCAST_BLOCK_SOURCE = 0x2b MCAST_EXCLUDE = 0x0 @@ -1582,6 +1589,7 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPC_CMM_MAGIC = 0xc7571590 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCCONNECT = 0x8004743a @@ -1592,6 +1600,8 @@ const ( PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4010743f + PPPIOCGIDLE32 = 0x4008743f + PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGNPMODE = 0xc008744c @@ -1987,12 +1997,28 @@ const ( RTF_UP = 0x1 RTF_WINDOW = 0x80 RTF_XRESOLVE = 0x800 + RTMGRP_DECnet_IFADDR = 0x1000 + RTMGRP_DECnet_ROUTE = 0x4000 + RTMGRP_IPV4_IFADDR = 0x10 + RTMGRP_IPV4_MROUTE = 0x20 + RTMGRP_IPV4_ROUTE = 0x40 + RTMGRP_IPV4_RULE = 0x80 + RTMGRP_IPV6_IFADDR = 0x100 + RTMGRP_IPV6_IFINFO = 0x800 + RTMGRP_IPV6_MROUTE = 0x200 + RTMGRP_IPV6_PREFIX = 0x20000 + RTMGRP_IPV6_ROUTE = 0x400 + RTMGRP_LINK = 0x1 + RTMGRP_NEIGH = 0x4 + RTMGRP_NOTIFY = 0x2 + RTMGRP_TC = 0x8 RTM_BASE = 0x10 RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 + RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 @@ -2016,6 +2042,7 @@ const ( RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 + RTM_GETLINKPROP = 0x6e RTM_GETMDB = 0x56 RTM_GETMULTICAST = 0x3a RTM_GETNEIGH = 0x1e @@ -2029,13 +2056,14 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6b + RTM_MAX = 0x6f RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 + RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c @@ -2050,8 +2078,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x17 - RTM_NR_MSGTYPES = 0x5c + RTM_NR_FAMILIES = 0x18 + RTM_NR_MSGTYPES = 0x60 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2093,6 +2121,13 @@ const ( RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 + RWF_APPEND = 0x10 + RWF_DSYNC = 0x2 + RWF_HIPRI = 0x1 + RWF_NOWAIT = 0x8 + RWF_SUPPORTED = 0x1f + RWF_SYNC = 0x4 + RWF_WRITE_LIFE_NOT_SET = 0x0 SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x1d @@ -2259,7 +2294,7 @@ const ( SOL_TLS = 0x11a SOL_X25 = 0x106 SOL_XDP = 0x11b - SOMAXCONN = 0x80 + SOMAXCONN = 0x1000 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_FILTER = 0x1a @@ -2365,6 +2400,7 @@ const ( STATX_ATTR_ENCRYPTED = 0x800 STATX_ATTR_IMMUTABLE = 0x10 STATX_ATTR_NODUMP = 0x40 + STATX_ATTR_VERITY = 0x100000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -2483,6 +2519,7 @@ const ( TCP_THIN_DUPACK = 0x11 TCP_THIN_LINEAR_TIMEOUTS = 0x10 TCP_TIMESTAMP = 0x18 + TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa @@ -2585,6 +2622,10 @@ const ( TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 TIPC_ADDR_NAMESEQ = 0x1 + TIPC_AEAD_ALG_NAME = 0x20 + TIPC_AEAD_KEYLEN_MAX = 0x24 + TIPC_AEAD_KEYLEN_MIN = 0x14 + TIPC_AEAD_KEY_SIZE_MAX = 0x48 TIPC_CFG_SRV = 0x0 TIPC_CLUSTER_BITS = 0xc TIPC_CLUSTER_MASK = 0xfff000 @@ -2617,6 +2658,7 @@ const ( TIPC_MCAST_REPLICAST = 0x86 TIPC_MEDIUM_IMPORTANCE = 0x1 TIPC_NODEID_LEN = 0x10 + TIPC_NODELAY = 0x8a TIPC_NODE_BITS = 0xc TIPC_NODE_MASK = 0xfff TIPC_NODE_OFFSET = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 080e2f0aaf..dc8cafffe1 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -243,6 +243,7 @@ const ( BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 + BPF_F_MMAPABLE = 0x400 BPF_F_NO_COMMON_LRU = 0x2 BPF_F_NO_PREALLOC = 0x1 BPF_F_NUMA_NODE = 0x4 @@ -417,8 +418,10 @@ const ( CLOCK_TXFROMRX = 0x4 CLOCK_TXINT = 0x3 CLONE_ARGS_SIZE_VER0 = 0x40 + CLONE_ARGS_SIZE_VER1 = 0x50 CLONE_CHILD_CLEARTID = 0x200000 CLONE_CHILD_SETTID = 0x1000000 + CLONE_CLEAR_SIGHAND = 0x100000000 CLONE_DETACHED = 0x400000 CLONE_FILES = 0x400 CLONE_FS = 0x200 @@ -715,8 +718,9 @@ const ( FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 - FSCRYPT_POLICY_FLAGS_VALID = 0x7 + FSCRYPT_POLICY_FLAGS_VALID = 0xf FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 + FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 FSCRYPT_POLICY_V1 = 0x0 FSCRYPT_POLICY_V2 = 0x2 FS_ENCRYPTION_MODE_ADIANTUM = 0x9 @@ -746,7 +750,7 @@ const ( FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 - FS_POLICY_FLAGS_VALID = 0x7 + FS_POLICY_FLAGS_VALID = 0xf FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -1228,6 +1232,7 @@ const ( LOOP_SET_STATUS64 = 0x4c04 LO_KEY_SIZE = 0x20 LO_NAME_SIZE = 0x40 + MADV_COLD = 0x14 MADV_DODUMP = 0x11 MADV_DOFORK = 0xb MADV_DONTDUMP = 0x10 @@ -1240,6 +1245,7 @@ const ( MADV_MERGEABLE = 0xc MADV_NOHUGEPAGE = 0xf MADV_NORMAL = 0x0 + MADV_PAGEOUT = 0x15 MADV_RANDOM = 0x1 MADV_REMOVE = 0x9 MADV_SEQUENTIAL = 0x2 @@ -1265,6 +1271,7 @@ const ( MAP_SHARED = 0x1 MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x20000 + MAP_SYNC = 0x80000 MAP_TYPE = 0xf MCAST_BLOCK_SOURCE = 0x2b MCAST_EXCLUDE = 0x0 @@ -1582,6 +1589,7 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPC_CMM_MAGIC = 0xc7571590 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCCONNECT = 0x8004743a @@ -1592,6 +1600,8 @@ const ( PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4010743f + PPPIOCGIDLE32 = 0x4008743f + PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGNPMODE = 0xc008744c @@ -1987,12 +1997,28 @@ const ( RTF_UP = 0x1 RTF_WINDOW = 0x80 RTF_XRESOLVE = 0x800 + RTMGRP_DECnet_IFADDR = 0x1000 + RTMGRP_DECnet_ROUTE = 0x4000 + RTMGRP_IPV4_IFADDR = 0x10 + RTMGRP_IPV4_MROUTE = 0x20 + RTMGRP_IPV4_ROUTE = 0x40 + RTMGRP_IPV4_RULE = 0x80 + RTMGRP_IPV6_IFADDR = 0x100 + RTMGRP_IPV6_IFINFO = 0x800 + RTMGRP_IPV6_MROUTE = 0x200 + RTMGRP_IPV6_PREFIX = 0x20000 + RTMGRP_IPV6_ROUTE = 0x400 + RTMGRP_LINK = 0x1 + RTMGRP_NEIGH = 0x4 + RTMGRP_NOTIFY = 0x2 + RTMGRP_TC = 0x8 RTM_BASE = 0x10 RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 + RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 @@ -2016,6 +2042,7 @@ const ( RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 + RTM_GETLINKPROP = 0x6e RTM_GETMDB = 0x56 RTM_GETMULTICAST = 0x3a RTM_GETNEIGH = 0x1e @@ -2029,13 +2056,14 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6b + RTM_MAX = 0x6f RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 + RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c @@ -2050,8 +2078,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x17 - RTM_NR_MSGTYPES = 0x5c + RTM_NR_FAMILIES = 0x18 + RTM_NR_MSGTYPES = 0x60 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2093,6 +2121,13 @@ const ( RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 + RWF_APPEND = 0x10 + RWF_DSYNC = 0x2 + RWF_HIPRI = 0x1 + RWF_NOWAIT = 0x8 + RWF_SUPPORTED = 0x1f + RWF_SYNC = 0x4 + RWF_WRITE_LIFE_NOT_SET = 0x0 SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x1d @@ -2259,7 +2294,7 @@ const ( SOL_TLS = 0x11a SOL_X25 = 0x106 SOL_XDP = 0x11b - SOMAXCONN = 0x80 + SOMAXCONN = 0x1000 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_FILTER = 0x1a @@ -2365,6 +2400,7 @@ const ( STATX_ATTR_ENCRYPTED = 0x800 STATX_ATTR_IMMUTABLE = 0x10 STATX_ATTR_NODUMP = 0x40 + STATX_ATTR_VERITY = 0x100000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -2483,6 +2519,7 @@ const ( TCP_THIN_DUPACK = 0x11 TCP_THIN_LINEAR_TIMEOUTS = 0x10 TCP_TIMESTAMP = 0x18 + TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa @@ -2585,6 +2622,10 @@ const ( TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 TIPC_ADDR_NAMESEQ = 0x1 + TIPC_AEAD_ALG_NAME = 0x20 + TIPC_AEAD_KEYLEN_MAX = 0x24 + TIPC_AEAD_KEYLEN_MIN = 0x14 + TIPC_AEAD_KEY_SIZE_MAX = 0x48 TIPC_CFG_SRV = 0x0 TIPC_CLUSTER_BITS = 0xc TIPC_CLUSTER_MASK = 0xfff000 @@ -2617,6 +2658,7 @@ const ( TIPC_MCAST_REPLICAST = 0x86 TIPC_MEDIUM_IMPORTANCE = 0x1 TIPC_NODEID_LEN = 0x10 + TIPC_NODELAY = 0x8a TIPC_NODE_BITS = 0xc TIPC_NODE_MASK = 0xfff TIPC_NODE_OFFSET = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index db20a369d0..5d964445d8 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -243,6 +243,7 @@ const ( BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 + BPF_F_MMAPABLE = 0x400 BPF_F_NO_COMMON_LRU = 0x2 BPF_F_NO_PREALLOC = 0x1 BPF_F_NUMA_NODE = 0x4 @@ -417,8 +418,10 @@ const ( CLOCK_TXFROMRX = 0x4 CLOCK_TXINT = 0x3 CLONE_ARGS_SIZE_VER0 = 0x40 + CLONE_ARGS_SIZE_VER1 = 0x50 CLONE_CHILD_CLEARTID = 0x200000 CLONE_CHILD_SETTID = 0x1000000 + CLONE_CLEAR_SIGHAND = 0x100000000 CLONE_DETACHED = 0x400000 CLONE_FILES = 0x400 CLONE_FS = 0x200 @@ -715,8 +718,9 @@ const ( FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 - FSCRYPT_POLICY_FLAGS_VALID = 0x7 + FSCRYPT_POLICY_FLAGS_VALID = 0xf FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 + FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 FSCRYPT_POLICY_V1 = 0x0 FSCRYPT_POLICY_V2 = 0x2 FS_ENCRYPTION_MODE_ADIANTUM = 0x9 @@ -746,7 +750,7 @@ const ( FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 - FS_POLICY_FLAGS_VALID = 0x7 + FS_POLICY_FLAGS_VALID = 0xf FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -1228,6 +1232,7 @@ const ( LOOP_SET_STATUS64 = 0x4c04 LO_KEY_SIZE = 0x20 LO_NAME_SIZE = 0x40 + MADV_COLD = 0x14 MADV_DODUMP = 0x11 MADV_DOFORK = 0xb MADV_DONTDUMP = 0x10 @@ -1240,6 +1245,7 @@ const ( MADV_MERGEABLE = 0xc MADV_NOHUGEPAGE = 0xf MADV_NORMAL = 0x0 + MADV_PAGEOUT = 0x15 MADV_RANDOM = 0x1 MADV_REMOVE = 0x9 MADV_SEQUENTIAL = 0x2 @@ -1581,6 +1587,7 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPC_CMM_MAGIC = 0xc7571590 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 PPPIOCCONNECT = 0x4004743a @@ -1591,6 +1598,8 @@ const ( PPPIOCGDEBUG = 0x80047441 PPPIOCGFLAGS = 0x8004745a PPPIOCGIDLE = 0x8010743f + PPPIOCGIDLE32 = 0x8008743f + PPPIOCGIDLE64 = 0x8010743f PPPIOCGL2TPSTATS = 0x80487436 PPPIOCGMRU = 0x80047453 PPPIOCGNPMODE = 0xc008744c @@ -1917,12 +1926,28 @@ const ( RTF_UP = 0x1 RTF_WINDOW = 0x80 RTF_XRESOLVE = 0x800 + RTMGRP_DECnet_IFADDR = 0x1000 + RTMGRP_DECnet_ROUTE = 0x4000 + RTMGRP_IPV4_IFADDR = 0x10 + RTMGRP_IPV4_MROUTE = 0x20 + RTMGRP_IPV4_ROUTE = 0x40 + RTMGRP_IPV4_RULE = 0x80 + RTMGRP_IPV6_IFADDR = 0x100 + RTMGRP_IPV6_IFINFO = 0x800 + RTMGRP_IPV6_MROUTE = 0x200 + RTMGRP_IPV6_PREFIX = 0x20000 + RTMGRP_IPV6_ROUTE = 0x400 + RTMGRP_LINK = 0x1 + RTMGRP_NEIGH = 0x4 + RTMGRP_NOTIFY = 0x2 + RTMGRP_TC = 0x8 RTM_BASE = 0x10 RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 + RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 @@ -1946,6 +1971,7 @@ const ( RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 + RTM_GETLINKPROP = 0x6e RTM_GETMDB = 0x56 RTM_GETMULTICAST = 0x3a RTM_GETNEIGH = 0x1e @@ -1959,13 +1985,14 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6b + RTM_MAX = 0x6f RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 + RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c @@ -1980,8 +2007,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x17 - RTM_NR_MSGTYPES = 0x5c + RTM_NR_FAMILIES = 0x18 + RTM_NR_MSGTYPES = 0x60 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2023,6 +2050,13 @@ const ( RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 + RWF_APPEND = 0x10 + RWF_DSYNC = 0x2 + RWF_HIPRI = 0x1 + RWF_NOWAIT = 0x8 + RWF_SUPPORTED = 0x1f + RWF_SYNC = 0x4 + RWF_WRITE_LIFE_NOT_SET = 0x0 SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x1d @@ -2189,7 +2223,7 @@ const ( SOL_TLS = 0x11a SOL_X25 = 0x106 SOL_XDP = 0x11b - SOMAXCONN = 0x80 + SOMAXCONN = 0x1000 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_FILTER = 0x1a @@ -2295,6 +2329,7 @@ const ( STATX_ATTR_ENCRYPTED = 0x800 STATX_ATTR_IMMUTABLE = 0x10 STATX_ATTR_NODUMP = 0x40 + STATX_ATTR_VERITY = 0x100000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -2415,6 +2450,7 @@ const ( TCP_THIN_DUPACK = 0x11 TCP_THIN_LINEAR_TIMEOUTS = 0x10 TCP_TIMESTAMP = 0x18 + TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa @@ -2511,6 +2547,10 @@ const ( TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 TIPC_ADDR_NAMESEQ = 0x1 + TIPC_AEAD_ALG_NAME = 0x20 + TIPC_AEAD_KEYLEN_MAX = 0x24 + TIPC_AEAD_KEYLEN_MIN = 0x14 + TIPC_AEAD_KEY_SIZE_MAX = 0x48 TIPC_CFG_SRV = 0x0 TIPC_CLUSTER_BITS = 0xc TIPC_CLUSTER_MASK = 0xfff000 @@ -2543,6 +2583,7 @@ const ( TIPC_MCAST_REPLICAST = 0x86 TIPC_MEDIUM_IMPORTANCE = 0x1 TIPC_NODEID_LEN = 0x10 + TIPC_NODELAY = 0x8a TIPC_NODE_BITS = 0xc TIPC_NODE_MASK = 0xfff TIPC_NODE_OFFSET = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 734757aecc..7d64d6e798 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -243,6 +243,7 @@ const ( BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 + BPF_F_MMAPABLE = 0x400 BPF_F_NO_COMMON_LRU = 0x2 BPF_F_NO_PREALLOC = 0x1 BPF_F_NUMA_NODE = 0x4 @@ -417,8 +418,10 @@ const ( CLOCK_TXFROMRX = 0x4 CLOCK_TXINT = 0x3 CLONE_ARGS_SIZE_VER0 = 0x40 + CLONE_ARGS_SIZE_VER1 = 0x50 CLONE_CHILD_CLEARTID = 0x200000 CLONE_CHILD_SETTID = 0x1000000 + CLONE_CLEAR_SIGHAND = 0x100000000 CLONE_DETACHED = 0x400000 CLONE_FILES = 0x400 CLONE_FS = 0x200 @@ -715,8 +718,9 @@ const ( FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 - FSCRYPT_POLICY_FLAGS_VALID = 0x7 + FSCRYPT_POLICY_FLAGS_VALID = 0xf FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 + FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 FSCRYPT_POLICY_V1 = 0x0 FSCRYPT_POLICY_V2 = 0x2 FS_ENCRYPTION_MODE_ADIANTUM = 0x9 @@ -746,7 +750,7 @@ const ( FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 - FS_POLICY_FLAGS_VALID = 0x7 + FS_POLICY_FLAGS_VALID = 0xf FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -1228,6 +1232,7 @@ const ( LOOP_SET_STATUS64 = 0x4c04 LO_KEY_SIZE = 0x20 LO_NAME_SIZE = 0x40 + MADV_COLD = 0x14 MADV_DODUMP = 0x11 MADV_DOFORK = 0xb MADV_DONTDUMP = 0x10 @@ -1240,6 +1245,7 @@ const ( MADV_MERGEABLE = 0xc MADV_NOHUGEPAGE = 0xf MADV_NORMAL = 0x0 + MADV_PAGEOUT = 0x15 MADV_RANDOM = 0x1 MADV_REMOVE = 0x9 MADV_SEQUENTIAL = 0x2 @@ -1581,6 +1587,7 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPC_CMM_MAGIC = 0xc7571590 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 PPPIOCCONNECT = 0x4004743a @@ -1591,6 +1598,8 @@ const ( PPPIOCGDEBUG = 0x80047441 PPPIOCGFLAGS = 0x8004745a PPPIOCGIDLE = 0x8010743f + PPPIOCGIDLE32 = 0x8008743f + PPPIOCGIDLE64 = 0x8010743f PPPIOCGL2TPSTATS = 0x80487436 PPPIOCGMRU = 0x80047453 PPPIOCGNPMODE = 0xc008744c @@ -1990,12 +1999,28 @@ const ( RTF_UP = 0x1 RTF_WINDOW = 0x80 RTF_XRESOLVE = 0x800 + RTMGRP_DECnet_IFADDR = 0x1000 + RTMGRP_DECnet_ROUTE = 0x4000 + RTMGRP_IPV4_IFADDR = 0x10 + RTMGRP_IPV4_MROUTE = 0x20 + RTMGRP_IPV4_ROUTE = 0x40 + RTMGRP_IPV4_RULE = 0x80 + RTMGRP_IPV6_IFADDR = 0x100 + RTMGRP_IPV6_IFINFO = 0x800 + RTMGRP_IPV6_MROUTE = 0x200 + RTMGRP_IPV6_PREFIX = 0x20000 + RTMGRP_IPV6_ROUTE = 0x400 + RTMGRP_LINK = 0x1 + RTMGRP_NEIGH = 0x4 + RTMGRP_NOTIFY = 0x2 + RTMGRP_TC = 0x8 RTM_BASE = 0x10 RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 + RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 @@ -2019,6 +2044,7 @@ const ( RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 + RTM_GETLINKPROP = 0x6e RTM_GETMDB = 0x56 RTM_GETMULTICAST = 0x3a RTM_GETNEIGH = 0x1e @@ -2032,13 +2058,14 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6b + RTM_MAX = 0x6f RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 + RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c @@ -2053,8 +2080,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x17 - RTM_NR_MSGTYPES = 0x5c + RTM_NR_FAMILIES = 0x18 + RTM_NR_MSGTYPES = 0x60 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2096,6 +2123,13 @@ const ( RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 + RWF_APPEND = 0x10 + RWF_DSYNC = 0x2 + RWF_HIPRI = 0x1 + RWF_NOWAIT = 0x8 + RWF_SUPPORTED = 0x1f + RWF_SYNC = 0x4 + RWF_WRITE_LIFE_NOT_SET = 0x0 SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x1d @@ -2262,7 +2296,7 @@ const ( SOL_TLS = 0x11a SOL_X25 = 0x106 SOL_XDP = 0x11b - SOMAXCONN = 0x80 + SOMAXCONN = 0x1000 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_FILTER = 0x1a @@ -2368,6 +2402,7 @@ const ( STATX_ATTR_ENCRYPTED = 0x800 STATX_ATTR_IMMUTABLE = 0x10 STATX_ATTR_NODUMP = 0x40 + STATX_ATTR_VERITY = 0x100000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -2488,6 +2523,7 @@ const ( TCP_THIN_DUPACK = 0x11 TCP_THIN_LINEAR_TIMEOUTS = 0x10 TCP_TIMESTAMP = 0x18 + TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa @@ -2584,6 +2620,10 @@ const ( TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 TIPC_ADDR_NAMESEQ = 0x1 + TIPC_AEAD_ALG_NAME = 0x20 + TIPC_AEAD_KEYLEN_MAX = 0x24 + TIPC_AEAD_KEYLEN_MIN = 0x14 + TIPC_AEAD_KEY_SIZE_MAX = 0x48 TIPC_CFG_SRV = 0x0 TIPC_CLUSTER_BITS = 0xc TIPC_CLUSTER_MASK = 0xfff000 @@ -2616,6 +2656,7 @@ const ( TIPC_MCAST_REPLICAST = 0x86 TIPC_MEDIUM_IMPORTANCE = 0x1 TIPC_NODEID_LEN = 0x10 + TIPC_NODELAY = 0x8a TIPC_NODE_BITS = 0xc TIPC_NODE_MASK = 0xfff TIPC_NODE_OFFSET = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index c8d2c23510..084d55be5f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -246,6 +246,7 @@ const ( BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 + BPF_F_MMAPABLE = 0x400 BPF_F_NO_COMMON_LRU = 0x2 BPF_F_NO_PREALLOC = 0x1 BPF_F_NUMA_NODE = 0x4 @@ -420,8 +421,10 @@ const ( CLOCK_TXFROMRX = 0x4 CLOCK_TXINT = 0x3 CLONE_ARGS_SIZE_VER0 = 0x40 + CLONE_ARGS_SIZE_VER1 = 0x50 CLONE_CHILD_CLEARTID = 0x200000 CLONE_CHILD_SETTID = 0x1000000 + CLONE_CLEAR_SIGHAND = 0x100000000 CLONE_DETACHED = 0x400000 CLONE_FILES = 0x400 CLONE_FS = 0x200 @@ -719,8 +722,9 @@ const ( FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 - FSCRYPT_POLICY_FLAGS_VALID = 0x7 + FSCRYPT_POLICY_FLAGS_VALID = 0xf FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 + FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 FSCRYPT_POLICY_V1 = 0x0 FSCRYPT_POLICY_V2 = 0x2 FS_ENCRYPTION_MODE_ADIANTUM = 0x9 @@ -750,7 +754,7 @@ const ( FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 - FS_POLICY_FLAGS_VALID = 0x7 + FS_POLICY_FLAGS_VALID = 0xf FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -1232,6 +1236,7 @@ const ( LOOP_SET_STATUS64 = 0x4c04 LO_KEY_SIZE = 0x20 LO_NAME_SIZE = 0x40 + MADV_COLD = 0x14 MADV_DODUMP = 0x11 MADV_DOFORK = 0xb MADV_DONTDUMP = 0x10 @@ -1244,6 +1249,7 @@ const ( MADV_MERGEABLE = 0xc MADV_NOHUGEPAGE = 0xf MADV_NORMAL = 0x0 + MADV_PAGEOUT = 0x15 MADV_RANDOM = 0x1 MADV_REMOVE = 0x9 MADV_SEQUENTIAL = 0x2 @@ -1270,6 +1276,7 @@ const ( MAP_SHARED = 0x1 MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x20000 + MAP_SYNC = 0x80000 MAP_TYPE = 0xf MCAST_BLOCK_SOURCE = 0x2b MCAST_EXCLUDE = 0x0 @@ -1585,6 +1592,7 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPC_CMM_MAGIC = 0xc7571590 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCCONNECT = 0x8004743a @@ -1595,6 +1603,8 @@ const ( PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4010743f + PPPIOCGIDLE32 = 0x4008743f + PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGNPMODE = 0xc008744c @@ -1982,12 +1992,28 @@ const ( RTF_UP = 0x1 RTF_WINDOW = 0x80 RTF_XRESOLVE = 0x800 + RTMGRP_DECnet_IFADDR = 0x1000 + RTMGRP_DECnet_ROUTE = 0x4000 + RTMGRP_IPV4_IFADDR = 0x10 + RTMGRP_IPV4_MROUTE = 0x20 + RTMGRP_IPV4_ROUTE = 0x40 + RTMGRP_IPV4_RULE = 0x80 + RTMGRP_IPV6_IFADDR = 0x100 + RTMGRP_IPV6_IFINFO = 0x800 + RTMGRP_IPV6_MROUTE = 0x200 + RTMGRP_IPV6_PREFIX = 0x20000 + RTMGRP_IPV6_ROUTE = 0x400 + RTMGRP_LINK = 0x1 + RTMGRP_NEIGH = 0x4 + RTMGRP_NOTIFY = 0x2 + RTMGRP_TC = 0x8 RTM_BASE = 0x10 RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 + RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 @@ -2011,6 +2037,7 @@ const ( RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 + RTM_GETLINKPROP = 0x6e RTM_GETMDB = 0x56 RTM_GETMULTICAST = 0x3a RTM_GETNEIGH = 0x1e @@ -2024,13 +2051,14 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6b + RTM_MAX = 0x6f RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 + RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c @@ -2045,8 +2073,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x17 - RTM_NR_MSGTYPES = 0x5c + RTM_NR_FAMILIES = 0x18 + RTM_NR_MSGTYPES = 0x60 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2088,6 +2116,13 @@ const ( RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 + RWF_APPEND = 0x10 + RWF_DSYNC = 0x2 + RWF_HIPRI = 0x1 + RWF_NOWAIT = 0x8 + RWF_SUPPORTED = 0x1f + RWF_SYNC = 0x4 + RWF_WRITE_LIFE_NOT_SET = 0x0 SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x1d @@ -2254,7 +2289,7 @@ const ( SOL_TLS = 0x11a SOL_X25 = 0x106 SOL_XDP = 0x11b - SOMAXCONN = 0x80 + SOMAXCONN = 0x1000 SO_ACCEPTCONN = 0x8000 SO_ATTACH_BPF = 0x34 SO_ATTACH_FILTER = 0x1a @@ -2360,6 +2395,7 @@ const ( STATX_ATTR_ENCRYPTED = 0x800 STATX_ATTR_IMMUTABLE = 0x10 STATX_ATTR_NODUMP = 0x40 + STATX_ATTR_VERITY = 0x100000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -2479,6 +2515,7 @@ const ( TCP_THIN_DUPACK = 0x11 TCP_THIN_LINEAR_TIMEOUTS = 0x10 TCP_TIMESTAMP = 0x18 + TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa @@ -2573,6 +2610,10 @@ const ( TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 TIPC_ADDR_NAMESEQ = 0x1 + TIPC_AEAD_ALG_NAME = 0x20 + TIPC_AEAD_KEYLEN_MAX = 0x24 + TIPC_AEAD_KEYLEN_MIN = 0x14 + TIPC_AEAD_KEY_SIZE_MAX = 0x48 TIPC_CFG_SRV = 0x0 TIPC_CLUSTER_BITS = 0xc TIPC_CLUSTER_MASK = 0xfff000 @@ -2605,6 +2646,7 @@ const ( TIPC_MCAST_REPLICAST = 0x86 TIPC_MEDIUM_IMPORTANCE = 0x1 TIPC_NODEID_LEN = 0x10 + TIPC_NODELAY = 0x8a TIPC_NODE_BITS = 0xc TIPC_NODE_MASK = 0xfff TIPC_NODE_OFFSET = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zptracearm_linux.go b/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go similarity index 93% rename from vendor/golang.org/x/sys/unix/zptracearm_linux.go rename to vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go index faf23bbed9..89c5920e0c 100644 --- a/vendor/golang.org/x/sys/unix/zptracearm_linux.go +++ b/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go @@ -1,4 +1,4 @@ -// Code generated by linux/mkall.go generatePtracePair(arm, arm64). DO NOT EDIT. +// Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT. // +build linux // +build arm arm64 diff --git a/vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go b/vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go new file mode 100644 index 0000000000..6cb6d688aa --- /dev/null +++ b/vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go @@ -0,0 +1,17 @@ +// Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. + +package unix + +import "unsafe" + +// PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. +func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { + iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} + return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) +} + +// PtraceSetRegSetArm64 sets the registers used by arm64 binaries. +func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { + iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} + return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) +} diff --git a/vendor/golang.org/x/sys/unix/zptracemips_linux.go b/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go similarity index 93% rename from vendor/golang.org/x/sys/unix/zptracemips_linux.go rename to vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go index c431131e63..24b841eec5 100644 --- a/vendor/golang.org/x/sys/unix/zptracemips_linux.go +++ b/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go @@ -1,4 +1,4 @@ -// Code generated by linux/mkall.go generatePtracePair(mips, mips64). DO NOT EDIT. +// Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT. // +build linux // +build mips mips64 diff --git a/vendor/golang.org/x/sys/unix/zptracemipsle_linux.go b/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go similarity index 93% rename from vendor/golang.org/x/sys/unix/zptracemipsle_linux.go rename to vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go index dc3d6d3732..47b0489565 100644 --- a/vendor/golang.org/x/sys/unix/zptracemipsle_linux.go +++ b/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go @@ -1,4 +1,4 @@ -// Code generated by linux/mkall.go generatePtracePair(mipsle, mips64le). DO NOT EDIT. +// Code generated by linux/mkall.go generatePtracePair("mipsle", "mips64le"). DO NOT EDIT. // +build linux // +build mipsle mips64le diff --git a/vendor/golang.org/x/sys/unix/zptrace386_linux.go b/vendor/golang.org/x/sys/unix/zptrace_x86_linux.go similarity index 95% rename from vendor/golang.org/x/sys/unix/zptrace386_linux.go rename to vendor/golang.org/x/sys/unix/zptrace_x86_linux.go index 2d21c49e12..ea5d9cb536 100644 --- a/vendor/golang.org/x/sys/unix/zptrace386_linux.go +++ b/vendor/golang.org/x/sys/unix/zptrace_x86_linux.go @@ -1,4 +1,4 @@ -// Code generated by linux/mkall.go generatePtracePair(386, amd64). DO NOT EDIT. +// Code generated by linux/mkall.go generatePtracePair("386", "amd64"). DO NOT EDIT. // +build linux // +build 386 amd64 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go index b5ed805899..c1cc0a415f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -527,6 +516,17 @@ func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintp // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func kill(pid int, signum int, posix int) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go index cdf8a70002..a3fc490041 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go @@ -339,22 +339,6 @@ func libc_futimes_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fcntl_trampoline() - -//go:linkname libc_fcntl libc_fcntl -//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -727,6 +711,22 @@ func libc_setattrlist_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fcntl_trampoline() + +//go:linkname libc_fcntl libc_fcntl +//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func kill(pid int, signum int, posix int) (err error) { _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s index 9cae5b1da3..6836a41290 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s @@ -44,8 +44,6 @@ TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) -TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fcntl(SB) TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0 JMP libc_poll(SB) TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0 @@ -84,6 +82,8 @@ TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0 JMP libc_flistxattr(SB) TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0 JMP libc_setattrlist(SB) +TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0 JMP libc_kill(SB) TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0 @@ -106,6 +106,8 @@ TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0 JMP libc_chown(SB) TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) +TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0 + JMP libc_clock_gettime(SB) TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0 JMP libc_close(SB) TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go index 8bde8235a0..f8e5c37c5c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -527,6 +516,17 @@ func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintp // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func kill(pid int, signum int, posix int) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index 63b51fbf00..50d6437e6b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -339,22 +339,6 @@ func libc_futimes_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fcntl_trampoline() - -//go:linkname libc_fcntl libc_fcntl -//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -727,6 +711,22 @@ func libc_setattrlist_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fcntl_trampoline() + +//go:linkname libc_fcntl libc_fcntl +//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func kill(pid int, signum int, posix int) (err error) { _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s index 1a0e52aa20..a3fdf099d0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s @@ -44,8 +44,6 @@ TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) -TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fcntl(SB) TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0 JMP libc_poll(SB) TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0 @@ -84,6 +82,8 @@ TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0 JMP libc_flistxattr(SB) TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0 JMP libc_setattrlist(SB) +TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0 JMP libc_kill(SB) TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go index 63a236b504..cea04e041c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -527,6 +516,17 @@ func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintp // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func kill(pid int, signum int, posix int) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go index adb8668c2b..63103950ca 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go @@ -339,22 +339,6 @@ func libc_futimes_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fcntl_trampoline() - -//go:linkname libc_fcntl libc_fcntl -//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -727,6 +711,22 @@ func libc_setattrlist_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fcntl_trampoline() + +//go:linkname libc_fcntl libc_fcntl +//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func kill(pid int, signum int, posix int) (err error) { _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s index 5bebb1bbd0..b67f518fa3 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s @@ -44,8 +44,6 @@ TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) -TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fcntl(SB) TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0 JMP libc_poll(SB) TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0 @@ -84,10 +82,14 @@ TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0 JMP libc_flistxattr(SB) TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0 JMP libc_setattrlist(SB) +TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0 JMP libc_kill(SB) TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) +TEXT ·libc_sysctl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sysctl(SB) TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0 JMP libc_sendfile(SB) TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go index 87c0b61221..8c3bb3a25d 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -527,6 +516,17 @@ func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintp // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func kill(pid int, signum int, posix int) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index c882a4f9d2..a8709f72dd 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -339,22 +339,6 @@ func libc_futimes_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fcntl_trampoline() - -//go:linkname libc_fcntl libc_fcntl -//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -727,6 +711,22 @@ func libc_setattrlist_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fcntl_trampoline() + +//go:linkname libc_fcntl libc_fcntl +//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func kill(pid int, signum int, posix int) (err error) { _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s index 19faa4d8d6..40cce1bb28 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s @@ -44,8 +44,6 @@ TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) -TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fcntl(SB) TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0 JMP libc_poll(SB) TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0 @@ -84,6 +82,8 @@ TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0 JMP libc_flistxattr(SB) TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0 JMP libc_setattrlist(SB) +TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0 JMP libc_kill(SB) TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0 @@ -106,6 +106,8 @@ TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0 JMP libc_chown(SB) TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) +TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0 + JMP libc_clock_gettime(SB) TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0 JMP libc_close(SB) TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go index df199b3454..fe1fdd78d7 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go @@ -255,17 +255,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go index e68185f1e3..c9058f3091 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go @@ -255,17 +255,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go index 2f77f93c4e..49b20c2296 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go index e9a12c9d93..31d2c46165 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go index 27ab0fbda0..abab3d7cbe 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go index fe5d462e49..a536d9a639 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go @@ -439,7 +439,7 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -449,7 +449,7 @@ func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -659,17 +659,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1608,6 +1597,108 @@ func writelen(fd int, p *byte, np int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { @@ -2030,8 +2121,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsgid(gid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0) +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -2040,8 +2132,9 @@ func Setfsgid(gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsuid(uid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0) +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go index 536abcea33..fb5db3648e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go @@ -439,7 +439,7 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -449,7 +449,7 @@ func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -659,17 +659,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1608,6 +1597,108 @@ func writelen(fd int, p *byte, np int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { @@ -2046,8 +2137,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsgid(gid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -2056,8 +2148,9 @@ func Setfsgid(gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsuid(uid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go index 37823cd6bf..591d120c8e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go @@ -439,7 +439,7 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -449,7 +449,7 @@ func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -659,17 +659,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1608,6 +1597,108 @@ func writelen(fd int, p *byte, np int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { @@ -2166,8 +2257,9 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsgid(gid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0) +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -2176,8 +2268,9 @@ func Setfsgid(gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsuid(uid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0) +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go index 794f61264a..afd5447078 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go @@ -439,7 +439,7 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -449,7 +449,7 @@ func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -659,17 +659,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1608,6 +1597,108 @@ func writelen(fd int, p *byte, np int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { @@ -1969,8 +2060,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsgid(gid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -1979,8 +2071,9 @@ func Setfsgid(gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsuid(uid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go index 1b34b550c3..054b2189a7 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go @@ -439,7 +439,7 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -449,7 +449,7 @@ func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -659,17 +659,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1608,6 +1597,108 @@ func writelen(fd int, p *byte, np int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { @@ -1960,8 +2051,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsgid(gid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -1970,8 +2062,9 @@ func Setfsgid(gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsuid(uid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go index 5714e25922..bbd48bf22c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go @@ -439,7 +439,7 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -449,7 +449,7 @@ func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -659,17 +659,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1608,6 +1597,108 @@ func writelen(fd int, p *byte, np int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { @@ -1990,8 +2081,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsgid(gid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -2000,8 +2092,9 @@ func Setfsgid(gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsuid(uid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go index 88a6b3362f..9c6bee913e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go @@ -439,7 +439,7 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -449,7 +449,7 @@ func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -659,17 +659,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1608,6 +1597,108 @@ func writelen(fd int, p *byte, np int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { @@ -1990,8 +2081,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsgid(gid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -2000,8 +2092,9 @@ func Setfsgid(gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsuid(uid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go index c09dbe3454..676088fa04 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go @@ -439,7 +439,7 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -449,7 +449,7 @@ func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -659,17 +659,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1608,6 +1597,108 @@ func writelen(fd int, p *byte, np int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { @@ -1960,8 +2051,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsgid(gid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -1970,8 +2062,9 @@ func Setfsgid(gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsuid(uid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go index 42f6c21039..7ee0b80daa 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go @@ -439,7 +439,7 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -449,7 +449,7 @@ func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -659,17 +659,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1608,6 +1597,108 @@ func writelen(fd int, p *byte, np int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { @@ -2072,8 +2163,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsgid(gid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -2082,8 +2174,9 @@ func Setfsgid(gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsuid(uid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go index de2cd8db91..8eaa7c9e7a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go @@ -439,7 +439,7 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -449,7 +449,7 @@ func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -659,17 +659,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1608,6 +1597,108 @@ func writelen(fd int, p *byte, np int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { @@ -2072,8 +2163,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsgid(gid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -2082,8 +2174,9 @@ func Setfsgid(gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsuid(uid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go index d51bf07fc5..b8f212bf0a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go @@ -439,7 +439,7 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -449,7 +449,7 @@ func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -659,17 +659,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1608,6 +1597,108 @@ func writelen(fd int, p *byte, np int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { @@ -1949,8 +2040,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsgid(gid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -1959,8 +2051,9 @@ func Setfsgid(gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsuid(uid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go index 1e3a3cb732..a7191cdbdf 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go @@ -439,7 +439,7 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -449,7 +449,7 @@ func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -659,17 +659,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1608,6 +1597,108 @@ func writelen(fd int, p *byte, np int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { @@ -2042,8 +2133,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsgid(gid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -2052,8 +2144,9 @@ func Setfsgid(gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsuid(uid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go index 3c97008cd0..9abdbde779 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go @@ -439,7 +439,7 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -449,7 +449,7 @@ func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { - _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + _, _, e1 := RawSyscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } @@ -659,17 +659,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1608,6 +1597,108 @@ func writelen(fd int, p *byte, np int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovs) > 0 { + _p0 = unsafe.Pointer(&iovs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { @@ -2041,8 +2132,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsgid(gid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -2051,8 +2143,9 @@ func Setfsgid(gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setfsuid(uid int) (err error) { - _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) + prev = int(r0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go index 5ade42cce0..3bbd9e39cd 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -361,22 +350,6 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func pipe() (fd1 int, fd2 int, err error) { r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) fd1 = int(r0) @@ -433,6 +406,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -564,6 +553,16 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Dup3(from int, to int, flags int) (err error) { + _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return @@ -926,6 +925,16 @@ func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fstatvfs1(fd int, buf *Statvfs_t, flags int) (err error) { + _, _, e1 := Syscall(SYS_FSTATVFS1, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1635,6 +1644,21 @@ func Stat(path string, stat *Stat_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Statvfs1(path string, buf *Statvfs_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATVFS1, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go index 3e0bbc5f10..d8cf5012c2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -361,22 +350,6 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func pipe() (fd1 int, fd2 int, err error) { r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) fd1 = int(r0) @@ -433,6 +406,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -564,6 +553,16 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Dup3(from int, to int, flags int) (err error) { + _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return @@ -926,6 +925,16 @@ func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fstatvfs1(fd int, buf *Statvfs_t, flags int) (err error) { + _, _, e1 := Syscall(SYS_FSTATVFS1, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1635,6 +1644,21 @@ func Stat(path string, stat *Stat_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Statvfs1(path string, buf *Statvfs_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATVFS1, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go index cb0af13a3c..1153fe69b8 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -361,22 +350,6 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func pipe() (fd1 int, fd2 int, err error) { r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) fd1 = int(r0) @@ -433,6 +406,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -564,6 +553,16 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Dup3(from int, to int, flags int) (err error) { + _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return @@ -926,6 +925,16 @@ func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fstatvfs1(fd int, buf *Statvfs_t, flags int) (err error) { + _, _, e1 := Syscall(SYS_FSTATVFS1, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1635,6 +1644,21 @@ func Stat(path string, stat *Stat_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Statvfs1(path string, buf *Statvfs_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATVFS1, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go index 6fd48d3dcd..24b4ebb41f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -361,22 +350,6 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func pipe() (fd1 int, fd2 int, err error) { r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) fd1 = int(r0) @@ -433,6 +406,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -564,6 +553,16 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Dup3(from int, to int, flags int) (err error) { + _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return @@ -926,6 +925,16 @@ func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fstatvfs1(fd int, buf *Statvfs_t, flags int) (err error) { + _, _, e1 := Syscall(SYS_FSTATVFS1, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -1635,6 +1644,21 @@ func Stat(path string, stat *Stat_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Statvfs1(path string, buf *Statvfs_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATVFS1, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index 2938e4124e..b44b31aeb1 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -361,24 +350,8 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func pipe(p *[2]_C_int) (err error) { - _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) +func pipe2(p *[2]_C_int, flags int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } @@ -431,6 +404,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) @@ -573,6 +562,16 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Dup3(from int, to int, flags int) (err error) { + _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index 22b79ab0e2..67f93ee76d 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -361,24 +350,8 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func pipe(p *[2]_C_int) (err error) { - _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) +func pipe2(p *[2]_C_int, flags int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } @@ -431,6 +404,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) @@ -573,6 +562,16 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Dup3(from int, to int, flags int) (err error) { + _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index cb921f37af..d7c878b1d0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -361,24 +350,8 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func pipe(p *[2]_C_int) (err error) { - _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) +func pipe2(p *[2]_C_int, flags int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } @@ -431,6 +404,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) @@ -573,6 +562,16 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Dup3(from int, to int, flags int) (err error) { + _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 5a74380355..8facd695d5 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -361,24 +350,8 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func pipe(p *[2]_C_int) (err error) { - _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) +func pipe2(p *[2]_C_int, flags int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } @@ -431,6 +404,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) @@ -573,6 +562,16 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Dup3(from int, to int, flags int) (err error) { + _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index 753def987e..1f3b4d150f 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -297,4 +297,5 @@ const ( SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 + SYS_CLONE3 = 435 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go index c206f2b053..71ea1d6d23 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go @@ -467,3 +467,13 @@ type Utsname struct { Version [32]byte Machine [32]byte } + +const SizeofClockinfo = 0x14 + +type Clockinfo struct { + Hz int32 + Tick int32 + Tickadj int32 + Stathz int32 + Profhz int32 +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go index 7312e95ff4..0ec159680b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go @@ -423,7 +423,7 @@ type PtraceIoDesc struct { Op int32 Offs *byte Addr *byte - Len uint + Len uint32 } type Kevent_t struct { @@ -698,3 +698,13 @@ type Utsname struct { Version [256]byte Machine [256]byte } + +const SizeofClockinfo = 0x14 + +type Clockinfo struct { + Hz int32 + Tick int32 + Spare int32 + Stathz int32 + Profhz int32 +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go index 29ba2f5bf7..8340f57753 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go @@ -428,7 +428,7 @@ type PtraceIoDesc struct { Op int32 Offs *byte Addr *byte - Len uint + Len uint64 } type Kevent_t struct { @@ -704,3 +704,13 @@ type Utsname struct { Version [256]byte Machine [256]byte } + +const SizeofClockinfo = 0x14 + +type Clockinfo struct { + Hz int32 + Tick int32 + Spare int32 + Stathz int32 + Profhz int32 +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go index b4090ef311..6f79227d74 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go @@ -405,7 +405,7 @@ type PtraceIoDesc struct { Op int32 Offs *byte Addr *byte - Len uint + Len uint32 } type Kevent_t struct { @@ -681,3 +681,13 @@ type Utsname struct { Version [256]byte Machine [256]byte } + +const SizeofClockinfo = 0x14 + +type Clockinfo struct { + Hz int32 + Tick int32 + Spare int32 + Stathz int32 + Profhz int32 +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go index c681d7dbcd..e751e00336 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go @@ -406,7 +406,7 @@ type PtraceIoDesc struct { Op int32 Offs *byte Addr *byte - Len uint + Len uint64 } type Kevent_t struct { @@ -682,3 +682,13 @@ type Utsname struct { Version [256]byte Machine [256]byte } + +const SizeofClockinfo = 0x14 + +type Clockinfo struct { + Hz int32 + Tick int32 + Spare int32 + Stathz int32 + Profhz int32 +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index d2306df42a..d8089584bb 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -592,7 +592,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x33 + IFLA_MAX = 0x35 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -2794,7 +2794,7 @@ const ( DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c DEVLINK_ATTR_PAD = 0x3d DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e - DEVLINK_ATTR_MAX = 0x89 + DEVLINK_ATTR_MAX = 0x8c DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index 888870584f..88c76390b7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -593,7 +593,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x33 + IFLA_MAX = 0x35 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -2809,7 +2809,7 @@ const ( DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c DEVLINK_ATTR_PAD = 0x3d DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e - DEVLINK_ATTR_MAX = 0x89 + DEVLINK_ATTR_MAX = 0x8c DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 5f6f5945da..0c0f24c77f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -596,7 +596,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x33 + IFLA_MAX = 0x35 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -2786,7 +2786,7 @@ const ( DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c DEVLINK_ATTR_PAD = 0x3d DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e - DEVLINK_ATTR_MAX = 0x89 + DEVLINK_ATTR_MAX = 0x8c DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index e27030c5d2..6065d2d5bd 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -594,7 +594,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x33 + IFLA_MAX = 0x35 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -2788,7 +2788,7 @@ const ( DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c DEVLINK_ATTR_PAD = 0x3d DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e - DEVLINK_ATTR_MAX = 0x89 + DEVLINK_ATTR_MAX = 0x8c DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 9b1c03da3c..29d4408d37 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -595,7 +595,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x33 + IFLA_MAX = 0x35 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -2792,7 +2792,7 @@ const ( DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c DEVLINK_ATTR_PAD = 0x3d DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e - DEVLINK_ATTR_MAX = 0x89 + DEVLINK_ATTR_MAX = 0x8c DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 3b88e1ffa2..9cac9ff84a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -594,7 +594,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x33 + IFLA_MAX = 0x35 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -2791,7 +2791,7 @@ const ( DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c DEVLINK_ATTR_PAD = 0x3d DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e - DEVLINK_ATTR_MAX = 0x89 + DEVLINK_ATTR_MAX = 0x8c DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 7277dc3b74..dbc21cf3d6 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -594,7 +594,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x33 + IFLA_MAX = 0x35 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -2791,7 +2791,7 @@ const ( DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c DEVLINK_ATTR_PAD = 0x3d DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e - DEVLINK_ATTR_MAX = 0x89 + DEVLINK_ATTR_MAX = 0x8c DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index 6f32c17533..a26623700e 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -595,7 +595,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x33 + IFLA_MAX = 0x35 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -2792,7 +2792,7 @@ const ( DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c DEVLINK_ATTR_PAD = 0x3d DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e - DEVLINK_ATTR_MAX = 0x89 + DEVLINK_ATTR_MAX = 0x8c DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 8a9484d687..e93b73cd74 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -595,7 +595,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x33 + IFLA_MAX = 0x35 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -2798,7 +2798,7 @@ const ( DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c DEVLINK_ATTR_PAD = 0x3d DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e - DEVLINK_ATTR_MAX = 0x89 + DEVLINK_ATTR_MAX = 0x8c DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 7190a186aa..1f431b6ff6 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -595,7 +595,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x33 + IFLA_MAX = 0x35 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -2798,7 +2798,7 @@ const ( DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c DEVLINK_ATTR_PAD = 0x3d DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e - DEVLINK_ATTR_MAX = 0x89 + DEVLINK_ATTR_MAX = 0x8c DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index 502d98aa2b..81a5dc1475 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -594,7 +594,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x33 + IFLA_MAX = 0x35 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -2816,7 +2816,7 @@ const ( DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c DEVLINK_ATTR_PAD = 0x3d DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e - DEVLINK_ATTR_MAX = 0x89 + DEVLINK_ATTR_MAX = 0x8c DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index 65e12d7b46..ae765d47cf 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -593,7 +593,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x33 + IFLA_MAX = 0x35 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -2812,7 +2812,7 @@ const ( DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c DEVLINK_ATTR_PAD = 0x3d DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e - DEVLINK_ATTR_MAX = 0x89 + DEVLINK_ATTR_MAX = 0x8c DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 26e8a2bb74..63685ca878 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -597,7 +597,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x33 + IFLA_MAX = 0x35 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -2793,7 +2793,7 @@ const ( DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c DEVLINK_ATTR_PAD = 0x3d DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e - DEVLINK_ATTR_MAX = 0x89 + DEVLINK_ATTR_MAX = 0x8c DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go index 86736ab6e7..a89100c08a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go @@ -78,6 +78,33 @@ type Stat_t struct { type Statfs_t [0]byte +type Statvfs_t struct { + Flag uint32 + Bsize uint32 + Frsize uint32 + Iosize uint32 + Blocks uint64 + Bfree uint64 + Bavail uint64 + Bresvd uint64 + Files uint64 + Ffree uint64 + Favail uint64 + Fresvd uint64 + Syncreads uint64 + Syncwrites uint64 + Asyncreads uint64 + Asyncwrites uint64 + Fsidx Fsid + Fsid uint32 + Namemax uint32 + Owner uint32 + Spare [4]uint32 + Fstypename [32]byte + Mntonname [1024]byte + Mntfromname [1024]byte +} + type Flock_t struct { Start int64 Len int64 @@ -103,6 +130,11 @@ const ( PathMax = 0x400 ) +const ( + ST_WAIT = 0x1 + ST_NOWAIT = 0x2 +) + const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go index 3427811f98..289184e0b3 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go @@ -82,6 +82,34 @@ type Stat_t struct { type Statfs_t [0]byte +type Statvfs_t struct { + Flag uint64 + Bsize uint64 + Frsize uint64 + Iosize uint64 + Blocks uint64 + Bfree uint64 + Bavail uint64 + Bresvd uint64 + Files uint64 + Ffree uint64 + Favail uint64 + Fresvd uint64 + Syncreads uint64 + Syncwrites uint64 + Asyncreads uint64 + Asyncwrites uint64 + Fsidx Fsid + Fsid uint64 + Namemax uint64 + Owner uint32 + Spare [4]uint32 + Fstypename [32]byte + Mntonname [1024]byte + Mntfromname [1024]byte + _ [4]byte +} + type Flock_t struct { Start int64 Len int64 @@ -107,6 +135,11 @@ const ( PathMax = 0x400 ) +const ( + ST_WAIT = 0x1 + ST_NOWAIT = 0x2 +) + const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go index 399f37a434..428c450e4c 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go @@ -83,6 +83,33 @@ type Stat_t struct { type Statfs_t [0]byte +type Statvfs_t struct { + Flag uint32 + Bsize uint32 + Frsize uint32 + Iosize uint32 + Blocks uint64 + Bfree uint64 + Bavail uint64 + Bresvd uint64 + Files uint64 + Ffree uint64 + Favail uint64 + Fresvd uint64 + Syncreads uint64 + Syncwrites uint64 + Asyncreads uint64 + Asyncwrites uint64 + Fsidx Fsid + Fsid uint32 + Namemax uint32 + Owner uint32 + Spare [4]uint32 + Fstypename [32]byte + Mntonname [1024]byte + Mntfromname [1024]byte +} + type Flock_t struct { Start int64 Len int64 @@ -108,6 +135,11 @@ const ( PathMax = 0x400 ) +const ( + ST_WAIT = 0x1 + ST_NOWAIT = 0x2 +) + const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go index 32f0c15d98..6f1f2842cc 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go @@ -82,6 +82,34 @@ type Stat_t struct { type Statfs_t [0]byte +type Statvfs_t struct { + Flag uint64 + Bsize uint64 + Frsize uint64 + Iosize uint64 + Blocks uint64 + Bfree uint64 + Bavail uint64 + Bresvd uint64 + Files uint64 + Ffree uint64 + Favail uint64 + Fresvd uint64 + Syncreads uint64 + Syncwrites uint64 + Asyncreads uint64 + Asyncwrites uint64 + Fsidx Fsid + Fsid uint64 + Namemax uint64 + Owner uint32 + Spare [4]uint32 + Fstypename [32]byte + Mntonname [1024]byte + Mntfromname [1024]byte + _ [4]byte +} + type Flock_t struct { Start int64 Len int64 @@ -107,6 +135,11 @@ const ( PathMax = 0x400 ) +const ( + ST_WAIT = 0x1 + ST_NOWAIT = 0x2 +) + const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 diff --git a/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go index 8531a190f2..23ed9fe51d 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go @@ -211,6 +211,12 @@ type Cmsghdr struct { Type int32 } +type Inet4Pktinfo struct { + Ifindex uint32 + Spec_dst [4]byte /* in_addr */ + Addr [4]byte /* in_addr */ +} + type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 @@ -236,6 +242,7 @@ const ( SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc + SizeofInet4Pktinfo = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x24 SizeofICMPv6Filter = 0x20 diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 79ce915690..053d664d0b 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -701,6 +701,8 @@ const socket_error = uintptr(^uint32(0)) //sys WSACleanup() (err error) [failretval==socket_error] = ws2_32.WSACleanup //sys WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) [failretval==socket_error] = ws2_32.WSAIoctl //sys socket(af int32, typ int32, protocol int32) (handle Handle, err error) [failretval==InvalidHandle] = ws2_32.socket +//sys sendto(s Handle, buf []byte, flags int32, to unsafe.Pointer, tolen int32) (err error) [failretval==socket_error] = ws2_32.sendto +//sys recvfrom(s Handle, buf []byte, flags int32, from *RawSockaddrAny, fromlen *int32) (n int32, err error) [failretval==-1] = ws2_32.recvfrom //sys Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) [failretval==socket_error] = ws2_32.setsockopt //sys Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error) [failretval==socket_error] = ws2_32.getsockopt //sys bind(s Handle, name unsafe.Pointer, namelen int32) (err error) [failretval==socket_error] = ws2_32.bind @@ -1129,10 +1131,27 @@ func NsecToTimespec(nsec int64) (ts Timespec) { // TODO(brainman): fix all needed for net func Accept(fd Handle) (nfd Handle, sa Sockaddr, err error) { return 0, nil, syscall.EWINDOWS } + func Recvfrom(fd Handle, p []byte, flags int) (n int, from Sockaddr, err error) { - return 0, nil, syscall.EWINDOWS + var rsa RawSockaddrAny + l := int32(unsafe.Sizeof(rsa)) + n32, err := recvfrom(fd, p, int32(flags), &rsa, &l) + n = int(n32) + if err != nil { + return + } + from, err = rsa.Sockaddr() + return } -func Sendto(fd Handle, p []byte, flags int, to Sockaddr) (err error) { return syscall.EWINDOWS } + +func Sendto(fd Handle, p []byte, flags int, to Sockaddr) (err error) { + ptr, l, err := to.sockaddr() + if err != nil { + return err + } + return sendto(fd, p, int32(flags), ptr, l) +} + func SetsockoptTimeval(fd Handle, level, opt int, tv *Timeval) (err error) { return syscall.EWINDOWS } // The Linger struct is wrong but we only noticed after Go 1. diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index 8dd95a0a6f..809fff0b49 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -681,18 +681,26 @@ const ( AF_UNSPEC = 0 AF_UNIX = 1 AF_INET = 2 - AF_INET6 = 23 AF_NETBIOS = 17 + AF_INET6 = 23 + AF_IRDA = 26 + AF_BTH = 32 SOCK_STREAM = 1 SOCK_DGRAM = 2 SOCK_RAW = 3 + SOCK_RDM = 4 SOCK_SEQPACKET = 5 - IPPROTO_IP = 0 - IPPROTO_IPV6 = 0x29 - IPPROTO_TCP = 6 - IPPROTO_UDP = 17 + IPPROTO_IP = 0 + IPPROTO_ICMP = 1 + IPPROTO_IGMP = 2 + BTHPROTO_RFCOMM = 3 + IPPROTO_TCP = 6 + IPPROTO_UDP = 17 + IPPROTO_IPV6 = 41 + IPPROTO_ICMPV6 = 58 + IPPROTO_RM = 113 SOL_SOCKET = 0xffff SO_REUSEADDR = 4 @@ -701,6 +709,7 @@ const ( SO_BROADCAST = 32 SO_LINGER = 128 SO_RCVBUF = 0x1002 + SO_RCVTIMEO = 0x1006 SO_SNDBUF = 0x1001 SO_UPDATE_ACCEPT_CONTEXT = 0x700b SO_UPDATE_CONNECT_CONTEXT = 0x7010 diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 7bed68b2d1..2aa4fa642a 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -257,6 +257,8 @@ var ( procWSACleanup = modws2_32.NewProc("WSACleanup") procWSAIoctl = modws2_32.NewProc("WSAIoctl") procsocket = modws2_32.NewProc("socket") + procsendto = modws2_32.NewProc("sendto") + procrecvfrom = modws2_32.NewProc("recvfrom") procsetsockopt = modws2_32.NewProc("setsockopt") procgetsockopt = modws2_32.NewProc("getsockopt") procbind = modws2_32.NewProc("bind") @@ -2873,6 +2875,39 @@ func socket(af int32, typ int32, protocol int32) (handle Handle, err error) { return } +func sendto(s Handle, buf []byte, flags int32, to unsafe.Pointer, tolen int32) (err error) { + var _p0 *byte + if len(buf) > 0 { + _p0 = &buf[0] + } + r1, _, e1 := syscall.Syscall6(procsendto.Addr(), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(tolen)) + if r1 == socket_error { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + +func recvfrom(s Handle, buf []byte, flags int32, from *RawSockaddrAny, fromlen *int32) (n int32, err error) { + var _p0 *byte + if len(buf) > 0 { + _p0 = &buf[0] + } + r0, _, e1 := syscall.Syscall6(procrecvfrom.Addr(), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + n = int32(r0) + if n == -1 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) { r1, _, e1 := syscall.Syscall6(procsetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen), 0) if r1 == socket_error { diff --git a/vendor/modules.txt b/vendor/modules.txt index 5f2d44e691..f25a16f4af 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -445,7 +445,7 @@ go.mongodb.org/mongo-driver/bson/bsonrw go.mongodb.org/mongo-driver/bson/bsontype go.mongodb.org/mongo-driver/bson/primitive go.mongodb.org/mongo-driver/x/bsonx/bsoncore -# golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 +# golang.org/x/crypto v0.0.0-20200219234226-1ad67e1f0ef4 golang.org/x/crypto/acme golang.org/x/crypto/acme/autocert golang.org/x/crypto/argon2 @@ -470,6 +470,7 @@ golang.org/x/crypto/poly1305 golang.org/x/crypto/scrypt golang.org/x/crypto/ssh golang.org/x/crypto/ssh/agent +golang.org/x/crypto/ssh/internal/bcrypt_pbkdf golang.org/x/crypto/ssh/knownhosts # golang.org/x/net v0.0.0-20191101175033-0deb6923b6d9 golang.org/x/net/context @@ -486,7 +487,7 @@ golang.org/x/oauth2/google golang.org/x/oauth2/internal golang.org/x/oauth2/jws golang.org/x/oauth2/jwt -# golang.org/x/sys v0.0.0-20191127021746-63cb32ae39b2 +# golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c golang.org/x/sys/cpu golang.org/x/sys/unix golang.org/x/sys/windows From 7284327a0077414a35f46feb25a95fd448547f9d Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Fri, 21 Feb 2020 19:53:32 -0300 Subject: [PATCH 101/200] Prevent panic on merge to PR (#10403) (#10408) If you attempt to merge to a branch which on a PR there will be a nil pointer error in the pull request checker. This panic is uncaught and will bring down the gitea server. This PR adds protection to prevent this. Co-authored-by: zeripath --- integrations/git_test.go | 11 +++++++++++ services/pull/pull.go | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/integrations/git_test.go b/integrations/git_test.go index 7753b2cb72..8e02bc4db9 100644 --- a/integrations/git_test.go +++ b/integrations/git_test.go @@ -351,6 +351,17 @@ func doBranchProtectPRMerge(baseCtx *APITestContext, dstPath string) func(t *tes pr, err = doAPICreatePullRequest(ctx, baseCtx.Username, baseCtx.Reponame, "protected", "unprotected")(t) assert.NoError(t, err) }) + t.Run("GenerateCommit", func(t *testing.T) { + _, err := generateCommitWithNewData(littleSize, dstPath, "user2@example.com", "User Two", "branch-data-file-") + assert.NoError(t, err) + }) + t.Run("PushToUnprotectedBranch", doGitPushTestRepository(dstPath, "origin", "protected:unprotected-2")) + var pr2 api.PullRequest + t.Run("CreatePullRequest", func(t *testing.T) { + pr2, err = doAPICreatePullRequest(ctx, baseCtx.Username, baseCtx.Reponame, "unprotected", "unprotected-2")(t) + assert.NoError(t, err) + }) + t.Run("MergePR2", doAPIMergePullRequest(ctx, baseCtx.Username, baseCtx.Reponame, pr2.Index)) t.Run("MergePR", doAPIMergePullRequest(ctx, baseCtx.Username, baseCtx.Reponame, pr.Index)) t.Run("PullProtected", doGitPull(dstPath, "origin", "protected")) t.Run("ProtectProtectedBranchWhitelist", doProtectBranch(ctx, "protected", baseCtx.Username)) diff --git a/services/pull/pull.go b/services/pull/pull.go index 347fe077a6..2a09c98bfe 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -231,6 +231,10 @@ func PushToBaseRepo(pr *models.PullRequest) (err error) { } }() + if err := pr.LoadHeadRepo(); err != nil { + log.Error("Unable to load head repository for PR[%d] Error: %v", pr.ID, err) + return err + } headRepoPath := pr.HeadRepo.RepoPath() if err := git.Clone(headRepoPath, tmpBasePath, git.CloneRepoOptions{ @@ -247,6 +251,10 @@ func PushToBaseRepo(pr *models.PullRequest) (err error) { return fmt.Errorf("OpenRepository: %v", err) } + if err := pr.LoadBaseRepo(); err != nil { + log.Error("Unable to load base repository for PR[%d] Error: %v", pr.ID, err) + return err + } if err := gitRepo.AddRemote("base", pr.BaseRepo.RepoPath(), false); err != nil { return fmt.Errorf("tmpGitRepo.AddRemote: %v", err) } From e938f1d945e026947fcea63ebecdfb66b766bb49 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 22 Feb 2020 12:51:58 +0100 Subject: [PATCH 102/200] Add frontend/backend make targets, fix source release (#10325) (#10414) * Add frontend/backend make targets, fix source release - Add 'make backend' and 'make frontend' make targets which are used to build go and js/css/svg files respectively. - The 'backend' target can be invoked without requiring Node.js to be present on the system if pre-built frontend assets are present like in the release source tarballs. - Fix source releases missing 'dist' folders inside 'node_modules' which were erronously excluded from tar. - Store VERSION in file VERSION for the release tarballs and prefer that file over git-derived version. * fix release task * fix typo * fix another typo Fixes: https://github.com/go-gitea/gitea/issues/10253 --- .gitignore | 1 + Makefile | 46 +++++++++++++------ README.md | 9 ++++ .../doc/installation/from-source.en-us.md | 11 +++++ 4 files changed, 53 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index f6831fe26c..719d381b0a 100644 --- a/.gitignore +++ b/.gitignore @@ -69,6 +69,7 @@ coverage.all /yarn.lock /public/js /public/css +/VERSION # Snapcraft snap/.snapcraft/ diff --git a/Makefile b/Makefile index 280d273c09..d33b5fdc29 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,8 @@ EXTRA_GOFLAGS ?= MAKE_VERSION := $(shell $(MAKE) -v | head -n 1) +STORED_VERSION_FILE := VERSION + ifneq ($(DRONE_TAG),) VERSION ?= $(subst v,,$(DRONE_TAG)) GITEA_VERSION ?= $(VERSION) @@ -38,7 +40,13 @@ else else VERSION ?= master endif - GITEA_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//') + + STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null) + ifneq ($(STORED_VERSION),) + GITEA_VERSION ?= $(STORED_VERSION) + else + GITEA_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//') + endif endif LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)" @@ -96,13 +104,15 @@ include docker/Makefile help: @echo "Make Routines:" @echo " - \"\" equivalent to \"build\"" - @echo " - build creates the entire project" - @echo " - clean delete integration files and build files but not css and js files" - @echo " - clean-all delete all generated files (integration test, build, css and js files)" + @echo " - build build everything" + @echo " - frontend build frontend files" + @echo " - backend build backend files" + @echo " - clean delete backend and integration files" + @echo " - clean-all delete backend, frontend and integration files" @echo " - css rebuild only css files" @echo " - js rebuild only js files" - @echo " - generate run \"make css js\" and \"go generate\"" - @echo " - fmt format the code" + @echo " - generate run \"go generate\"" + @echo " - fmt format the Go code" @echo " - generate-swagger generate the swagger spec from code comments" @echo " - swagger-validate check if the swagger spec is valide" @echo " - revive run code linter revive" @@ -156,10 +166,6 @@ fmt: vet: $(GO) vet $(PACKAGES) -.PHONY: generate -generate: js css - GO111MODULE=on $(GO) generate -mod=vendor $(PACKAGES) - .PHONY: generate-swagger generate-swagger: $(SWAGGER) generate spec -o './$(SWAGGER_SPEC)' @@ -414,13 +420,23 @@ install: $(wildcard *.go) $(GO) install -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' .PHONY: build -build: go-check generate $(EXECUTABLE) +build: frontend backend + +.PHONY: frontend +frontend: node-check js css + +.PHONY: backend +backend: go-check generate $(EXECUTABLE) + +.PHONY: generate +generate: + GO111MODULE=on $(GO) generate -mod=vendor $(PACKAGES) $(EXECUTABLE): $(GO_SOURCES) GO111MODULE=on $(GO) build -mod=vendor $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@ .PHONY: release -release: generate release-dirs release-windows release-linux release-darwin release-copy release-compress release-sources release-check +release: frontend generate release-dirs release-windows release-linux release-darwin release-copy release-compress release-sources release-check .PHONY: release-dirs release-dirs: @@ -472,8 +488,10 @@ release-compress: cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && gxz -k -9 $${file}; done; .PHONY: release-sources -release-sources: - tar cvzf $(DIST)/release/gitea-src-$(VERSION).tar.gz --exclude $(DIST) --exclude .git . +release-sources: | node_modules + echo $(VERSION) > $(STORED_VERSION_FILE) + tar --exclude=./$(DIST) --exclude=./.git --exclude=./node_modules/.cache -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz . + rm -f $(STORED_VERSION_FILE) node_modules: package-lock.json npm install --no-save diff --git a/README.md b/README.md index f27b5b38fe..01411098bf 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,15 @@ From the root of the source tree, run: TAGS="bindata" make build +The `build` target is split into two sub-targets: + +- `make backend` which requires [Go 1.11](https://golang.org/dl/) or greater. +- `make frontend` which requires [Node.js 10.0.0](https://nodejs.org/en/download/) or greater. + +If pre-built frontend files are present it is possible to only build the backend: + + TAGS="bindata" make backend + More info: https://docs.gitea.io/en-us/install-from-source/ ## Using diff --git a/docs/content/doc/installation/from-source.en-us.md b/docs/content/doc/installation/from-source.en-us.md index f5e12182a3..ceb263884f 100644 --- a/docs/content/doc/installation/from-source.en-us.md +++ b/docs/content/doc/installation/from-source.en-us.md @@ -114,6 +114,17 @@ recommended way to build from source is therefore: TAGS="bindata sqlite sqlite_unlock_notify" make build ``` +The `build` target is split into two sub-targets: + +- `make backend` which requires [Go 1.11](https://golang.org/dl/) or greater. +- `make frontend` which requires [Node.js 10.0.0](https://nodejs.org/en/download/) or greater. + +If pre-built frontend files are present it is possible to only build the backend: + +```bash +TAGS="bindata" make backend +`` + ## Test After following the steps above, a `gitea` binary will be available in the working directory. From d3b6f001febb7bbb804adae3f025225a55f1f702 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 23 Feb 2020 20:46:17 +0000 Subject: [PATCH 103/200] Various fixes in login sources (#10428) (#10429) Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> --- models/error.go | 15 +++++++++++++++ models/login_source.go | 27 +++++++++++++-------------- models/org_team_test.go | 2 +- models/user.go | 9 +++++++++ modules/auth/pam/pam.go | 10 ++++++---- modules/auth/pam/pam_stub.go | 4 ++-- options/locale/locale_en-US.ini | 1 + routers/admin/users.go | 3 +++ routers/api/v1/admin/org.go | 1 + routers/api/v1/admin/user.go | 1 + routers/api/v1/org/org.go | 1 + routers/api/v1/repo/repo.go | 2 ++ routers/user/auth.go | 4 ++++ routers/user/auth_openid.go | 4 ++++ routers/user/setting/profile.go | 3 +++ 15 files changed, 66 insertions(+), 21 deletions(-) diff --git a/models/error.go b/models/error.go index f0d5699aad..b9ebab9c6b 100644 --- a/models/error.go +++ b/models/error.go @@ -56,6 +56,21 @@ func (err ErrNamePatternNotAllowed) Error() string { return fmt.Sprintf("name pattern is not allowed [pattern: %s]", err.Pattern) } +// ErrNameCharsNotAllowed represents a "character not allowed in name" error. +type ErrNameCharsNotAllowed struct { + Name string +} + +// IsErrNameCharsNotAllowed checks if an error is an ErrNameCharsNotAllowed. +func IsErrNameCharsNotAllowed(err error) bool { + _, ok := err.(ErrNameCharsNotAllowed) + return ok +} + +func (err ErrNameCharsNotAllowed) Error() string { + return fmt.Sprintf("User name is invalid [%s]: must be valid alpha or numeric or dash(-_) or dot characters", err.Name) +} + // ErrSSHDisabled represents an "SSH disabled" error. type ErrSSHDisabled struct { } diff --git a/models/login_source.go b/models/login_source.go index f5dae860f8..2774d6f80d 100644 --- a/models/login_source.go +++ b/models/login_source.go @@ -12,7 +12,6 @@ import ( "fmt" "net/smtp" "net/textproto" - "regexp" "strings" "code.gitea.io/gitea/modules/auth/ldap" @@ -455,10 +454,6 @@ func composeFullName(firstname, surname, username string) string { } } -var ( - alphaDashDotPattern = regexp.MustCompile(`[^\w-\.]`) -) - // LoginViaLDAP queries if login/password is valid against the LDAP directory pool, // and create a local user if success when enabled. func LoginViaLDAP(user *User, login, password string, source *LoginSource) (*User, error) { @@ -503,10 +498,6 @@ func LoginViaLDAP(user *User, login, password string, source *LoginSource) (*Use if len(sr.Username) == 0 { sr.Username = login } - // Validate username make sure it satisfies requirement. - if alphaDashDotPattern.MatchString(sr.Username) { - return nil, fmt.Errorf("Invalid pattern for attribute 'username' [%s]: must be valid alpha or numeric or dash(-_) or dot characters", sr.Username) - } if len(sr.Mail) == 0 { sr.Mail = fmt.Sprintf("%s@localhost", sr.Username) @@ -666,7 +657,8 @@ func LoginViaSMTP(user *User, login, password string, sourceID int64, cfg *SMTPC // LoginViaPAM queries if login/password is valid against the PAM, // and create a local user if success when enabled. func LoginViaPAM(user *User, login, password string, sourceID int64, cfg *PAMConfig) (*User, error) { - if err := pam.Auth(cfg.ServiceName, login, password); err != nil { + pamLogin, err := pam.Auth(cfg.ServiceName, login, password) + if err != nil { if strings.Contains(err.Error(), "Authentication failure") { return nil, ErrUserNotExist{0, login, 0} } @@ -677,14 +669,21 @@ func LoginViaPAM(user *User, login, password string, sourceID int64, cfg *PAMCon return user, nil } + // Allow PAM sources with `@` in their name, like from Active Directory + username := pamLogin + idx := strings.Index(pamLogin, "@") + if idx > -1 { + username = pamLogin[:idx] + } + user = &User{ - LowerName: strings.ToLower(login), - Name: login, - Email: login, + LowerName: strings.ToLower(username), + Name: username, + Email: pamLogin, Passwd: password, LoginType: LoginPAM, LoginSource: sourceID, - LoginName: login, + LoginName: login, // This is what the user typed in IsActive: true, } return user, CreateUser(user) diff --git a/models/org_team_test.go b/models/org_team_test.go index b7e2ef113d..0ff7b53b56 100644 --- a/models/org_team_test.go +++ b/models/org_team_test.go @@ -399,7 +399,7 @@ func TestIncludesAllRepositoriesTeams(t *testing.T) { // Create org. org := &User{ - Name: "All repo", + Name: "All_repo", IsActive: true, Type: UserTypeOrganization, Visibility: structs.VisibleTypePublic, diff --git a/models/user.go b/models/user.go index c515bd222b..d8c0fcf47d 100644 --- a/models/user.go +++ b/models/user.go @@ -18,6 +18,7 @@ import ( "image/png" "os" "path/filepath" + "regexp" "strconv" "strings" "time" @@ -87,6 +88,9 @@ var ( // ErrUnsupportedLoginType login source is unknown error ErrUnsupportedLoginType = errors.New("Login source is unknown") + + // Characters prohibited in a user name (anything except A-Za-z0-9_.-) + alphaDashDotPattern = regexp.MustCompile(`[^\w-\.]`) ) // User represents the object of individual and member of organization. @@ -870,6 +874,11 @@ func isUsableName(names, patterns []string, name string) error { // IsUsableUsername returns an error when a username is reserved func IsUsableUsername(name string) error { + // Validate username make sure it satisfies requirement. + if alphaDashDotPattern.MatchString(name) { + // Note: usually this error is normally caught up earlier in the UI + return ErrNameCharsNotAllowed{Name: name} + } return isUsableName(reservedUsernames, reservedUserPatterns, name) } diff --git a/modules/auth/pam/pam.go b/modules/auth/pam/pam.go index 6f0f7240ae..ca299b08ba 100644 --- a/modules/auth/pam/pam.go +++ b/modules/auth/pam/pam.go @@ -13,7 +13,7 @@ import ( ) // Auth pam auth service -func Auth(serviceName, userName, passwd string) error { +func Auth(serviceName, userName, passwd string) (string, error) { t, err := pam.StartFunc(serviceName, userName, func(s pam.Style, msg string) (string, error) { switch s { case pam.PromptEchoOff: @@ -25,12 +25,14 @@ func Auth(serviceName, userName, passwd string) error { }) if err != nil { - return err + return "", err } if err = t.Authenticate(0); err != nil { - return err + return "", err } - return nil + // PAM login names might suffer transformations in the PAM stack. + // We should take whatever the PAM stack returns for it. + return t.GetItem(pam.User) } diff --git a/modules/auth/pam/pam_stub.go b/modules/auth/pam/pam_stub.go index ee2527dd89..604799ca97 100644 --- a/modules/auth/pam/pam_stub.go +++ b/modules/auth/pam/pam_stub.go @@ -11,6 +11,6 @@ import ( ) // Auth not supported lack of pam tag -func Auth(serviceName, userName, passwd string) error { - return errors.New("PAM not supported") +func Auth(serviceName, userName, passwd string) (string, error) { + return "", errors.New("PAM not supported") } diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 5e4d945317..61d3371072 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -374,6 +374,7 @@ user_bio = Biography form.name_reserved = The username '%s' is reserved. form.name_pattern_not_allowed = The pattern '%s' is not allowed in a username. +form.name_chars_not_allowed = User name '%s' contains invalid characters. [settings] profile = Profile diff --git a/routers/admin/users.go b/routers/admin/users.go index b5c7dbd383..5fbbdc83fb 100644 --- a/routers/admin/users.go +++ b/routers/admin/users.go @@ -121,6 +121,9 @@ func NewUserPost(ctx *context.Context, form auth.AdminCreateUserForm) { case models.IsErrNamePatternNotAllowed(err): ctx.Data["Err_UserName"] = true ctx.RenderWithErr(ctx.Tr("user.form.name_pattern_not_allowed", err.(models.ErrNamePatternNotAllowed).Pattern), tplUserNew, &form) + case models.IsErrNameCharsNotAllowed(err): + ctx.Data["Err_UserName"] = true + ctx.RenderWithErr(ctx.Tr("user.form.name_chars_not_allowed", err.(models.ErrNameCharsNotAllowed).Name), tplUserNew, &form) default: ctx.ServerError("CreateUser", err) } diff --git a/routers/api/v1/admin/org.go b/routers/api/v1/admin/org.go index 1db4e592ff..c75fb62d08 100644 --- a/routers/api/v1/admin/org.go +++ b/routers/api/v1/admin/org.go @@ -66,6 +66,7 @@ func CreateOrg(ctx *context.APIContext, form api.CreateOrgOption) { if err := models.CreateOrganization(org, u); err != nil { if models.IsErrUserAlreadyExist(err) || models.IsErrNameReserved(err) || + models.IsErrNameCharsNotAllowed(err) || models.IsErrNamePatternNotAllowed(err) { ctx.Error(http.StatusUnprocessableEntity, "", err) } else { diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go index 6df8ad9393..f372c10cfd 100644 --- a/routers/api/v1/admin/user.go +++ b/routers/api/v1/admin/user.go @@ -90,6 +90,7 @@ func CreateUser(ctx *context.APIContext, form api.CreateUserOption) { if models.IsErrUserAlreadyExist(err) || models.IsErrEmailAlreadyUsed(err) || models.IsErrNameReserved(err) || + models.IsErrNameCharsNotAllowed(err) || models.IsErrNamePatternNotAllowed(err) { ctx.Error(http.StatusUnprocessableEntity, "", err) } else { diff --git a/routers/api/v1/org/org.go b/routers/api/v1/org/org.go index 67770e70aa..2bcd05179e 100644 --- a/routers/api/v1/org/org.go +++ b/routers/api/v1/org/org.go @@ -112,6 +112,7 @@ func Create(ctx *context.APIContext, form api.CreateOrgOption) { if err := models.CreateOrganization(org, ctx.User); err != nil { if models.IsErrUserAlreadyExist(err) || models.IsErrNameReserved(err) || + models.IsErrNameCharsNotAllowed(err) || models.IsErrNamePatternNotAllowed(err) { ctx.Error(http.StatusUnprocessableEntity, "", err) } else { diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index 8f34d8cca3..b7f9a539cb 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -511,6 +511,8 @@ func handleMigrateError(ctx *context.APIContext, repoOwner *models.User, remoteA ctx.Error(http.StatusUnprocessableEntity, "", fmt.Sprintf("You have already reached your limit of %d repositories.", repoOwner.MaxCreationLimit())) case models.IsErrNameReserved(err): ctx.Error(http.StatusUnprocessableEntity, "", fmt.Sprintf("The username '%s' is reserved.", err.(models.ErrNameReserved).Name)) + case models.IsErrNameCharsNotAllowed(err): + ctx.Error(http.StatusUnprocessableEntity, "", fmt.Sprintf("The username '%s' contains invalid characters.", err.(models.ErrNameCharsNotAllowed).Name)) case models.IsErrNamePatternNotAllowed(err): ctx.Error(http.StatusUnprocessableEntity, "", fmt.Sprintf("The pattern '%s' is not allowed in a username.", err.(models.ErrNamePatternNotAllowed).Pattern)) default: diff --git a/routers/user/auth.go b/routers/user/auth.go index 6395836480..be0396cce1 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -928,6 +928,7 @@ func LinkAccountPostRegister(ctx *context.Context, cpt *captcha.Captcha, form au LoginName: gothUser.(goth.User).UserID, } + //nolint: dupl if err := models.CreateUser(u); err != nil { switch { case models.IsErrUserAlreadyExist(err): @@ -942,6 +943,9 @@ func LinkAccountPostRegister(ctx *context.Context, cpt *captcha.Captcha, form au case models.IsErrNamePatternNotAllowed(err): ctx.Data["Err_UserName"] = true ctx.RenderWithErr(ctx.Tr("user.form.name_pattern_not_allowed", err.(models.ErrNamePatternNotAllowed).Pattern), tplLinkAccount, &form) + case models.IsErrNameCharsNotAllowed(err): + ctx.Data["Err_UserName"] = true + ctx.RenderWithErr(ctx.Tr("user.form.name_chars_not_allowed", err.(models.ErrNameCharsNotAllowed).Name), tplLinkAccount, &form) default: ctx.ServerError("CreateUser", err) } diff --git a/routers/user/auth_openid.go b/routers/user/auth_openid.go index ccaea8264f..bd05538ad3 100644 --- a/routers/user/auth_openid.go +++ b/routers/user/auth_openid.go @@ -400,6 +400,7 @@ func RegisterOpenIDPost(ctx *context.Context, cpt *captcha.Captcha, form auth.Si Passwd: password, IsActive: !setting.Service.RegisterEmailConfirm, } + //nolint: dupl if err := models.CreateUser(u); err != nil { switch { case models.IsErrUserAlreadyExist(err): @@ -414,6 +415,9 @@ func RegisterOpenIDPost(ctx *context.Context, cpt *captcha.Captcha, form auth.Si case models.IsErrNamePatternNotAllowed(err): ctx.Data["Err_UserName"] = true ctx.RenderWithErr(ctx.Tr("user.form.name_pattern_not_allowed", err.(models.ErrNamePatternNotAllowed).Pattern), tplSignUpOID, &form) + case models.IsErrNameCharsNotAllowed(err): + ctx.Data["Err_UserName"] = true + ctx.RenderWithErr(ctx.Tr("user.form.name_chars_not_allowed", err.(models.ErrNameCharsNotAllowed).Name), tplSignUpOID, &form) default: ctx.ServerError("CreateUser", err) } diff --git a/routers/user/setting/profile.go b/routers/user/setting/profile.go index 6db9fc7c6e..368dc23738 100644 --- a/routers/user/setting/profile.go +++ b/routers/user/setting/profile.go @@ -58,6 +58,9 @@ func handleUsernameChange(ctx *context.Context, newName string) { case models.IsErrNamePatternNotAllowed(err): ctx.Flash.Error(ctx.Tr("user.form.name_pattern_not_allowed", newName)) ctx.Redirect(setting.AppSubURL + "/user/settings") + case models.IsErrNameCharsNotAllowed(err): + ctx.Flash.Error(ctx.Tr("user.form.name_chars_not_allowed", newName)) + ctx.Redirect(setting.AppSubURL + "/user/settings") default: ctx.ServerError("ChangeUserName", err) } From b51d7c459e65cd91c12859a37171a8d3c1fbb8ed Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 24 Feb 2020 12:48:30 +0800 Subject: [PATCH 104/200] Fix webhook bug (#10427) (#10432) Co-authored-by: techknowlogick --- modules/notification/webhook/webhook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/notification/webhook/webhook.go b/modules/notification/webhook/webhook.go index e0801445d8..47112b92ab 100644 --- a/modules/notification/webhook/webhook.go +++ b/modules/notification/webhook/webhook.go @@ -689,12 +689,12 @@ func (m *webhookNotifier) NotifyDeleteRef(pusher *models.User, repo *models.Repo if err := webhook_module.PrepareWebhooks(repo, models.HookEventDelete, &api.DeletePayload{ Ref: refName, - RefType: "branch", + RefType: refType, PusherType: api.PusherTypeUser, Repo: apiRepo, Sender: apiPusher, }); err != nil { - log.Error("PrepareWebhooks.(delete branch): %v", err) + log.Error("PrepareWebhooks.(delete %s): %v", refType, err) } } From 9e6ad64d485b79f9f7e90ed67a29202cb78a1a20 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 24 Feb 2020 15:30:59 +0100 Subject: [PATCH 105/200] Trigger webhooks on issue label-change via API too (#10421) (#10439) * trigger webhooks with api too * fix comment * notify report old too * CI restart * restart CI again * remove duplicated code --- routers/api/v1/repo/issue_label.go | 65 +++++++++++++----------------- services/issue/label.go | 15 +++++++ 2 files changed, 44 insertions(+), 36 deletions(-) diff --git a/routers/api/v1/repo/issue_label.go b/routers/api/v1/repo/issue_label.go index 492da244f2..a9fb42a186 100644 --- a/routers/api/v1/repo/issue_label.go +++ b/routers/api/v1/repo/issue_label.go @@ -102,24 +102,8 @@ func AddIssueLabels(ctx *context.APIContext, form api.IssueLabelsOption) { // "403": // "$ref": "#/responses/forbidden" - issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index")) + issue, labels, err := prepareForReplaceOrAdd(ctx, form) if err != nil { - if models.IsErrIssueNotExist(err) { - ctx.NotFound() - } else { - ctx.Error(http.StatusInternalServerError, "GetIssueByIndex", err) - } - return - } - - if !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) { - ctx.Status(http.StatusForbidden) - return - } - - labels, err := models.GetLabelsInRepoByIDs(ctx.Repo.Repository.ID, form.Labels) - if err != nil { - ctx.Error(http.StatusInternalServerError, "GetLabelsInRepoByIDs", err) return } @@ -204,7 +188,7 @@ func DeleteIssueLabel(ctx *context.APIContext) { return } - if err := models.DeleteIssueLabel(issue, label, ctx.User); err != nil { + if err := issue_service.RemoveLabel(issue, ctx.User, label); err != nil { ctx.Error(http.StatusInternalServerError, "DeleteIssueLabel", err) return } @@ -248,28 +232,12 @@ func ReplaceIssueLabels(ctx *context.APIContext, form api.IssueLabelsOption) { // "403": // "$ref": "#/responses/forbidden" - issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index")) + issue, labels, err := prepareForReplaceOrAdd(ctx, form) if err != nil { - if models.IsErrIssueNotExist(err) { - ctx.NotFound() - } else { - ctx.Error(http.StatusInternalServerError, "GetIssueByIndex", err) - } return } - if !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) { - ctx.Status(http.StatusForbidden) - return - } - - labels, err := models.GetLabelsInRepoByIDs(ctx.Repo.Repository.ID, form.Labels) - if err != nil { - ctx.Error(http.StatusInternalServerError, "GetLabelsInRepoByIDs", err) - return - } - - if err := issue.ReplaceLabels(labels, ctx.User); err != nil { + if err := issue_service.ReplaceLabels(issue, ctx.User, labels); err != nil { ctx.Error(http.StatusInternalServerError, "ReplaceLabels", err) return } @@ -339,3 +307,28 @@ func ClearIssueLabels(ctx *context.APIContext) { ctx.Status(http.StatusNoContent) } + +func prepareForReplaceOrAdd(ctx *context.APIContext, form api.IssueLabelsOption) (issue *models.Issue, labels []*models.Label, err error) { + issue, err = models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index")) + if err != nil { + if models.IsErrIssueNotExist(err) { + ctx.NotFound() + } else { + ctx.Error(http.StatusInternalServerError, "GetIssueByIndex", err) + } + return + } + + labels, err = models.GetLabelsInRepoByIDs(ctx.Repo.Repository.ID, form.Labels) + if err != nil { + ctx.Error(http.StatusInternalServerError, "GetLabelsInRepoByIDs", err) + return + } + + if !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) { + ctx.Status(http.StatusForbidden) + return + } + + return +} diff --git a/services/issue/label.go b/services/issue/label.go index 5e154df959..d2c1cd6ec5 100644 --- a/services/issue/label.go +++ b/services/issue/label.go @@ -61,3 +61,18 @@ func RemoveLabel(issue *models.Issue, doer *models.User, label *models.Label) er notification.NotifyIssueChangeLabels(doer, issue, nil, []*models.Label{label}) return nil } + +// ReplaceLabels removes all current labels and add new labels to the issue. +func ReplaceLabels(issue *models.Issue, doer *models.User, labels []*models.Label) error { + old, err := models.GetLabelsByIssueID(issue.ID) + if err != nil { + return err + } + + if err := issue.ReplaceLabels(labels, doer); err != nil { + return err + } + + notification.NotifyIssueChangeLabels(doer, issue, labels, old) + return nil +} From 3abb25166c5da155b8ce1f708268aabf9ad9c9d7 Mon Sep 17 00:00:00 2001 From: "oscar.lofwenhamn" <44643697+oscarlofwenhamn@users.noreply.github.com> Date: Mon, 24 Feb 2020 19:19:25 +0100 Subject: [PATCH 106/200] Update markbates/goth (backport) (#10445) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update markbates/goth to v1.61.2 - Fixes a JWT decoding issue in the OpenID provider - Updates the GitHub provider to use the authorization header for authentication - Updates the Twitch provider for Twitch's v5 API changes - Adds the email and is_private_email fields to the Apple provider's GetUser implementation - Modifies gothic to export a non-collidable context key for setting the Provider in a context.Context - Adds new scopes to the Spotify provider - Adds the IDToken from OpenID providers on the user struct - Make Apple provider's SecretParams public - Adds support for sign in with Apple, and drops support for Go versions 1.7 and 1.8 - Fixes the Slack provider's FetchURL logic to use the appropriate scope for the info it needs Signed-off-by: Oscar LÃfwenhamn --- go.mod | 2 +- go.sum | 5 +++-- vendor/github.com/markbates/goth/.travis.yml | 4 +--- vendor/github.com/markbates/goth/README.md | 1 + vendor/github.com/markbates/goth/go.mod | 3 +++ vendor/github.com/markbates/goth/go.sum | 8 ++++++++ .../github.com/markbates/goth/gothic/gothic.go | 16 ++++++++++++++++ .../markbates/goth/providers/github/github.go | 9 ++++++--- .../providers/openidConnect/openidConnect.go | 13 +++++-------- vendor/github.com/markbates/goth/user.go | 1 + vendor/modules.txt | 2 +- 11 files changed, 46 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index eb7acc4a32..672de02fac 100644 --- a/go.mod +++ b/go.mod @@ -62,7 +62,7 @@ require ( github.com/lib/pq v1.2.0 github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96 github.com/mailru/easyjson v0.7.0 // indirect - github.com/markbates/goth v1.56.0 + github.com/markbates/goth v1.61.2 github.com/mattn/go-isatty v0.0.7 github.com/mattn/go-oci8 v0.0.0-20190320171441-14ba190cf52d // indirect github.com/mattn/go-sqlite3 v1.11.0 diff --git a/go.sum b/go.sum index 46d8788588..ea0053f396 100644 --- a/go.sum +++ b/go.sum @@ -351,6 +351,7 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lafriks/xormstore v1.3.2 h1:hqi3F8s/B4rz8GuEZZDuHuOxRjeuOpEI/cC7vcnWwH4= github.com/lafriks/xormstore v1.3.2/go.mod h1:mVNIwIa25QIr8rfR7YlVjrqN/apswHkVdtLCyVYBzXw= +github.com/lestrrat-go/jwx v0.9.0/go.mod h1:iEoxlYfZjvoGpuWwxUz+eR5e6KTJGsaRcy/YNA/UnBk= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -370,8 +371,8 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/markbates/going v1.0.0/go.mod h1:I6mnB4BPnEeqo85ynXIx1ZFLLbtiLHNXVgWeFO9OGOA= -github.com/markbates/goth v1.56.0 h1:XEYedCgMNz5pi3ojXI8z2XUmXtBnMeuKUpx4Z6HlNj8= -github.com/markbates/goth v1.56.0/go.mod h1:zZmAw0Es0Dpm7TT/4AdN14QrkiWLMrrU9Xei1o+/mdA= +github.com/markbates/goth v1.61.2 h1:jDowrUH5qw8KGuQdKwFhLzkXkTYCIPfz3LHADJsiPIs= +github.com/markbates/goth v1.61.2/go.mod h1:qh2QfwZoWRucQ+DR5KVKC6dUGkNCToWh4vS45GIzFsY= github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-oci8 v0.0.0-20190320171441-14ba190cf52d h1:m+dSK37rFf2fqppZhg15yI2IwC9BtucBiRwSDm9VL8g= diff --git a/vendor/github.com/markbates/goth/.travis.yml b/vendor/github.com/markbates/goth/.travis.yml index 7fd29cde8d..0bf9f1b873 100644 --- a/vendor/github.com/markbates/goth/.travis.yml +++ b/vendor/github.com/markbates/goth/.travis.yml @@ -3,9 +3,7 @@ language: go sudo: false go: - - 1.7 - - 1.8 - - 1.9 + - "1.9" - "1.10" - "1.11" - "1.12" diff --git a/vendor/github.com/markbates/goth/README.md b/vendor/github.com/markbates/goth/README.md index a35746e4e1..a2b988f5af 100644 --- a/vendor/github.com/markbates/goth/README.md +++ b/vendor/github.com/markbates/goth/README.md @@ -17,6 +17,7 @@ $ go get github.com/markbates/goth ## Supported Providers * Amazon +* Apple * Auth0 * Azure AD * Battle.net diff --git a/vendor/github.com/markbates/goth/go.mod b/vendor/github.com/markbates/goth/go.mod index 11b3857d79..941bb64fda 100644 --- a/vendor/github.com/markbates/goth/go.mod +++ b/vendor/github.com/markbates/goth/go.mod @@ -3,12 +3,15 @@ module github.com/markbates/goth require ( cloud.google.com/go v0.30.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/gorilla/mux v1.6.2 github.com/gorilla/pat v0.0.0-20180118222023-199c85a7f6d1 github.com/gorilla/sessions v1.1.1 github.com/jarcoal/httpmock v0.0.0-20180424175123-9c70cfe4a1da + github.com/lestrrat-go/jwx v0.9.0 github.com/markbates/going v1.0.0 github.com/mrjones/oauth v0.0.0-20180629183705-f4e24b6d100c + github.com/pkg/errors v0.8.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/testify v1.2.2 golang.org/x/oauth2 v0.0.0-20180620175406-ef147856a6dd diff --git a/vendor/github.com/markbates/goth/go.sum b/vendor/github.com/markbates/goth/go.sum index ae43832953..1ecf8cdbc8 100644 --- a/vendor/github.com/markbates/goth/go.sum +++ b/vendor/github.com/markbates/goth/go.sum @@ -2,6 +2,8 @@ cloud.google.com/go v0.30.0 h1:xKvyLgk56d0nksWq49J0UyGEeUIicTl4+UBiX1NPX9g= cloud.google.com/go v0.30.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= @@ -16,10 +18,16 @@ github.com/gorilla/sessions v1.1.1 h1:YMDmfaK68mUixINzY/XjscuJ47uXFWSSHzFbBQM0Pr github.com/gorilla/sessions v1.1.1/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE8ovaJD0w= github.com/jarcoal/httpmock v0.0.0-20180424175123-9c70cfe4a1da h1:FjHUJJ7oBW4G/9j1KzlHaXL09LyMVM9rupS39lncbXk= github.com/jarcoal/httpmock v0.0.0-20180424175123-9c70cfe4a1da/go.mod h1:ks+b9deReOc7jgqp+e7LuFiCBH6Rm5hL32cLcEAArb4= +github.com/lestrrat-go/jwx v0.9.0 h1:Fnd0EWzTm0kFrBPzE/PEPp9nzllES5buMkksPMjEKpM= +github.com/lestrrat-go/jwx v0.9.0/go.mod h1:iEoxlYfZjvoGpuWwxUz+eR5e6KTJGsaRcy/YNA/UnBk= +github.com/lestrrat/jwx v0.9.0 h1:sxyUKCQ0KpX4+GPvSu9lAS0tIwpg7F/O8p/HqyZL4ns= +github.com/lestrrat/jwx v0.9.0/go.mod h1:Ogdl8bCZz7p5/jj4RY2LQTceY/c+AoTIk9gJY+KP4H0= github.com/markbates/going v1.0.0 h1:DQw0ZP7NbNlFGcKbcE/IVSOAFzScxRtLpd0rLMzLhq0= github.com/markbates/going v1.0.0/go.mod h1:I6mnB4BPnEeqo85ynXIx1ZFLLbtiLHNXVgWeFO9OGOA= github.com/mrjones/oauth v0.0.0-20180629183705-f4e24b6d100c h1:3wkDRdxK92dF+c1ke2dtj7ZzemFWBHB9plnJOtlwdFA= github.com/mrjones/oauth v0.0.0-20180629183705-f4e24b6d100c/go.mod h1:skjdDftzkFALcuGzYSklqYd8gvat6F1gZJ4YPVbkZpM= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= diff --git a/vendor/github.com/markbates/goth/gothic/gothic.go b/vendor/github.com/markbates/goth/gothic/gothic.go index ea4e1e0db8..edd0e98d71 100644 --- a/vendor/github.com/markbates/goth/gothic/gothic.go +++ b/vendor/github.com/markbates/goth/gothic/gothic.go @@ -10,6 +10,7 @@ package gothic import ( "bytes" "compress/gzip" + "context" "crypto/rand" "encoding/base64" "errors" @@ -35,6 +36,11 @@ var defaultStore sessions.Store var keySet = false +type key int + +// ProviderParamKey can be used as a key in context when passing in a provider +const ProviderParamKey key = iota + func init() { key := []byte(os.Getenv("SESSION_SECRET")) keySet = len(key) != 0 @@ -265,6 +271,11 @@ func getProviderName(req *http.Request) (string, error) { return p, nil } + // try to get it from the go-context's value of providerContextKey key + if p, ok := req.Context().Value(ProviderParamKey).(string); ok { + return p, nil + } + // As a fallback, loop over the used providers, if we already have a valid session for any provider (ie. user has already begun authentication with a provider), then return that provider name providers := goth.GetProviders() session, _ := Store.Get(req, SessionName) @@ -280,6 +291,11 @@ func getProviderName(req *http.Request) (string, error) { return "", errors.New("you must select a provider") } +// GetContextWithProvider returns a new request context containing the provider +func GetContextWithProvider(req *http.Request, provider string) *http.Request { + return req.WithContext(context.WithValue(req.Context(), ProviderParamKey, provider)) +} + // StoreInSession stores a specified key/value pair in the session. func StoreInSession(key string, value string, req *http.Request, res http.ResponseWriter) error { session, _ := Store.New(req, SessionName) diff --git a/vendor/github.com/markbates/goth/providers/github/github.go b/vendor/github.com/markbates/goth/providers/github/github.go index b3c29b9670..e635f5272b 100644 --- a/vendor/github.com/markbates/goth/providers/github/github.go +++ b/vendor/github.com/markbates/goth/providers/github/github.go @@ -10,7 +10,6 @@ import ( "io" "io/ioutil" "net/http" - "net/url" "strconv" "strings" @@ -105,7 +104,9 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { return user, fmt.Errorf("%s cannot get user information without accessToken", p.providerName) } - response, err := p.Client().Get(p.profileURL + "?access_token=" + url.QueryEscape(sess.AccessToken)) + req, err := http.NewRequest("GET", p.profileURL, nil) + req.Header.Add("Authorization", "Bearer "+sess.AccessToken) + response, err := p.Client().Do(req) if err != nil { return user, err } @@ -172,7 +173,9 @@ func userFromReader(reader io.Reader, user *goth.User) error { } func getPrivateMail(p *Provider, sess *Session) (email string, err error) { - response, err := p.Client().Get(p.emailURL + "?access_token=" + url.QueryEscape(sess.AccessToken)) + req, err := http.NewRequest("GET", p.emailURL, nil) + req.Header.Add("Authorization", "Bearer "+sess.AccessToken) + response, err := p.Client().Do(req) if err != nil { if response != nil { response.Body.Close() diff --git a/vendor/github.com/markbates/goth/providers/openidConnect/openidConnect.go b/vendor/github.com/markbates/goth/providers/openidConnect/openidConnect.go index a4ff1d40ff..421d816ffb 100644 --- a/vendor/github.com/markbates/goth/providers/openidConnect/openidConnect.go +++ b/vendor/github.com/markbates/goth/providers/openidConnect/openidConnect.go @@ -6,12 +6,13 @@ import ( "encoding/json" "errors" "fmt" - "github.com/markbates/goth" - "golang.org/x/oauth2" "io/ioutil" "net/http" "strings" "time" + + "github.com/markbates/goth" + "golang.org/x/oauth2" ) const ( @@ -173,6 +174,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { RefreshToken: sess.RefreshToken, ExpiresAt: expiresAt, RawData: claims, + IDToken: sess.IDToken, } p.userFromClaims(claims, &user) @@ -391,13 +393,8 @@ func decodeJWT(jwt string) (map[string]interface{}, error) { return nil, errors.New("jws: invalid token received, not all parts available") } - // Re-pad, if needed - encodedPayload := jwtParts[1] - if l := len(encodedPayload) % 4; l != 0 { - encodedPayload += strings.Repeat("=", 4-l) - } + decodedPayload, err := base64.URLEncoding.WithPadding(base64.NoPadding).DecodeString(jwtParts[1]) - decodedPayload, err := base64.StdEncoding.DecodeString(encodedPayload) if err != nil { return nil, err } diff --git a/vendor/github.com/markbates/goth/user.go b/vendor/github.com/markbates/goth/user.go index 1d6a419632..0cc5830513 100644 --- a/vendor/github.com/markbates/goth/user.go +++ b/vendor/github.com/markbates/goth/user.go @@ -27,4 +27,5 @@ type User struct { AccessTokenSecret string RefreshToken string ExpiresAt time.Time + IDToken string } diff --git a/vendor/modules.txt b/vendor/modules.txt index f25a16f4af..bb7728268b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -293,7 +293,7 @@ github.com/magiconair/properties github.com/mailru/easyjson/buffer github.com/mailru/easyjson/jlexer github.com/mailru/easyjson/jwriter -# github.com/markbates/goth v1.56.0 +# github.com/markbates/goth v1.61.2 github.com/markbates/goth github.com/markbates/goth/gothic github.com/markbates/goth/providers/bitbucket From 4cb18601ff33dda5edb47d5b452cc8f2dc39dd67 Mon Sep 17 00:00:00 2001 From: John Olheiser Date: Tue, 25 Feb 2020 15:08:21 -0600 Subject: [PATCH 107/200] Change action GETs to POST (#10462) (#10464) * Change action GETs to POST * submite = submit + smite * No more # href * Fix test * Match other tests * Explicit csrf Signed-off-by: jolheiser Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> --- integrations/release_test.go | 2 +- routers/routes/routes.go | 12 ++++----- templates/org/member/members.tmpl | 4 +-- templates/org/team/members.tmpl | 5 +++- templates/org/team/repositories.tmpl | 5 +++- templates/org/team/sidebar.tmpl | 10 ++++++-- templates/org/team/teams.tmpl | 10 ++++++-- templates/repo/header.tmpl | 38 ++++++++++++++++------------ templates/repo/issue/milestones.tmpl | 4 +-- templates/user/profile.tmpl | 10 ++++++-- web_src/js/index.js | 14 ++++++++++ 11 files changed, 79 insertions(+), 35 deletions(-) diff --git a/integrations/release_test.go b/integrations/release_test.go index 33badcb0a2..be0abd5e34 100644 --- a/integrations/release_test.go +++ b/integrations/release_test.go @@ -20,7 +20,7 @@ func createNewRelease(t *testing.T, session *TestSession, repoURL, tag, title st resp := session.MakeRequest(t, req, http.StatusOK) htmlDoc := NewHTMLParser(t, resp.Body) - link, exists := htmlDoc.doc.Find("form").Attr("action") + link, exists := htmlDoc.doc.Find("form.ui.form").Attr("action") assert.True(t, exists, "The template has changed") postData := map[string]string{ diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 9d59ade3a3..6fec2c055f 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -485,7 +485,7 @@ func RegisterRoutes(m *macaron.Macaron) { }, reqSignIn) m.Group("/:username", func() { - m.Get("/action/:action", user.Action) + m.Post("/action/:action", user.Action) }, reqSignIn) if macaron.Env == macaron.DEV { @@ -517,7 +517,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("/^:type(issues|pulls)$", user.Issues) m.Get("/milestones", reqMilestonesDashboardPageEnabled, user.Milestones) m.Get("/members", org.Members) - m.Get("/members/action/:action", org.MembersAction) + m.Post("/members/action/:action", org.MembersAction) m.Get("/teams", org.Teams) }, context.OrgAssignment(true)) @@ -525,8 +525,8 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/:org", func() { m.Get("/teams/:team", org.TeamMembers) m.Get("/teams/:team/repositories", org.TeamRepositories) - m.Route("/teams/:team/action/:action", "GET,POST", org.TeamsAction) - m.Route("/teams/:team/action/repo/:action", "GET,POST", org.TeamsRepoAction) + m.Post("/teams/:team/action/:action", org.TeamsAction) + m.Post("/teams/:team/action/repo/:action", org.TeamsRepoAction) }, context.OrgAssignment(true, false, true)) m.Group("/:org", func() { @@ -660,7 +660,7 @@ func RegisterRoutes(m *macaron.Macaron) { }) }, reqSignIn, context.RepoAssignment(), context.UnitTypes(), reqRepoAdmin, context.RepoRef()) - m.Get("/:username/:reponame/action/:action", reqSignIn, context.RepoAssignment(), context.UnitTypes(), repo.Action) + m.Post("/:username/:reponame/action/:action", reqSignIn, context.RepoAssignment(), context.UnitTypes(), repo.Action) m.Group("/:username/:reponame", func() { m.Group("/issues", func() { @@ -714,7 +714,7 @@ func RegisterRoutes(m *macaron.Macaron) { Post(bindIgnErr(auth.CreateMilestoneForm{}), repo.NewMilestonePost) m.Get("/:id/edit", repo.EditMilestone) m.Post("/:id/edit", bindIgnErr(auth.CreateMilestoneForm{}), repo.EditMilestonePost) - m.Get("/:id/:action", repo.ChangeMilestonStatus) + m.Post("/:id/:action", repo.ChangeMilestonStatus) m.Post("/delete", repo.DeleteMilestone) }, context.RepoMustNotBeArchived(), reqRepoIssuesOrPullsWriter, context.RepoRef()) m.Group("/milestone", func() { diff --git a/templates/org/member/members.tmpl b/templates/org/member/members.tmpl index 03aadf97b8..22ae87b1d9 100644 --- a/templates/org/member/members.tmpl +++ b/templates/org/member/members.tmpl @@ -22,10 +22,10 @@ {{ $isPublic := index $.MembersIsPublicMember .ID}} {{if $isPublic}} {{$.i18n.Tr "org.members.public"}} - {{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}({{$.i18n.Tr "org.members.public_helper"}}){{end}} + {{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}({{$.i18n.Tr "org.members.public_helper"}}){{end}} {{else}} {{$.i18n.Tr "org.members.private"}} - {{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}({{$.i18n.Tr "org.members.private_helper"}}){{end}} + {{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}({{$.i18n.Tr "org.members.private_helper"}}){{end}} {{end}}
    diff --git a/templates/org/team/members.tmpl b/templates/org/team/members.tmpl index 74e5e1908a..f3b08652cd 100644 --- a/templates/org/team/members.tmpl +++ b/templates/org/team/members.tmpl @@ -27,7 +27,10 @@ {{range .Team.Members}}
    {{if $.IsOrganizationOwner}} - {{$.i18n.Tr "org.members.remove"}} +
    + {{$.CsrfTokenHtml}} + +
    {{end}} diff --git a/templates/org/team/repositories.tmpl b/templates/org/team/repositories.tmpl index 66af5195b0..50b3f2cffb 100644 --- a/templates/org/team/repositories.tmpl +++ b/templates/org/team/repositories.tmpl @@ -35,7 +35,10 @@ {{range .Team.Repos}}
    {{if $canAddRemove}} - {{$.i18n.Tr "remove"}} +
    + {{$.CsrfTokenHtml}} + +
    {{end}} diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl index 75c5ce756d..531990a986 100644 --- a/templates/org/team/sidebar.tmpl +++ b/templates/org/team/sidebar.tmpl @@ -3,9 +3,15 @@ {{.Team.Name}}
    {{if .Team.IsMember $.SignedUser.ID}} - {{$.i18n.Tr "org.teams.leave"}} +
    + {{$.CsrfTokenHtml}} + +
    {{else if .IsOrganizationOwner}} - {{$.i18n.Tr "org.teams.join"}} +
    + {{$.CsrfTokenHtml}} + +
    {{end}}
    diff --git a/templates/org/team/teams.tmpl b/templates/org/team/teams.tmpl index 8714181140..af1fd2a5de 100644 --- a/templates/org/team/teams.tmpl +++ b/templates/org/team/teams.tmpl @@ -17,9 +17,15 @@ {{.Name}}
    {{if .IsMember $.SignedUser.ID}} - {{$.i18n.Tr "org.teams.leave"}} +
    + {{$.CsrfTokenHtml}} + +
    {{else if $.IsOrganizationOwner}} - {{$.i18n.Tr "org.teams.join"}} +
    + {{$.CsrfTokenHtml}} + +
    {{end}}
    diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index b3757b2764..b27d9ae546 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -20,22 +20,28 @@
    {{if not .IsBeingCreated}}
    - - +
    + {{$.CsrfTokenHtml}} +
    + + + {{.NumWatches}} + +
    +
    +
    + {{$.CsrfTokenHtml}} +
    + + + {{.NumStars}} + +
    +
    {{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}}
  • {{end}} diff --git a/web_src/js/index.js b/web_src/js/index.js index b654af2c73..2b95299692 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -2479,6 +2479,7 @@ $(document).ready(() => { // Helpers. $('.delete-button').click(showDeletePopup); $('.add-all-button').click(showAddAllPopup); + $('.link-action').click(linkAction); $('.delete-branch-button').click(showDeletePopup); @@ -2736,6 +2737,19 @@ function showAddAllPopup() { return false; } +function linkAction() { + const $this = $(this); + $.post($this.data('url'), { + _csrf: csrf + }).done((data) => { + if (data.redirect) { + window.location.href = data.redirect; + } else { + window.location.reload(); + } + }); +} + function initVueComponents() { const vueDelimeters = ['${', '}']; From ed664a9e1dae4d4660e60c981173bbc5102e69ea Mon Sep 17 00:00:00 2001 From: John Olheiser Date: Tue, 25 Feb 2020 17:42:43 -0600 Subject: [PATCH 108/200] Change admin dashboard to POST (#10465) (#10466) * Change admin dashboard to POST (#10465) * Add form and convert to POST * Redirect for flash * Convert octicons back to fa for 1.11 Signed-off-by: jolheiser --- modules/auth/admin.go | 10 ++++ routers/admin/admin.go | 30 +++++++---- routers/routes/routes.go | 1 + templates/admin/dashboard.tmpl | 91 ++++++++++++++++++---------------- web_src/less/_admin.less | 4 ++ 5 files changed, 81 insertions(+), 55 deletions(-) diff --git a/modules/auth/admin.go b/modules/auth/admin.go index 6e225891dd..bebb4055be 100644 --- a/modules/auth/admin.go +++ b/modules/auth/admin.go @@ -47,3 +47,13 @@ type AdminEditUserForm struct { func (f *AdminEditUserForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { return validate(errs, ctx.Data, f, ctx.Locale) } + +// AdminDashboardForm form for admin dashboard operations +type AdminDashboardForm struct { + Op int `binding:"required"` +} + +// Validate validates form fields +func (f *AdminDashboardForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { + return validate(errs, ctx.Data, f, ctx.Locale) +} diff --git a/routers/admin/admin.go b/routers/admin/admin.go index 055b8f5a5e..e8237f5b4c 100644 --- a/routers/admin/admin.go +++ b/routers/admin/admin.go @@ -16,6 +16,7 @@ import ( "time" "code.gitea.io/gitea/models" + "code.gitea.io/gitea/modules/auth" "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/cron" @@ -30,7 +31,6 @@ import ( "gitea.com/macaron/macaron" "gitea.com/macaron/session" - "github.com/unknwon/com" ) const ( @@ -144,14 +144,28 @@ func Dashboard(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("admin.dashboard") ctx.Data["PageIsAdmin"] = true ctx.Data["PageIsAdminDashboard"] = true + ctx.Data["Stats"] = models.GetStatistic() + // FIXME: update periodically + updateSystemStatus() + ctx.Data["SysStatus"] = sysStatus + ctx.HTML(200, tplDashboard) +} + +// DashboardPost run an admin operation +func DashboardPost(ctx *context.Context, form auth.AdminDashboardForm) { + ctx.Data["Title"] = ctx.Tr("admin.dashboard") + ctx.Data["PageIsAdmin"] = true + ctx.Data["PageIsAdminDashboard"] = true + ctx.Data["Stats"] = models.GetStatistic() + updateSystemStatus() + ctx.Data["SysStatus"] = sysStatus // Run operation. - op, _ := com.StrTo(ctx.Query("op")).Int() - if op > 0 { + if form.Op > 0 { var err error var success string - switch Operation(op) { + switch Operation(form.Op) { case cleanInactivateUser: success = ctx.Tr("admin.dashboard.delete_inactivate_accounts_success") err = models.DeleteInactivateUsers() @@ -189,15 +203,9 @@ func Dashboard(ctx *context.Context) { } else { ctx.Flash.Success(success) } - ctx.Redirect(setting.AppSubURL + "/admin") - return } - ctx.Data["Stats"] = models.GetStatistic() - // FIXME: update periodically - updateSystemStatus() - ctx.Data["SysStatus"] = sysStatus - ctx.HTML(200, tplDashboard) + ctx.Redirect(setting.AppSubURL + "/admin") } // SendTestMail send test mail to confirm mail service is OK diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 6fec2c055f..455c0b16e7 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -408,6 +408,7 @@ func RegisterRoutes(m *macaron.Macaron) { // ***** START: Admin ***** m.Group("/admin", func() { m.Get("", adminReq, admin.Dashboard) + m.Post("", adminReq, bindIgnErr(auth.AdminDashboardForm{}), admin.DashboardPost) m.Get("/config", admin.Config) m.Post("/config/test_mail", admin.SendTestMail) m.Group("/monitor", func() { diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl index 262db04b90..8ee63b5414 100644 --- a/templates/admin/dashboard.tmpl +++ b/templates/admin/dashboard.tmpl @@ -15,50 +15,53 @@ {{.i18n.Tr "admin.dashboard.operations"}}
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {{.i18n.Tr "admin.dashboard.delete_inactivate_accounts"}} {{.i18n.Tr "admin.dashboard.operation_run"}}
    {{.i18n.Tr "admin.dashboard.delete_repo_archives"}} {{.i18n.Tr "admin.dashboard.operation_run"}}
    {{.i18n.Tr "admin.dashboard.delete_missing_repos"}} {{.i18n.Tr "admin.dashboard.operation_run"}}
    {{.i18n.Tr "admin.dashboard.git_gc_repos"}} {{.i18n.Tr "admin.dashboard.operation_run"}}
    {{.i18n.Tr "admin.dashboard.resync_all_sshkeys"}} {{.i18n.Tr "admin.dashboard.operation_run"}}
    {{.i18n.Tr "admin.dashboard.resync_all_hooks"}} {{.i18n.Tr "admin.dashboard.operation_run"}}
    {{.i18n.Tr "admin.dashboard.reinit_missing_repos"}} {{.i18n.Tr "admin.dashboard.operation_run"}}
    {{.i18n.Tr "admin.dashboard.sync_external_users"}} {{.i18n.Tr "admin.dashboard.operation_run"}}
    {{.i18n.Tr "admin.dashboard.git_fsck"}} {{.i18n.Tr "admin.dashboard.operation_run"}}
    {{.i18n.Tr "admin.dashboard.delete_generated_repository_avatars"}} {{.i18n.Tr "admin.dashboard.operation_run"}}
    +
    + {{.CsrfTokenHtml}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {{.i18n.Tr "admin.dashboard.delete_inactivate_accounts"}}
    {{.i18n.Tr "admin.dashboard.delete_repo_archives"}}
    {{.i18n.Tr "admin.dashboard.delete_missing_repos"}}
    {{.i18n.Tr "admin.dashboard.git_gc_repos"}}
    {{.i18n.Tr "admin.dashboard.resync_all_sshkeys"}}
    {{.i18n.Tr "admin.dashboard.resync_all_hooks"}}
    {{.i18n.Tr "admin.dashboard.reinit_missing_repos"}}
    {{.i18n.Tr "admin.dashboard.sync_external_users"}}
    {{.i18n.Tr "admin.dashboard.git_fsck"}}
    {{.i18n.Tr "admin.dashboard.delete_generated_repository_avatars"}}
    +

    diff --git a/web_src/less/_admin.less b/web_src/less/_admin.less index 0bd685142a..15781cf77a 100644 --- a/web_src/less/_admin.less +++ b/web_src/less/_admin.less @@ -28,6 +28,10 @@ } } } + + form button[type='submit'] { + padding: 5px 8px; + } } .ui.header, From e9061a537cddcff893683a3fcc4f98e3e659324b Mon Sep 17 00:00:00 2001 From: John Olheiser Date: Wed, 26 Feb 2020 11:14:37 -0600 Subject: [PATCH 109/200] Fix admin notices (#10480) (#10483) Signed-off-by: jolheiser --- routers/routes/routes.go | 2 +- templates/admin/notice.tmpl | 5 ++++- web_src/less/_admin.less | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 455c0b16e7..454c2495ca 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -470,7 +470,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/notices", func() { m.Get("", admin.Notices) m.Post("/delete", admin.DeleteNotices) - m.Get("/empty", admin.EmptyNotices) + m.Post("/empty", admin.EmptyNotices) }) }, adminReq) // ***** END: Admin ***** diff --git a/templates/admin/notice.tmpl b/templates/admin/notice.tmpl index 93fc8ccc2e..8e56713ece 100644 --- a/templates/admin/notice.tmpl +++ b/templates/admin/notice.tmpl @@ -40,7 +40,10 @@
    - {{.i18n.Tr "admin.notices.delete_all"}} +
    + {{.CsrfTokenHtml}} + +