-
Notifications
You must be signed in to change notification settings - Fork 252
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
SPEC: enabled 'sysusers' for f-41+ #7267
Conversation
Hmm... @pbrezina, @sumit-bose,
|
Issue is only seen if user didn't exist before, so at a fresh install, not upgrade. |
I don't find any 'pre' script in INFO/SCRIPTS of 'sssd-common' at all... What I find is:
|
71bc4db
to
0d8aa66
Compare
I believe we need to install sssd.sysuser to the proper location on the system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I forgot we already did this. Then we also need to use that installed file with %sysusers_create_compat, you are still pointing to buildroot which does not exist.
contrib/sssd.spec.in
Outdated
@@ -1047,7 +1047,7 @@ install -D -p -m 0644 contrib/sssd.sysusers %{buildroot}%{_sysusersdir}/sssd.con | |||
%if %{use_sssd_user} | |||
%pre common | |||
%if %{use_sysusers} | |||
%sysusers_create_compat contrib/sssd.sysusers | |||
%sysusers_create_compat %{buildroot}%{_sysusersdir}/sssd.conf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/%{buildroot}//
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
but if you remove %{buildroot}
you will end up with /usr/lib/sysusers.d/sssd.conf
, i.e. referencing a file from the filesystem of the build host.
The %sysuser_create_compat
macro is executed at the time the scriptlets for the rpm packages are created and it calls /usr/lib/rpm/sysusers.generate-pre.sh
with the sysusers config file as argument and the output
# generated from sssd.sysusers
getent group 'sssd' >/dev/null || groupadd -r 'sssd' || :
getent passwd 'sssd' >/dev/null || \
useradd -r -g 'sssd' -d '/' -s '/sbin/nologin' -c 'User for sssd' 'sssd' || :
is written into the scriptlet.
Since we install the sysusers config file as well in /usr/lib/sysusers.d/
the %systemd_post
macro will create users and groups if then not exists as well. But since we need the user and group so that the files installed by rpm will have proper ownership doing this in %post
is too late. And we cannot let systemd do it at install time in %pre
because the sysusers config file is not installed at this time.
To cut it short, I still see no other way than having the sysusers config file as additional source file.
bye,
Sumit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... you are right that %pre is executed before the file is actually installed.
But what difference does it make if we read it from out tarball or from an additional source file? The macro is evaluated before our tarball is extracted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point I wonder if sysusers_create_compat
is really better than "manual" user/group creation...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... you are right that %pre is executed before the file is actually installed.
But what difference does it make if we read it from out tarball or from an additional source file? The macro is evaluated before our tarball is extracted?
Hi,
no, it is evaluated after the tar ball is extracted, after SSSD is build and after content of the BUILD and BUILDROOT directories is removed (I put an ls
in the pre
section to check this), so there is no extracted or built data available anymore.
HTH
bye,
Sumit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like 736430a needs to be reverted fully, including sssd.sysusers creation by autoconf?
I don't understand why but otherwise build fails with:
error: Bad file: /builddir/build/SOURCES/sssd.sysusers: No such file or directory
Bad file: /builddir/build/SOURCES/sssd.sysusers: No such file or directory
0d8aa66
to
c2d4f44
Compare
This partially reverts 736430a The reason is that 'sysusers_create_compat' macro is evaluated after the tar ball is extracted, after SSSD is built and after content of the BUILD and BUILDROOT directories is removed, so otherwise there is no extracted or built data available anymore. See SSSD#7267 (comment) for details.
c2d4f44
to
f592de1
Compare
This partially reverts 736430a The reason is that 'sysusers_create_compat' macro is evaluated after the tar ball is extracted, after SSSD is built and after content of the BUILD and BUILDROOT directories is removed, so otherwise there is no extracted or built data available anymore. See SSSD#7267 (comment) for details.
f592de1
to
d1f45ea
Compare
This partially reverts 736430a The reason is that 'sysusers_create_compat' macro is evaluated after the tar ball is extracted, after SSSD is built and after content of the BUILD and BUILDROOT directories is removed, so otherwise there is no extracted or built data available anymore. See SSSD#7267 (comment) for details.
d1f45ea
to
8bee0f0
Compare
This partially reverts 736430a The reason is that 'sysusers_create_compat' macro is evaluated after the tar ball is extracted, after SSSD is built and after content of the BUILD and BUILDROOT directories is removed, so otherwise there is no extracted or built data available anymore. See SSSD#7267 (comment) for details.
8bee0f0
to
828e61e
Compare
Recent versions seems to work fine both during package upgrade and fresh install (when user doesn't exist) besides weird
|
For 'covscan' job, I've fixed
@pbrezina , what do I miss? |
This partially reverts 736430a The reason is that 'sysusers_create_compat' macro is evaluated after the tar ball is extracted, after SSSD is built and after content of the BUILD and BUILDROOT directories is removed, so otherwise there is no extracted or built data available anymore. See SSSD#7267 (comment) for details.
a1e3b52
to
2d8832f
Compare
covscan is pullrequest_target, the workflow (yml) file is read from the master branch, not from this pull request. So changes in this pull request are not and can not be reflected. pullrequest_target has access to credentials where pull_request does not. The copr_build is pull_request_target as well but it includes build-srpm from checked out repository (which might be potential security problem, I'm not sure if the action has access to the credentials as well... maybe we should probably check). |
2d8832f
to
f70d66e
Compare
Ok, I removed 3rd commit. |
This partially reverts 736430a The reason is that 'sysusers_create_compat' macro is evaluated after the tar ball is extracted, after SSSD is built and after content of the BUILD and BUILDROOT directories is removed, so otherwise there is no extracted or built data available anymore. See SSSD#7267 (comment) for details.
f70d66e
to
a0e1bde
Compare
Rebased. |
So what is the available content/directories/paths when the macro is being evaluated? If I got it right, you have rpmbuild directories, but content under BUILD was deleted? Would it be possible to copy the file to SOURCES in %prep or %install? Or to some location that is not deleted?
I'm not against adding the source file, I am mostly curious at this point. |
This partially reverts 736430a The reason is that 'sysusers_create_compat' macro is evaluated after the tar ball is extracted, after SSSD is built and after content of the BUILD and BUILDROOT directories is removed, so otherwise there is no extracted or built data available anymore. See SSSD#7267 (comment) for details.
a0e1bde
to
77ae679
Compare
Set '/run/sssd/' as 'sssd' user home dir. This is required to accomodate for needs of some Samba libraries that create cache while fetching GPO files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
thanks, the changes work for my. I tested AD GPO access control with the /run/sssd
home directory and it is working fine. libsmbclient.so
is creating /run/sssd/.cache/samba/gencache.tdb
and the two new directories are created with 700
permissions, so even if libsmbclient.so
would write something sensitive it would be only readable for the SSSD user (and root). ACK
bye,
Sumit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. Can you please open pull request for Fedora rawhide as well?
This partially reverts 736430a The reason is that 'sysusers_create_compat' macro is evaluated after the tar ball is extracted, after SSSD is built and after content of the BUILD and BUILDROOT directories is removed, so otherwise there is no extracted or built data available anymore. See #7267 (comment) for details. Reviewed-by: Pavel Březina <[email protected]> Reviewed-by: Sumit Bose <[email protected]>
It's sssd-2.9 based, so only once we release sssd-2.10 and rebase rawhide... |
No description provided.