Bug 8445 - [Anolis 23][23.1核心软件包-libuser]组内有用户时,lgroupdel删除组成功后luserdel -r删除用户时主目录和邮件目录资源残留
Summary: [Anolis 23][23.1核心软件包-libuser]组内有用户时,lgroupdel删除组成功后luserdel -r删除用户时主目录和邮件目录资源残留
Status: RESOLVED WONTFIX
Alias: None
Product: Anolis OS 23
Classification: Anolis OS
Component: BaseOS Packages (show other bugs) BaseOS Packages
Version: 23.1
Hardware: x86_64 Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: gaochang
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-06 11:59 UTC by wangyaru01
Modified: 2024-05-22 11:18 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wangyaru01 2024-03-06 11:59:11 UTC
[问题描述]:
Anolis23环境,在组内有用户的情况下,lgroupdel删除组时,组删除成功,然后luserdel -r删除用户及相关资源时,此时报错“No group with GID 1000 exists, not removing“,/etc/passwd下用户信息是能删除成功的,但像主目录之类的资源是残留


[环境信息]:
机器类型:ECS

[内核信息]:
[root@qibo-anolis23-nightly-func-arm-1 ~]# uname -r
5.10.134-15.an23.x86_64

[操作系统信息]:
[root@qibo-anolis23-nightly-func-arm-1 ~]# cat /etc/os-release
NNAME="Anolis OS"
VERSION="23"
ID="anolis"
VERSION_ID="23"
PLATFORM_ID="platform:an23"
PRETTY_NAME="Anolis OS 23"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"
BUG_REPORT_URL="https://bugzilla.openanolis.cn/"

[重现步骤]:
脚本内容:cat user.sh 

lgroupadd group1
getent group group1
luseradd -g group1 test00001
groups test00001
id  test00001

echo "删除用户组group1"
lgroupdel group1
groups test00001
echo "删除用户组后查看相关信息:/etc/group |grep group1、/etc/passwd |grep test00001"
cat /etc/group |grep group1
cat /etc/passwd |grep test00001
echo "==========================="

echo "删除用户"
luserdel -r test00001
echo "删除用户后查看相关资源"
cat /etc/passwd |grep test00001
ls -la /home/test00001
ls -la /var/mail/test00001

执行结果
[root@iZbp13y8smi7y3i45cd2gvZ tests]# bash user.sh 
group1:x:1000:
test00001 : group1
uid=1000(test00001) gid=1000(group1) groups=1000(group1)
删除用户组group1
test00001 : groups: cannot find name for group ID 1000
1000
删除用户组后查看相关信息:/etc/group |grep group1、/etc/passwd |grep test00001
test00001:x:1000:1000:test00001:/home/test00001:/bin/bash
===========================
删除用户
No group with GID 1000 exists, not removing.
删除用户后查看相关资源
total 12
drwx------. 2 1000 1000  62 Aug 16  2023 .
drwxr-xr-x. 3 root root  23 Mar  6 11:51 ..
-rw-r--r--. 1 1000 1000  18 Dec 15  2022 .bash_logout
-rw-r--r--. 1 1000 1000 141 Dec 15  2022 .bash_profile
-rw-r--r--. 1 1000 1000 492 Dec 15  2022 .bashrc
-rw-rw----. 1 1000 mail 0 Mar  6 11:51 /var/mail/test00001

[问题发生概率]:必现
Comment 2 Banana alibaba_cloud_group 2024-05-22 11:18:06 UTC
不修复,关闭问题单