NumericUserGroupName - command /usr/bin/grep -c '^[[:digit:]]' /etc/passwd /etc/group

This parser reads the output of /usr/bin/grep -c '^[[:digit:]]' /etc/passwd /etc/group and detects whether there are any user or group names that begin with a digit.

The grep command returns the number of matches for each file. It matches for user and group names that begin with a number.

The answers are available through attributes - boolean has_numeric_user_group and numeric nr_numeric_user and nr_numeric_group.

Names starting with a digit can be handled incorrectly by some software. Purely numeric user names can be handled incorrectly by some software and requires special care when used with utilities that accept both user/group IDs and names (like chown, chmod). In case such names exist on the system, it is advisable to review whether the used software (namely 3rd party software and shell scripts) handles the names correctly.

Sample input:



>>> shared[NumericUserGroupName].has_numeric_user_or_group
>>> shared[NumericUserGroupName].nr_numeric_user
>>> shared[NumericUserGroupName].nr_numeric_group
class insights.parsers.numeric_user_group_name.NumericUserGroupName(context, extra_bad_lines=None)[source]

Bases: CommandParser

Reports whether there is a user or group with a name that starts with a digit.


This method must be implemented by classes based on this class.