[Pkg-shadow-devel] [Git][debian/adduser][feature-refactor-existing] 7 commits: add README.source
Marc Haber (@zugschlus)
gitlab at salsa.debian.org
Sun Sep 14 11:42:14 BST 2025
Marc Haber pushed to branch feature-refactor-existing at Debian / adduser
Commits:
c5220a3e by Marc Haber at 2025-09-14T12:30:24+02:00
add README.source
Git-Dch: ignore
- - - - -
59341c55 by Marc Haber at 2025-09-14T12:32:23+02:00
add gbp.conf
Git-Dch: ignore
- - - - -
ea3d0979 by Matt Barry at 2025-09-14T12:42:04+02:00
refactor existing_*_ok
replace with new existing_(user|group)_status, which return a bitmask
value corresponding to these constants:
EXISTING_NOT_FOUND EXISTING_FOUND EXISTING_SYSTEM EXISTING_ID_MISMATCH
(and EXISTING_LOCKED, which is unused in this branch)
- - - - -
b4b53622 by Marc Haber at 2025-09-14T12:42:04+02:00
fixup! refactor existing_*_ok
- - - - -
55e3febb by Marc Haber at 2025-09-14T12:42:04+02:00
more instrumentation output for system_status.t
Git-Dch: ignore
- - - - -
602a622a by Marc Haber at 2025-09-14T12:42:04+02:00
more instrumentation to identify tests
Git-Dch: ignore
- - - - -
7f462172 by Marc Haber at 2025-09-14T12:42:04+02:00
adap test9 for new message output
Git-Dch: ignore
- - - - -
7 changed files:
- AdduserCommon.pm
- adduser
- + debian/README.source
- debian/gbp.conf
- debian/tests/f/adduser_system.t
- debian/tests/f/system_status.t
- testsuite/test9.pl
Changes:
=====================================
AdduserCommon.pm
=====================================
@@ -94,6 +94,15 @@ use constant {
def_min_regex => qr(^[^-+~:,\s/][^:,\s/]*$)aa,
};
+# constants used in existing_*_status
+use constant {
+ EXISTING_NOT_FOUND => 0,
+ EXISTING_FOUND => 1,
+ EXISTING_SYSTEM => 2,
+ EXISTING_ID_MISMATCH => 4,
+ EXISTING_LOCKED => 8,
+};
+
@EXPORT = (
'get_group_members',
'read_config',
@@ -122,6 +131,13 @@ use constant {
'def_sys_name_regex',
'def_ieee_name_regex',
'def_min_regex',
+ 'EXISTING_NOT_FOUND',
+ 'EXISTING_FOUND',
+ 'EXISTING_SYSTEM',
+ 'EXISTING_ID_MISMATCH',
+ 'EXISTING_LOCKED',
+ 'existing_user_status',
+ 'existing_group_status',
);
sub sanitize_string {
@@ -567,6 +583,62 @@ END {
release_lock(1);
}
+# existing_user_status: check if there is already a user present
+# on the system which satisfies the requirements
+# parameter:
+# new_name: the name of the user to check
+# new_uid : the UID of the user
+# return value:
+# bitwise combination of these constants:
+# EXISTING_NOT_FOUND => 0
+# EXISTING_FOUND => 1
+# EXISTING_SYSTEM => 2
+# EXISTING_ID_MISMATCH => 4
+# EXISTING_LOCKED => 8
+# e.g. if the requested account name exists as a locked system user,
+# return 8|2|1 == 11
+sub existing_user_status {
+ my ($config, $new_name,$new_uid) = @_;
+ my ($dummy1,$pw,$uid);
+ my $ret = EXISTING_NOT_FOUND;
+ log_trace( "existing_user_status called with new_name %s, new_uid %s, first_system_uid %s, last_system_uid %s", $new_name, $new_uid, $config->{"first_system_uid"}, $config->{"last_system_uid"} );
+ if (($dummy1,$pw,$uid) = egetpwnam($new_name)) {
+ log_trace( "egetpwnam(%s) returns %s, %s, %s", $new_name, $dummy1, $pw, $uid );
+ $ret |= EXISTING_FOUND;
+ $ret |= EXISTING_ID_MISMATCH if (defined($new_uid) && $uid != $new_uid);
+ $ret |= EXISTING_SYSTEM if
+ (($uid >= $config->{"first_system_uid"}) && ($uid <= $config->{"last_system_uid"}));
+ $ret |= EXISTING_LOCKED if (substr($pw,0,1) eq "!"); # TODO: also check expiry?
+ }
+ log_trace( "existing_user_status returning %d", $ret );
+ return $ret;
+}
+
+# existing_group_status: check if there is already a group which satisfies the requirements
+# parameter:
+# new_name: the name of the group
+# new_gid : the GID of the group
+# return value:
+# bitwise combination of these constants:
+# EXISTING_NOT_FOUND => 0
+# EXISTING_FOUND => 1
+# EXISTING_SYSTEM => 2
+# EXISTING_ID_MISMATCH => 4
+sub existing_group_status {
+ my ($config, $new_name,$new_gid) = @_;
+ my ($dummy1,$dummy2,$gid);
+ my $ret = EXISTING_NOT_FOUND;
+ log_trace( "existing_group_status called with new_name %s, new_gid %s", $new_name, $new_gid );
+ if (($dummy1,$dummy2,$gid) = egetgrnam($new_name)) {
+ $ret |= EXISTING_FOUND;
+ $ret |= EXISTING_ID_MISMATCH if (defined($new_gid) && $gid != $new_gid);
+ $ret |= EXISTING_SYSTEM if
+ (($gid >= $config->{"first_system_gid"} && $gid <= $config->{"last_system_gid"}));
+ }
+ log_trace( "existing_group_status returning %d", $ret );
+ return $ret;
+}
+
1;
# Local Variables:
=====================================
adduser
=====================================
@@ -88,14 +88,6 @@ BEGIN {
}
}
-use constant {
- EXISTING_NOT_FOUND => 0,
- EXISTING_FOUND => 1,
- EXISTING_SYSTEM => 2,
- EXISTING_ID_MISMATCH => 4,
- EXISTING_LOCKED => 8,
-};
-
my $yesexpr = langinfo(YESEXPR());
my $charset = langinfo($codeset);
if ($encode_loaded) {
@@ -103,7 +95,7 @@ if ($encode_loaded) {
binmode(STDERR, ":encoding($charset)");
}
-my %config; # configuration hash
+my %config = ();
my $nogroup_id = egetgrnam("nogroup") || 65534;
$0 =~ s+.*/++;
@@ -332,6 +324,15 @@ if ($found_group_opt) {
}
}
+# $new_firstuid = $new_firstuid || $config{"first_uid"} || 1000;
+# $new_lastuid = $new_lastuid || $config{"last_uid"} || 59999;
+# $new_firstgid = $new_firstgid || $config{"first_gid"} || 1000;
+# $new_lastgid = $new_lastgid || $config{"last_gid"} || 59999;
+# $new_firstuid = $new_firstuid || $config{"first_uid"} || 1000;
+# $new_lastuid = $new_lastuid || $config{"last_uid"} || 59999;
+# $new_firstgid = $new_firstgid || $config{"first_gid"} || 1000;
+# $new_lastgid = $new_lastgid || $config{"last_gid"} || 59999;
+
# read the uid and gid pool
if ($config{"uid_pool"}) {
@@ -385,7 +386,7 @@ if( defined $new_firstuid ) {
}
if( defined $new_lastuid ) {
- log_trace("sanitize new_lastgud");
+ log_trace("sanitize new_lastuid");
$new_lastuid = sanitize_string($new_lastuid, numberre);
}
@@ -437,23 +438,26 @@ $SIG{'INT'} = $SIG{'QUIT'} = $SIG{'HUP'} = 'handler';
if ($action eq "addsysgroup") {
acquire_lock();
+
+ log_trace( "addsysuser %s, uid %s", $new_name, $new_uid );
# Check if requested group already exists and we can exit safely
- my $asgret = existing_group_status($new_name, $gid_option);
+ my $asgret = existing_group_status(\%config, $new_name, $gid_option);
log_trace( "existing_group_status( %s, %s ) returns %s", $new_name, $gid_option, $asgret );
+ if ($asgret & EXISTING_FOUND) {
+ # a group with this name already exists; it's a problem when it's not a system group
+ if ( ( $asgret & EXISTING_SYSTEM ) == 0 ) {
+ log_fatal( mtx("The group `%s' already exists, but is not a system group. Exiting."), $new_name );
+ exit( RET_WRONG_OBJECT_PROPERTIES );
+ }
+ }
if ($asgret & EXISTING_ID_MISMATCH) {
log_err( mtx("The group `%s' already exists, but has a different GID. Exiting."), $new_name );
exit( RET_WRONG_OBJECT_PROPERTIES );
}
if ($asgret & EXISTING_FOUND) {
- log_trace( "existing_found" );
- if ($asgret & (EXISTING_SYSTEM)) {
- log_info( mtx("The group `%s' already exists as a system group."), $new_name );
- exit( RET_OK );
- } else {
- log_err( mtx("The group `%s' already exists and is not a system group. Exiting."), $new_name );
- exit( RET_WRONG_OBJECT_PROPERTIES );
- }
+ log_info( mtx("The system group `%s' already exists. Exiting.\n"), $new_name );
+ exit( RET_OK );
}
if (defined($gid_option) && defined(getgrgid($gid_option))) {
log_fatal( mtx("The GID `%s' is already in use."), $gid_option );
@@ -565,11 +569,14 @@ if ($action eq 'addusertogroup') {
if ($action eq "addsysuser") {
acquire_lock();
- my $ret = existing_user_status($new_name, $new_uid);
- if (($ret & EXISTING_FOUND) && !($ret & EXISTING_SYSTEM)) {
+ log_trace( "addsysuser %s, uid %s", $new_name, $new_uid );
+ my $ret = existing_user_status(\%config, $new_name, $new_uid);
+ if ($ret & (EXISTING_FOUND)) {
# a user with this name already exists; it's a problem when it's not a system user
- log_fatal( mtx("The user `%s' already exists, but is not a system user. Exiting."), $new_name );
- exit( RET_WRONG_OBJECT_PROPERTIES );
+ if ( ($ret & EXISTING_SYSTEM) == 0 ) {
+ log_fatal( mtx("The user `%s' already exists, but is not a system user. Exiting."), $new_name );
+ exit( RET_WRONG_OBJECT_PROPERTIES );
+ }
}
if ($ret & EXISTING_ID_MISMATCH) {
log_fatal( mtx("The user `%s' already exists with a different UID. Exiting."), $new_name );
@@ -1138,66 +1145,6 @@ sub mktree {
return 1;
}
-# existing_user_status: check if there is already a user present
-# on the system which satisfies the requirements
-# parameter:
-# new_name: the name of the user to check
-# new_uid : the UID of the user
-# return value:
-# bitwise combination of these constants:
-# EXISTING_NOT_FOUND => 0
-# EXISTING_FOUND => 1
-# EXISTING_SYSTEM => 2
-# EXISTING_ID_MISMATCH => 4
-# EXISTING_LOCKED => 8
-# e.g. if the requested account name exists as a locked system user,
-# return 8|2|1 == 11
-sub existing_user_status {
- my ($new_name,$new_uid) = @_;
- my ($pw,$uid);
- my $ret = EXISTING_NOT_FOUND;
- log_trace( "existing_user_status called with new_name %s, new_uid %s", $new_name, $new_uid );
- if ((undef,$pw,$uid) = egetpwnam($new_name)) {
- log_trace("egetpwnam %s returned successfully, uid = %s", $new_name, $uid);
- $ret |= EXISTING_FOUND;
- $ret |= EXISTING_ID_MISMATCH if (defined($new_uid) && $uid != $new_uid);
- $ret |= EXISTING_SYSTEM if
- ($uid >= $config{"first_system_uid"} && $uid <= $config{"last_system_uid"});
- } elsif ($new_uid && getpwuid($new_uid)) {
- $ret |= EXISTING_ID_MISMATCH;
- }
- log_trace( "existing_user_status( %s, %s ) returns %s", $new_name, $new_uid, $ret );
- return $ret;
-}
-
-# existing_group_status: check if there is already a group which satisfies the requirements
-# parameter:
-# new_name: the name of the group
-# new_gid : the GID of the group
-# return value:
-# bitwise combination of these constants:
-# EXISTING_NOT_FOUND => 0
-# EXISTING_FOUND => 1
-# EXISTING_SYSTEM => 2
-# EXISTING_ID_MISMATCH => 4
-sub existing_group_status {
- my ($new_name,$new_gid) = @_;
- my $gid;
- my $ret = EXISTING_NOT_FOUND;
- log_trace( "existing_group_status called with new_name %s, new_gid %s", $new_name, $new_gid );
- if ((undef,undef,$gid) = egetgrnam($new_name)) {
- log_trace("egetgrnam %s returned successfully, gid = %s", $new_name, $gid);
- $ret |= EXISTING_FOUND;
- $ret |= EXISTING_ID_MISMATCH if (defined($new_gid) && $gid != $new_gid);
- $ret |= EXISTING_SYSTEM if
- ($gid >= $config{"first_system_gid"} && $gid <= $config{"last_system_gid"});
- } elsif ($new_gid && getgrgid($new_gid)) {
- $ret |= EXISTING_ID_MISMATCH;
- }
- log_trace( "existing_group_status( %s, %s ) returns %s", $new_name, $new_gid, $ret );
- return $ret;
-}
-
# check_user_group: ???
# parameters:
# system: 0 if the user is not a system user, 1 otherwise
@@ -1207,27 +1154,25 @@ sub existing_group_status {
sub check_user_group {
my ($system) = @_;
log_debug( "check_user_group %s called, make_group_also %s", $system, $make_group_also );
-
- my $ustat = existing_user_status($new_name, $new_uid);
- if ($system) {
- if (($ustat & EXISTING_FOUND) && !($ustat & EXISTING_SYSTEM)) {
- log_fatal( mtx("The user `%s' already exists, and is not a system user."), $new_name);
- exit( RET_WRONG_OBJECT_PROPERTIES );
+ if( !$system || !existing_user_status(\%config, $new_name, $new_uid) ) {
+ if( defined egetpwnam($new_name) ) {
+ if( $system ) {
+ log_fatal( mtx("The user `%s' already exists, and is not a system user."), $new_name);
+ exit( RET_WRONG_OBJECT_PROPERTIES );
+ } else {
+ log_fatal( mtx("The user `%s' already exists."), $new_name);
+ exit( RET_OBJECT_EXISTS );
+ }
}
- # if ($new_uid && !($ustat & EXISTING_SYSTEM)) {
- # log_fatal( mtx("The uid `%s' is invalid for system users."), $new_name);
- # exit( RET_OBJECT_EXISTS );
- # }
- } else {
- if ($ustat & EXISTING_FOUND) {
- log_fatal( mtx("The user `%s' already exists."), $new_name);
- exit( RET_OBJECT_EXISTS );
+ if (defined($new_uid) && getpwuid($new_uid)) {
+ log_fatal( mtx("The UID %d is already in use."), $new_uid);
+ exit( RET_ID_IN_USE );
}
}
if ($make_group_also) {
log_trace( "make_group_also 1, new_name %s, new_uid %s", $new_name, $new_uid );
- if( !$system || !existing_group_status($new_name, $new_uid) ) {
+ if( !$system || !existing_group_status(\%config, $new_name, $new_uid) ) {
if (defined egetgrnam($new_name)) {
log_fatal( mtx("The group `%s' already exists."),$new_name );
exit( RET_OBJECT_EXISTS );
=====================================
debian/README.source
=====================================
@@ -0,0 +1,19 @@
+This package is maintained in git on Salsa, using Otto Kekäläinen's
+documentation about how to maintain packages in git.
+
+Branch names follow DEP-14. gbp should be used to build the package.
+
+As a Debian native package, the conventional upstream branches are missing.
+Development takes place in debian/latest.
+
+Please do all development work in a branch, prefixed with your nickname and a
+slash. Please let Marc merge things into debian/latest. Preferably, use Gitlab
+merge requests. Keep your branch rebased on debian/latest so that a
+fast-forward merge is possible.
+
+$ git remote -v show
+origin git at salsa.debian.org:debian/adduser.git (fetch)
+origin git at salsa.debian.org:debian/adduser.git (push)
+
+Recommended Reading: https://optimizedbyotto.com/post/debian-packaging-from-git/
+(Otto Kekäläinen)
=====================================
debian/gbp.conf
=====================================
@@ -1,2 +1,15 @@
[DEFAULT]
-debian-branch=master
+# DEP-14 format. Other naming convention are available,
+# see DEP-14 for more details.
+debian-branch = debian/latest
+
+# Ensure a human always reviews all the debian/changelog entries.
+spawn-editor = always
+
+# No need to confirm package name or version at any time, git-buildpackage
+# always gets it right.
+interactive = False
+
+# Ensure we always target Debian on Debian branches.
+dch-opt = --vendor=debian
+
=====================================
debian/tests/f/adduser_system.t
=====================================
@@ -184,6 +184,7 @@ assert_user_exists('aust');
assert_user_is_system('aust');
system('echo "aust:*" | chpasswd --encrypted');
+ok(1, "set passwd to *");
assert_command_success(
'/usr/sbin/adduser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -195,6 +196,7 @@ assert_user_exists('aust');
assert_user_is_system('aust');
system('echo "aust:!foobar" | chpasswd --encrypted');
+ok(1, "set passwd to !foobar");
assert_command_success(
'/usr/sbin/adduser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -206,6 +208,7 @@ assert_user_exists('aust');
assert_user_is_system('aust');
system('echo "aust:*foobar" | chpasswd --encrypted');
+ok(1, "set passwd to *foobar");
assert_command_success(
'/usr/sbin/adduser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
=====================================
debian/tests/f/system_status.t
=====================================
@@ -56,6 +56,7 @@ my $name = "sys-stat-t";
# number existing before operation result existing after
# 11 nothing create system success system
+ok(1, "sys-stat-t 11");
assert_user_does_not_exist($name);
assert_command_success(
@@ -71,6 +72,7 @@ assert_user_is_system($name);
# 12 system create system success system
# above: assert_user_exists($name);
# above: assert_user_is_system($name);
+ok(1, "sys-stat-t 12");
assert_command_success(
'/usr/sbin/adduser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -84,6 +86,7 @@ assert_user_is_system($name);
# 13 system delete system success nothing
# above: assert_user_exists($name);
# above: assert_user_is_system($name);
+ok(1, "sys-stat-t 13");
assert_command_success(
'/usr/sbin/deluser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -95,6 +98,7 @@ assert_user_does_not_exist($name);
# number existing before operation result existing after
# 14 nothing delete system obj_not_ex nothing
# above: assert_user_does_not_exist($name);
+ok(1, "sys-stat-t 14");
assert_command_success(
'/usr/sbin/deluser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -106,6 +110,7 @@ assert_user_does_not_exist($name);
# number existing before operation result existing after
# 15 nothing delete nonsys obj_not_ex nothing
# above: assert_user_does_not_exist($name);
+ok(1, "sys-stat-t 15");
assert_command_result_silent(RET_OBJECT_DOES_NOT_EXIST,
'/usr/sbin/deluser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -117,6 +122,7 @@ assert_user_does_not_exist($name);
# 21 nothing create system success system
# above: assert_user_does_not_exist($name);
+ok(1, "sys-stat-t 21");
assert_command_success(
'/usr/sbin/adduser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -129,6 +135,7 @@ assert_user_is_system($name);
# number existing before operation result existing after
# 22 system create nonsys obj_exists system
# above: assert_user_is_system($name);
+ok(1, "sys-stat-t 22");
assert_command_result_silent(RET_OBJECT_EXISTS,
'/usr/sbin/adduser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -145,6 +152,7 @@ assert_user_is_system($name);
# in adduser 3.145, this succeeds!
# above: assert_user_is_system($name);
#assert_command_result_silent(RET_WRONG_OBJECT_PROPERTIES,
+ok(1, "sys-stat-t 23");
assert_command_success(
'/usr/sbin/deluser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -164,6 +172,7 @@ assert_user_is_system($name);
# number existing before operation result existing after
# 24 system delete system success nothing
# above: assert_user_is_system($name);
+ok(1, "sys-stat-t 24");
assert_command_success(
'/usr/sbin/deluser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -175,6 +184,7 @@ assert_user_does_not_exist($name);
# number existing before operation result existing after
# 31 nothing create nonsys success nonsys
# above: assert_user__does_not_exist($name);
+ok(1, "sys-stat-t 31");
assert_command_success(
'/usr/sbin/adduser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -190,6 +200,7 @@ assert_user_is_non_system($name);
# 32 nonsys create nonsys obj_exists nonsys
# above: assert_user_exists($name);
# above: assert_user_is_non_system($name);
+ok(1, "sys-stat-t 32");
assert_command_result_silent(RET_OBJECT_EXISTS,
'/usr/sbin/adduser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -205,6 +216,7 @@ assert_user_is_non_system($name);
# 33 nonsys delete sys wrong_prop nonsys
# above: assert_user_exists($name);
# above: assert_user_is_non_system($name);
+ok(1, "sys-stat-t 33");
assert_command_result_silent(RET_WRONG_OBJECT_PROPERTIES,
'/usr/sbin/deluser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -218,6 +230,7 @@ assert_user_is_non_system($name);
# 34 nonsys create sys wrong_prop nonsys
# above: assert_user_exists($name);
# above: assert_user_is_non_system($name);
+ok(1, "sys-stat-t 34a");
assert_command_result_silent(RET_WRONG_OBJECT_PROPERTIES,
'/usr/sbin/adduser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -231,6 +244,7 @@ assert_user_is_non_system($name);
# 35 nonsys delete nonsys success nothing
# above: assert_user_exists($name);
# above: assert_user_is_non_system($name);
+ok(1, "sys-stat-t 35");
assert_command_success(
'/usr/sbin/deluser',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -243,6 +257,7 @@ assert_user_does_not_exist($name);
# number existing before operation result existing after
# 11 nothing create system success system
+ok(1, "sys-stat-t 11");
assert_group_does_not_exist($name);
assert_command_success(
@@ -258,6 +273,7 @@ assert_group_is_system($name);
# 12 system create system success system
# above: assert_group_exists($name);
# above: assert_group_is_system($name);
+ok(1, "sys-stat-t 12");
assert_command_success(
'/usr/sbin/addgroup',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -271,6 +287,7 @@ assert_group_is_system($name);
# 13 system delete system success nothing
# above: assert_group_exists($name);
# above: assert_group_is_system($name);
+ok(1, "sys-stat-t 13");
assert_command_success(
'/usr/sbin/delgroup',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -282,6 +299,7 @@ assert_group_does_not_exist($name);
# number existing before operation result existing after
# 14 nothing delete system obj_not_ex nothing
# above: assert_group_does_not_exist($name);
+ok(1, "sys-stat-t 14");
assert_command_success(
'/usr/sbin/delgroup',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -293,6 +311,7 @@ assert_group_does_not_exist($name);
# number existing before operation result existing after
# 15 nothing delete nonsys obj_not_ex nothing
# above: assert_group_does_not_exist($name);
+ok(1, "sys-stat-t 15");
assert_command_result_silent(RET_OBJECT_DOES_NOT_EXIST,
'/usr/sbin/delgroup',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -304,6 +323,7 @@ assert_group_does_not_exist($name);
# 21 nothing create system success system
# above: assert_group_does_not_exist($name);
+ok(1, "sys-stat-t 21");
assert_command_success(
'/usr/sbin/addgroup',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -316,6 +336,7 @@ assert_group_is_system($name);
# number existing before operation result existing after
# 22 system create nonsys obj_exists system
# above: assert_group_is_system($name);
+ok(1, "sys-stat-t 22");
assert_command_result_silent(RET_OBJECT_EXISTS,
'/usr/sbin/addgroup',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -332,6 +353,7 @@ assert_group_is_system($name);
# in addgroup 3.145, this succeeds!
# above: assert_group_is_system($name);
#assert_command_result_silent(RET_WRONG_OBJECT_PROPERTIES,
+ok(1, "sys-stat-t 23");
assert_command_success(
'/usr/sbin/delgroup',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -351,6 +373,7 @@ assert_group_is_system($name);
# number existing before operation result existing after
# 24 system delete system success nothing
# above: assert_group_is_system($name);
+ok(1, "sys-stat-t 24");
assert_command_success(
'/usr/sbin/delgroup',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -362,6 +385,7 @@ assert_group_does_not_exist($name);
# number existing before operation result existing after
# 31 nothing create nonsys success nonsys
# above: assert_group__does_not_exist($name);
+ok(1, "sys-stat-t 31");
assert_command_success(
'/usr/sbin/addgroup',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -377,6 +401,7 @@ assert_group_is_non_system($name);
# 32 nonsys create nonsys obj_exists nonsys
# above: assert_group_exists($name);
# above: assert_group_is_non_system($name);
+ok(1, "sys-stat-t 32");
assert_command_result_silent(RET_OBJECT_EXISTS,
'/usr/sbin/addgroup',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -392,6 +417,7 @@ assert_group_is_non_system($name);
# 33 nonsys delete sys wrong_prop nonsys
# above: assert_group_exists($name);
# above: assert_group_is_non_system($name);
+ok(1, "sys-stat-t 33");
assert_command_result_silent(RET_WRONG_OBJECT_PROPERTIES,
'/usr/sbin/delgroup',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -405,6 +431,7 @@ assert_group_is_non_system($name);
# 34 nonsys create sys wrong_prop nonsys
# above: assert_group_exists($name);
# above: assert_group_is_non_system($name);
+ok(1, "sys-stat-t 34b");
assert_command_result_silent(RET_WRONG_OBJECT_PROPERTIES,
'/usr/sbin/addgroup',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -418,6 +445,7 @@ assert_group_is_non_system($name);
# 35 nonsys delete nonsys success nothing
# above: assert_group_exists($name);
# above: assert_group_is_non_system($name);
+ok(1, "sys-stat-t 35");
assert_command_success(
'/usr/sbin/delgroup',
'--stdoutmsglevel=error', '--stderrmsglevel=error',
=====================================
testsuite/test9.pl
=====================================
@@ -56,7 +56,7 @@ if ($error ne 13) {
print "failed\n $cmd returned an errorcode != 13 ($error)\n";
exit $error;
}
-if ($output !~ /^err: The group `addusertest\d+' already exists and is not a system group. Exiting.$/ ) {
+if ($output !~ /^fatal: The group `addusertest\d+' already exists, but is not a system group. Exiting.$/ ) {
print "failed\n $cmd returned unexpected output ($output)\n";
exit 1;
}
View it on GitLab: https://salsa.debian.org/debian/adduser/-/compare/f51785b74718d5e097d915c5bab052342ad6f339...7f4621727de84b0a14e9448ee0aa835232c2b016
--
View it on GitLab: https://salsa.debian.org/debian/adduser/-/compare/f51785b74718d5e097d915c5bab052342ad6f339...7f4621727de84b0a14e9448ee0aa835232c2b016
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-shadow-devel/attachments/20250914/57de5925/attachment-0001.htm>
More information about the Pkg-shadow-devel
mailing list