Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1028400

Summary: /etc/cron.daily/prelink : syntax error in PRELINK_NONRPM_CHECK_INTERVAL handling
Product: Red Hat Enterprise Linux 6 Reporter: Karsten Weiss <knweiss>
Component: prelinkAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: qe-baseos-tools-bugs
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.4CC: mfranc, mpolacek
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-11 19:47:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
suggested fix none

Description Karsten Weiss 2013-11-08 11:13:25 UTC
Created attachment 821523 [details]
suggested fix

Description of problem:

I didn't look too deep into this but doesn't the following "find" line
in /etc/cron.daily/prelink look suspicious? It's seems as a line is missing.

   [ "`find /var/lib/prelink/quick -mtime -${PRELINK_NONRPM_CHECK_INTERVAL:-7} 2>/dev/null`" \
     -a -f /var/lib/rpm/Packages \
     -a /var/lib/rpm/Packages -ot /var/lib/prelink/quick ] && exit 0

The bourne shell static analyzer "shellcheck" also complains:

# shellcheck /etc/cron.daily/prelink

In /etc/cron.daily/prelink line 27:
elif [ -n "$PRELINK_FULL_TIME_INTERVAL" \
^-- The mentioned parser error was in this elif clause.


In /etc/cron.daily/prelink line 33:
  [ "`find /var/lib/prelink/quick -mtime -${PRELINK_NONRPM_CHECK_INTERVAL:-7} 2>/dev/null`" \
  ^-- Couldn't parse this test expression.


In /etc/cron.daily/prelink line 34:
    -a -f /var/lib/rpm/Packages \
          ^-- Unexpected "/". Fix any mentioned problems and try again.

Version-Release number of selected component (if applicable):

prelink-0.4.6-3.1.el6_4.x86_64

How reproducible:

Always

Steps to Reproduce:
1. -
2. -
3. -

Actual results:

- 

Expected results:

- 

Additional info:

I've attached a patch suggestion.

(The same issue can be found in RHEL 5.10.)

Comment 2 Karsten Weiss 2013-11-08 11:50:43 UTC
Well, adding an explicit "-n" in front of the string makes "shellcheck" happy, too.

  [ -n "`find /var/lib/misc/prelink.quick -mtime -${PRELINK_NONRPM_CHECK_INTERVAL:-7} 2>/dev/null`" \

Sorry, I guess this was a false alarm.

Comment 3 Jakub Jelinek 2013-11-08 12:18:43 UTC
Man page for test says:
STRING equivalent to -n STRING
and given that find shouldn't print anything other than
/var/lib/misc/prelink.quick or empty string and thus there are no - or ! characters in there, I think the script is fine.

Comment 4 Karsten Weiss 2013-11-08 13:29:04 UTC
Yes, I agree. Sorry!

I'll file a shellcheck bug instead.