Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rpm-user #55

Closed
rhd opened this issue Jun 7, 2019 · 6 comments · Fixed by #117
Closed

add rpm-user #55

rhd opened this issue Jun 7, 2019 · 6 comments · Fixed by #117
Labels
enhancement New feature or request

Comments

@rhd
Copy link

rhd commented Jun 7, 2019

Hi, is it possible to either add or workaround fpm's rpm-user option?

    --rpm-user USER               (rpm only) Set the user to USER in the %files section. Overrides the user when used with use-file-permissions setting.

I need the files in the RPM owned by a specific user.

Thanks and great app!

@ti-mo
Copy link

ti-mo commented Jan 14, 2020

Hi @rhd @caarlos0

Has there been any progress on this? I'm calling nfpm through goreleaser, and when installing my rpm in a fedora:latest image:

[root@66f5aed57836 app]# rpm -Uvh conntracct_0.2.0-next_linux_amd64.rpm
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:conntracct-0.2.0-next            
warning: user  does not exist - using root
warning: group  does not exist - using root
################################# [100%]

Is this a symptom of this issue? Any known workaround? This behaviour doesn't seem to occur when installing the equivalent .debs on a Debian image.

@caarlos0
Copy link
Member

haven't worked on it yet, no...

PRs accepted though :)

@ti-mo
Copy link

ti-mo commented Jan 14, 2020

Digging a bit deeper:

[root@66f5aed57836 ~]# rpm -qlvp conntracct_0.2.0-next_linux_amd64.rpm
-rw-r--r--    1                                    344 Jan 14 12:59 /etc/conntracct/conntracct.yml
-rwxr-xr-x    1                               14538208 Jan 14 13:16 /usr/bin/conntracct

The files inside the RPM don't seem to have an owner at all. Is this intended? I don't need to be able to set the user, but I would just like my package to install without errors/warnings for now. :) In comparison, here is the same command run on another RPM package:

[root@66f5aed57836 ~]# rpm -qlvp rpm-5.4.15-42-omv2015.0.x86_64.rpm
-rwxr-xr-x    1 root     root                    32208 Sep 21  2018 /bin/rpm
-rwxr-xr-x    1 root     root                       50 Sep 21  2018 /etc/cron.daily/rpm

Could this be a bug?

@ti-mo
Copy link

ti-mo commented Jan 15, 2020

Alright, looks like this is indeed being addressed in #97. Calls to rpm.AddFile contain rpmpack.RPMFile arguments without Owner and Group fields set, causing the owner/group fields of all files inside the archive to be empty. RPM does fall back to root in this case. With some quick changes applied:

		rpm.AddFile(
			rpmpack.RPMFile{
				...
				Owner: "root",
				Group: "root",

the RPM installs without errors, and the files inside the archive have an owner/group:

[root@689f5577f54f ~]# rpm -qvl conntracct_0.2.0-next_linux_amd64.rpm
-rw-r--r--    1 root     root                      344 Jan 14 12:59 /etc/conntracct/conntracct.yml
-rw-r--r--    1 root     root                      404 Jan 15 07:52 /lib/systemd/system/conntracct.service
-rwxr-xr-x    1 root     root                 14538208 Jan 15 08:15 /usr/bin/conntracct

@caarlos0
Copy link
Member

check #117 plz

@caarlos0
Copy link
Member

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@goreleaser goreleaser locked as resolved and limited conversation to collaborators Nov 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants