New submission from Abhishek <abmsh...@in.ibm.com>:
If root user is part of a linux group, then in the response of getgrnam() & grp.getgrid(), in te gr_mem part, root user is not listed. [root@biplab2 ~]# getent group | grep starwars starwars:x:1011:root,abhi [root@biplab2 ~]# python3 Python 3.6.8 (default, Dec 5 2019, 16:11:43) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux >>> import grp >>> grp.getgrnam('starwars') grp.struct_group(gr_name='starwars', gr_passwd='x', gr_gid=1011, gr_mem=['abhi']) >>> grp.getgrgid(1011) grp.struct_group(gr_name='starwars', gr_passwd='x', gr_gid=1011, gr_mem=['abhi']) But, when grp.getgrall() is run, we the correct response (gr_mem includes root user as well) >>> grp.getgrall() grp.struct_group(gr_name='starwars', gr_passwd='x', gr_gid=1011, gr_mem=['root', 'abhi'])] ---------- messages: 363113 nosy: abhi.sharma priority: normal severity: normal status: open title: grp library functions grp.getgrnam() & grp.getgrgid() returning incorrect gr_mem information type: behavior versions: Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39821> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com