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

cliwrap/rpm: mark --eval/-E as safe #4835

Merged
merged 1 commit into from
Feb 25, 2024
Merged

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Feb 22, 2024

This is sometimes used in scripts to query aspects of the host system.
E.g. this is used by Fedora's pkg-config:

https://src.fedoraproject.org/rpms/pkgconf/blob/95c0bbee/f/pkg-config.in#_6

This in turn gets hit by kdump which runs dracut which has modules that
runs pkgconf to query some directory paths.

This is sometimes used in scripts to query aspects of the host system.
E.g. this is used by Fedora's pkg-config:

https://src.fedoraproject.org/rpms/pkgconf/blob/95c0bbee/f/pkg-config.in#_6

This in turn gets hit by kdump which runs dracut which has modules that
runs `pkgconf` to query some directory paths.
@jmarrero jmarrero merged commit fe58662 into coreos:main Feb 25, 2024
17 checks passed
champtar added a commit to champtar/sos that referenced this pull request Apr 24, 2024
When calling dracut on an rpm-ostree based system
with cliwrap enabled you get the following message:
```
This system is rpm-ostree based; initramfs handling is
integrated with the underlying ostree transaction mechanism.
Use `rpm-ostree initramfs` to control client-side initramfs generation.
rpm-ostree: Note: This system is image (rpm-ostree) based.
rpm-ostree: Dropping privileges as `dracut` was executed with not "known safe" arguments.
rpm-ostree: You may invoke the real `dracut` binary in `/usr/libexec/rpm-ostree/wrapped/dracut`.
rpm-ostree: Continuing execution in 5 seconds.
```

Calling `/usr/libexec/rpm-ostree/wrapped/dracut --print-cmdline` is
still slow because it calls rpm multiple times which is also a wrapped
cli. Call dracut with the env variable RPMOSTREE_CLIWRAP_SKIP to avoid
the 5s wait. This is safe because we only use read only commands.

With rpm-ostree v2024.4 `rpm --eval` is marked as safe, so we don't have
the 5s wait anymore for rpm calls
(coreos/rpm-ostree#4835)

Resolves: RHEL-33703

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
champtar added a commit to champtar/sos that referenced this pull request Apr 24, 2024
When calling dracut on an rpm-ostree based system
with cliwrap enabled you get the following message:
```
This system is rpm-ostree based; initramfs handling is
integrated with the underlying ostree transaction mechanism.
Use `rpm-ostree initramfs` to control client-side initramfs generation.
rpm-ostree: Note: This system is image (rpm-ostree) based.
rpm-ostree: Dropping privileges as `dracut` was executed with not "known safe" arguments.
rpm-ostree: You may invoke the real `dracut` binary in `/usr/libexec/rpm-ostree/wrapped/dracut`.
rpm-ostree: Continuing execution in 5 seconds.
```

Calling `/usr/libexec/rpm-ostree/wrapped/dracut --print-cmdline` is
still slow because it calls rpm multiple times which is also a wrapped
cli. Call dracut with the env variable RPMOSTREE_CLIWRAP_SKIP to avoid
the 5s waits. This is safe because we only use read only commands.

With rpm-ostree v2024.4 `rpm --eval` is marked as safe, so we don't
have the 5s wait anymore for rpm calls
(coreos/rpm-ostree#4835)

Resolves: RHEL-33703

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
champtar added a commit to champtar/sos that referenced this pull request Apr 24, 2024
When calling dracut on an rpm-ostree based system
with cliwrap enabled you get the following message:
```
This system is rpm-ostree based; initramfs handling is
integrated with the underlying ostree transaction mechanism.
Use `rpm-ostree initramfs` to control client-side initramfs generation.
rpm-ostree: Note: This system is image (rpm-ostree) based.
rpm-ostree: Dropping privileges as `dracut` was executed with not
  "known safe" arguments.
rpm-ostree: You may invoke the real `dracut` binary in
  `/usr/libexec/rpm-ostree/wrapped/dracut`.
rpm-ostree: Continuing execution in 5 seconds.
```

Calling `/usr/libexec/rpm-ostree/wrapped/dracut --print-cmdline` is
still slow because it calls rpm multiple times which is also a wrapped
cli. Call dracut with the env variable RPMOSTREE_CLIWRAP_SKIP to avoid
the 5s waits. This is safe because we only use read only commands.

With rpm-ostree v2024.4 `rpm --eval` is marked as safe, so we don't
have the 5s wait anymore for rpm calls
(coreos/rpm-ostree#4835)

Resolves: RHEL-33703

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
arif-ali pushed a commit to sosreport/sos that referenced this pull request Apr 26, 2024
When calling dracut on an rpm-ostree based system
with cliwrap enabled you get the following message:
```
This system is rpm-ostree based; initramfs handling is
integrated with the underlying ostree transaction mechanism.
Use `rpm-ostree initramfs` to control client-side initramfs generation.
rpm-ostree: Note: This system is image (rpm-ostree) based.
rpm-ostree: Dropping privileges as `dracut` was executed with not
  "known safe" arguments.
rpm-ostree: You may invoke the real `dracut` binary in
  `/usr/libexec/rpm-ostree/wrapped/dracut`.
rpm-ostree: Continuing execution in 5 seconds.
```

Calling `/usr/libexec/rpm-ostree/wrapped/dracut --print-cmdline` is
still slow because it calls rpm multiple times which is also a wrapped
cli. Call dracut with the env variable RPMOSTREE_CLIWRAP_SKIP to avoid
the 5s waits. This is safe because we only use read only commands.

With rpm-ostree v2024.4 `rpm --eval` is marked as safe, so we don't
have the 5s wait anymore for rpm calls
(coreos/rpm-ostree#4835)

Resolves: RHEL-33703

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants