Bug 157577 - Important comment in source code is incorrect
Important comment in source code is incorrect
Product: Fedora
Classification: Fedora
Component: shadow-utils (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2005-05-12 15:50 EDT by Nick Urbanik
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-05-13 07:14:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Nick Urbanik 2005-05-12 15:50:17 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050416 Fedora/1.0.3-1.3.1 Firefox/1.0.3

Description of problem:
After unpacking the source package with rpmbuild -bp shadow-utils.spec, the source file .../BUILD/shadow-4.0.3/libmisc/chkname.c has an incorrect regular expression showing valid user names.  Instead of:
we should have:

The middle characters include '-' according to the code, but the regular expression does not include '-' in [a-zA-Z0-9_-.]{0,30}

In the regular expression, the literal '-' should be at the beginning or end of the [...].  The meaning of [_-.] is the same as [_.], since the range [_-.] contains only the two characters '_' and '.'.

The problem is actually in the patch shadow-4.0.3-goodname.patch, so is a Red Hat problem, not an upstream problem.

It is important to fix this, since there are many who will believe the comment without reading the code that implements something different.

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

How reproducible:

Steps to Reproduce:
1.  rpm -Uhv shadow-utils-4.0.3-56.src.rpm
2.  cd ~/RPM/SPECS;rpmbuild -bp shadow-utils.spec
3.  less ../BUILD/shadow-4.0.3/libmisc/chkname.c

Actual Results:  Line 24 is:
         *   [a-zA-Z0-9_.][a-zA-Z0-9_-.]{0,30}[a-zA-Z0-9_.$-]?

Expected Results:  Line 24 should be:
         *   [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]?

Additional info:
Comment 1 Peter Vrabec 2005-05-13 07:14:39 EDT

Note You need to log in before you can comment on or make changes to this bug.