#
# Module for simulation of utility "getent group -s sss" from coreutils
#
# Copyright (c) 2016 Red Hat, Inc.
#
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 only
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
("gr_passwd", c_char_p),
("gr_gid", c_int),
"""
ctypes wrapper for:
enum nss_status _nss_sss_getgrnam_r(const char *name,
struct group *result,
char *buffer,
size_t buflen,
int *errnop)
"""
"""
ctypes wrapper for:
enum nss_status _nss_sss_getgrgid_r(gid_t gid,
struct passwd *result,
char *buffer,
size_t buflen,
int *errnop)
"""
return dict()
group_dict = dict()
i = 0
i = i+1
return group_dict
"""
A Python wrapper to retrieve a group by name. Returns:
(res, group_dict)
if res is NssReturnCode.SUCCESS, then group_dict contains the keys
corresponding to the C passwd structure fields. Otherwise, the dictionary
is empty and errno indicates the error code
"""
if errno != 0:
return res, group_dict
"""
A Python wrapper to retrieve a group by GID. Returns:
(res, group_dict)
if res is NssReturnCode.SUCCESS, then group_dict contains the keys
corresponding to the C passwd structure fields. Otherwise, the dictionary
is empty and errno indicates the error code
"""
if errno != 0:
return res, group_dict