{"action":"created","issue":{"url":"https://api.github.com/repos/cyrusimap/cyrus-imapd/issues/2227","repository_url":"https://api.github.com/repos/cyrusimap/cyrus-imapd","labels_url":"https://api.github.com/repos/cyrusimap/cyrus-imapd/issues/2227/labels{/name}","comments_url":"https://api.github.com/repos/cyrusimap/cyrus-imapd/issues/2227/comments","events_url":"https://api.github.com/repos/cyrusimap/cyrus-imapd/issues/2227/events","html_url":"https://github.com/cyrusimap/cyrus-imapd/issues/2227","id":286060818,"node_id":"MDU6SXNzdWUyODYwNjA4MTg=","number":2227,"title":"user_deny.db gets wrong ownership after cvt_cyrusdb is executed","user":{"login":"dmak","id":366965,"node_id":"MDQ6VXNlcjM2Njk2NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/366965?v=4","gravatar_id":"","url":"https://api.github.com/users/dmak","html_url":"https://github.com/dmak","followers_url":"https://api.github.com/users/dmak/followers","following_url":"https://api.github.com/users/dmak/following{/other_user}","gists_url":"https://api.github.com/users/dmak/gists{/gist_id}","starred_url":"https://api.github.com/users/dmak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmak/subscriptions","organizations_url":"https://api.github.com/users/dmak/orgs","repos_url":"https://api.github.com/users/dmak/repos","events_url":"https://api.github.com/users/dmak/events{/privacy}","received_events_url":"https://api.github.com/users/dmak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-01-04T17:39:11Z","updated_at":"2018-11-16T02:47:09Z","closed_at":null,"author_association":"NONE","body":"After restarting Cyrus, the file `/var/lib/cyrus/user_deny.db` gets permissions `root:root` which results the following complain in log:\r\n```\r\nJan  4 17:41:13 cyrus/imap[2770]: IOERROR: opening /var/lib/cyrus/user_deny.db: Permission denied\r\nJan  4 17:41:13 cyrus/imap[2770]: DBERROR: failed to detect DB type for /var/lib/cyrus/user_deny.db (backend flat) (r was -1)\r\nJan  4 17:41:13 cyrus/imap[2770]: DENYDB_ERROR: opening /var/lib/cyrus/user_deny.db: cyrusdb error\r\n```\r\nAfter \"fixing\" that with `chown cyrus.mail /var/lib/cyrus/user_deny.db`, Cyrus stops complaining until next e.g. system restart.\r\nThe problem was reported in 2015 as [Debian bug#788997](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=788997) against Cyrus v2.4.17, but is still present in Cyrus v2.5.10."},"comment":{"url":"https://api.github.com/repos/cyrusimap/cyrus-imapd/issues/comments/439263733","html_url":"https://github.com/cyrusimap/cyrus-imapd/issues/2227#issuecomment-439263733","issue_url":"https://api.github.com/repos/cyrusimap/cyrus-imapd/issues/2227","id":439263733,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTI2MzczMw==","user":{"login":"elliefm","id":10985135,"node_id":"MDQ6VXNlcjEwOTg1MTM1","avatar_url":"https://avatars3.githubusercontent.com/u/10985135?v=4","gravatar_id":"","url":"https://api.github.com/users/elliefm","html_url":"https://github.com/elliefm","followers_url":"https://api.github.com/users/elliefm/followers","following_url":"https://api.github.com/users/elliefm/following{/other_user}","gists_url":"https://api.github.com/users/elliefm/gists{/gist_id}","starred_url":"https://api.github.com/users/elliefm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elliefm/subscriptions","organizations_url":"https://api.github.com/users/elliefm/orgs","repos_url":"https://api.github.com/users/elliefm/repos","events_url":"https://api.github.com/users/elliefm/events{/privacy}","received_events_url":"https://api.github.com/users/elliefm/received_events","type":"User","site_admin":false},"created_at":"2018-11-16T02:47:09Z","updated_at":"2018-11-16T02:47:09Z","author_association":"CONTRIBUTOR","body":" > ```\r\n> # /usr/lib/cyrus/bin/cvt_cyrusdb /var/lib/cyrus/user_deny.db skiplist /var/backups/cyrus/user_deny.skiplist.txt flat\r\n> Converting from /var/lib/cyrus/user_deny.db (skiplist) to /var/backups/cyrus/user_deny.skiplist.txt (flat)\r\n> ```\r\n> `cvt_cyrusdb` changes the permission of `user_deny.db` as it creates a checkpoint in the given database.\r\n\r\nBased on the '#' in your prompt in that example, it looks as if you are in a root shell when you run cvt_cyrusdb.  I imagine the checkpointing process works by creating a new file, and atomically renaming it over the old one on success (so in failure cases, the original file is undamaged).  Of course, if you're running the process as root, the new file is going to be created as root...\r\n\r\nIf you haven't already solved this, I expect you'll be able to solve it by altering your backup routine to execute ctl_cyrusdb as your cyrus user (e.g. by use of `su cyrus ...` or `sudo -u cyrus ...`)"}}
{"actor":{"display_login":"elliefm"}}