Bug 4285 - strange code in smbldap-useradd
strange code in smbldap-useradd
Product: Samba 3.0
Classification: Unclassified
Component: smbldap-tools
Other Linux
: P3 normal
: none
Assigned To: Tournier Jerome
smbldap-tools team
Depends on:
  Show dependency treegraph
Reported: 2006-12-07 08:10 UTC by Pascal Terjan
Modified: 2010-09-04 07:12 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Terjan 2006-12-07 08:10:21 UTC
I don't understand following code :

# untaint $userName (can finish with one or two $)
if ($userName =~ /^([\w -.]+\$?)$/) {
  $userName = $1;
} else {
  print "$0: illegal username\n";
  exit (1);

The comment say "(can finish with one or two $)" but the regexp will only match one, and I don't understand what does "untaint" mean.

And what is the goal of "$userName = $1" ? $1 will always have the content that $userName already had, except maybe "\n" at the end that would be dropped.
Comment 1 Tournier Jerome 2010-09-04 07:12:19 UTC
Not maintained anymore