Bug 2210593

Summary: selinux-autorelabel-generator.sh: In POSIX sh, 'source' in place of '.' is undefined.
Product: [Fedora] Fedora Reporter: Wiley Young <wyeth2485>
Component: policycoreutilsAssignee: Petr Lautrbach <plautrba>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 38CC: dwalsh, lvrabec, mmalik, plautrba, vmojzis
Target Milestone: ---Keywords: Desktop
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-01-02 14:16:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Wiley Young 2023-05-28 21:35:09 UTC
This bug originally misfiled:
https://github.com/systemd/systemd/issues/27642

Used distribution

Fedora 38
Linux kernel version used

6.2.9-300.fc38.x86_64
CPU architectures issue was seen on

i686
Component

No response
Expected behaviour you didn't see

No response
Unexpected behaviour you saw

Ran shellcheck on /usr/lib/systemd/system-generators/selinux-autorelabel-generator.sh on Fedora 38; got back a warning.

Steps to reproduce the problem

[liveuser@localhost-live selinux]$ shellcheck -S warning /usr/lib/systemd/system-generators/selinux-autorelabel-generator.sh

In /usr/lib/systemd/system-generators/selinux-autorelabel-generator.sh line 22:
    source /etc/selinux/config
    ^------------------------^ SC3046 (warning): In POSIX sh, 'source' in place of '.' is undefined.

For more information:
  https://www.shellcheck.net/wiki/SC3046 -- In POSIX sh, 'source' in place of...


Reproducible: Always

Steps to Reproduce:
1. dnf install -y ShellCheck
2. shellcheck -S warning /usr/lib/systemd/system-generators/selinux-autorelabel-generator.sh
3. rpm -qf /usr/lib/systemd/system-generators/selinux-autorelabel-generator.sh

Actual Results:  
[liveuser@localhost-live selinux]$ shellcheck -S warning /usr/lib/systemd/system-generators/selinux-autorelabel-generator.sh

In /usr/lib/systemd/system-generators/selinux-autorelabel-generator.sh line 22:
    source /etc/selinux/config
    ^------------------------^ SC3046 (warning): In POSIX sh, 'source' in place of '.' is undefined.

For more information:
  https://www.shellcheck.net/wiki/SC3046 -- In POSIX sh, 'source' in place of...
[liveuser@localhost-live selinux]$ shellcheck -S warning /usr/lib/systemd/system-generators/selinux-autorelabel-generator.sh^C
[liveuser@localhost-live selinux]$ rpm -qf /usr/lib/systemd/system-generators/selinux-autorelabel-generator.sh
policycoreutils-3.5-1.fc38.x86_64


Expected Results:  
No warnings.

Comment 1 Petr Lautrbach 2023-05-29 08:39:27 UTC
Thanks!

https://src.fedoraproject.org/rpms/policycoreutils/pull-request/37