Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 157577 - Important comment in source code is incorrect
Summary: Important comment in source code is incorrect
Alias: None
Product: Fedora
Classification: Fedora
Component: shadow-utils
Version: 3
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2005-05-12 19:50 UTC by Nick Urbanik
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-05-13 11:14:39 UTC

Attachments (Terms of Use)

Description Nick Urbanik 2005-05-12 19:50:17 UTC
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 11:14:39 UTC

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