Cannot create a new Gitea user without Gitea system user having read/execute access to current directory #4634
Labels
No Label
backport/done
backport/v1.0
backport/v1.1
backport/v1.10
backport/v1.11
backport/v1.12
backport/v1.13
backport/v1.14
backport/v1.15
backport/v1.2
backport/v1.3
backport/v1.4
backport/v1.5
backport/v1.6
backport/v1.7
backport/v1.8
backport/v1.9
bounty
changelog
dependencies
frontport/done
frontport/main
good first issue
Hacktoberfest
hacktoberfest-accepted
in progress
kind/api
kind/breaking
kind/bug
kind/build
kind/deployment
kind/deprecated
kind/docs
kind/enhancement
kind/feature
kind/lint
kind/misc
kind/moderation
kind/package
kind/proposal
kind/question
kind/refactor
kind/regression
kind/security
kind/summary
kind/testing
kind/translation
kind/ui
kind/upstream-related
kind/usability
kind/ux
lgtm/done
lgtm/need 1
lgtm/need 2
performance/bigrepo
performance/cpu
performance/memory
performance/speed
priority/critical
priority/low
priority/maybe
priority/medium
proposal/rejected
reviewed/confirmed
reviewed/duplicate
reviewed/fixed
reviewed/invalid
reviewed/not-a-bug
reviewed/wontfix
skip-changelog
stale
status/blocked
status/needs-feedback
status/wip
theme/2fa
theme/authentication
theme/avatar
theme/backup-restore
theme/docker
theme/federation
theme/issues
theme/kanban
theme/markdown
theme/migration
theme/mobile
theme/pr
theme/signing
theme/sqlite
theme/timetracker
theme/webhook
theme/wiki
No Milestone
No project
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: lunny/gitea#4634
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
[x]
):Description
Trying to create a new user using command-line tools (
sudo -u git gitea admin create-user --name=user --password=pass --email=user@example.com --config=/usr/local/etc/gitea/conf/app.ini
, git being Gitea user) while being in a directory without Gitea user having access to it (like/home/john
with700
permissions) causes this error:Entering a different directory with git having access to it (
/
for example) fixes this issue. Honestly I do not really understand why gitea even checks the current directory, as it has nothing to do with what it is doing.Seems like upstream issue in our used framework (go-macaron) but not sure why
I am currently (trying) to install gitea for the first time and have the same issue.
This is because Macaron runs
os.Getwd()
on init:4df59ae8a5/macaron.go (L311-L319)
"Getwd returns a rooted path name corresponding to the current directory."
So when run in a folder that the running user doesn't have permissions in, this call will fail. Either GItea can try and detect this, and switch to a location where the user does have permissions if appropriate (like running one off commands) using Chdir, or it should be specific that it requires being run in a folder with permissions.
Damn it calls this on
init()
which doesn't give us much time to fix things. I suppose I should be thankful that it's calledmacaron
so we have a large amount of lexical space to work in.We could just temporarily move ourselves to a temporary path, and once macaron has initialized move ourselves back?
OK could someone try #6559 overnight. It might fire early enough to protect otherwise we'll have to move to a file perhaps called a.go
Also ran into this. Made a temporary workaround in
/etc/systemd/system/gitea.service
: