Skip to content

Commit

Permalink
Add privilege qcert for accessing certificates by qmaild, qmailr (#44)
Browse files Browse the repository at this point in the history
* Add privilege qcert for accessing certificates by qmaild, qmailr

01. cleanq.c, qhpsi.c, qscanq.c: renamed auto_uidc, auto_gidc to auto_uidv, auto_gidv
02. dknewkey.sh: use qcerts group for certificate group permission
03. get_uid.c: added qcerts group ID for certificate group permissionA
04. get_uid.c: renamed auto_uidv, auto_gidv to auto_uidi, auto_gidi
05. get_uid.c: added auto_gidc for qcerts group ID
06. indimail-mta.spec: added group ID qcerts for certificate group permissions.
08. perm_list.in: updated group ownership of certs, domainkeys directory to
    qcerts
08. qlocal_upgrade.in: add group ID qcerts
09. qlocal_upgrade.in: updated group id of certs to qcerts
10. qlocal_upgrade.in: added qcerts as supplementary group for qmaild, qmailr
    and apache
11. qmail-poppass.c, sql-database.c: renamed auto_uidv to auto_uidi, auto_gidv
    to auto_gidi
12. qmail-showctl.c: renamed auto_uidv to auto_uidi, auto_uidc to auto_uidv,
    auto_gidv to auto_gidi
13. qmail-showctl.c: added auto_uidc for qcerts group ID
14. qmail-sql.c: renamed auto_uidv, auto_gidv to auto_uidi, auto_gidi
15. smtpd.c: fix dossl function - return on error
16. svctool.in: use tcpserver -u qmaild for running qmail-smtpd for qcerts
    supplememtary group
17. svctool.in: create qcerts group ID and added qcerts as supplementary group
    for qmailr, qmaild, apache
18. svctool.in: create certs with root:qcerts owner:group
19. update_tmprsadh: create rsa/dh parameter files with root:qcerts
    owner:group
20. debian/indimail-mta.postinst.in: added --setgroups to set USE_SETGROUPS
    env variable for qmail-start

* added --setgroups to set USE_SETGROUPS env variable for qmail-start

* added --setgroups to set USE_SETGROUPS env variable for qmail-start
  • Loading branch information
mbhangui committed Feb 14, 2023
1 parent f18da5f commit 0b01b7f
Show file tree
Hide file tree
Showing 24 changed files with 315 additions and 119 deletions.
4 changes: 2 additions & 2 deletions indimail-mta-x/DIRS.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ d:::0755:@prefix@/lib/indimail/plugins::
d:root:qmail:02755:@qsysconfdir@::
d:root:qmail:02775:@qsysconfdir@/control::
d:indimail:qmail:02775:@qsysconfdir@/control/cache::
d:root:qmail:02755:@qsysconfdir@/control/domainkeys::
d:root:qcerts:02755:@qsysconfdir@/control/domainkeys::
d:qmailr:qmail:02775:@qsysconfdir@/control/ratelimit::
d:root:qmail:0755:@qsysconfdir@/control/defaultqueue::
d:root:qmail:02775:@qsysconfdir@/users::
d:root:qmail:02775:@qsysconfdir@/certs::
d:root:qcerts:02775:@qsysconfdir@/certs::
d:root:qmail:02775:@qsysconfdir@/tcp::
d:root:root:0755:@qsysconfdir@/perms.d::
d:root:root:0755:@qsysconfdir@/perms.d/indimail-mta::
61 changes: 32 additions & 29 deletions indimail-mta-x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,36 +223,38 @@ auto_uids.h: conf-users conf-groups
echo ""; \
echo "#include <sys/types.h>"; \
echo ""; \
echo "#define ALIASU \"`head -1 conf-users | tail -1`\""; \
echo "#define QMAILD \"`head -2 conf-users | tail -1`\""; \
echo "#define QMAILL \"`head -3 conf-users | tail -1`\""; \
echo "#define ROOTUSER \"`head -4 conf-users | tail -1`\""; \
echo "#define QMAILP \"`head -5 conf-users | tail -1`\""; \
echo "#define QMAILQ \"`head -6 conf-users | tail -1`\""; \
echo "#define QMAILR \"`head -7 conf-users | tail -1`\""; \
echo "#define QMAILS \"`head -8 conf-users | tail -1`\""; \
echo "#define INDIUSER \"`head -9 conf-users | tail -1`\""; \
echo "#define ALIASU \"`head -1 conf-users | tail -1`\""; \
echo "#define QMAILD \"`head -2 conf-users | tail -1`\""; \
echo "#define QMAILL \"`head -3 conf-users | tail -1`\""; \
echo "#define ROOTUSER \"`head -4 conf-users | tail -1`\""; \
echo "#define QMAILP \"`head -5 conf-users | tail -1`\""; \
echo "#define QMAILQ \"`head -6 conf-users | tail -1`\""; \
echo "#define QMAILR \"`head -7 conf-users | tail -1`\""; \
echo "#define QMAILS \"`head -8 conf-users | tail -1`\""; \
echo "#define INDIUSER \"`head -9 conf-users | tail -1`\""; \
echo "#define QSCANDU \"`head -10 conf-users | tail -1`\""; \
echo "#define QMAILG \"`head -1 conf-groups | tail -1`\""; \
echo "#define NOFILESG \"`head -2 conf-groups | tail -1`\""; \
echo "#define INDIGROUP \"`head -3 conf-groups | tail -1`\""; \
echo "#define QSCANDG \"`head -4 conf-groups | tail -1`\""; \
echo "#define QCERTSG \"`head -5 conf-groups | tail -1`\""; \
echo ""; \
echo "extern int auto_uida;" ;\
echo "extern int auto_uidd;" ;\
echo "extern int auto_uidl;" ;\
echo "extern int auto_uido;" ;\
echo "extern int auto_uidp;" ;\
echo "extern int auto_uidq;" ;\
echo "extern int auto_uidr;" ;\
echo "extern int auto_uids;" ;\
echo "extern int auto_uidv;" ;\
echo "extern int auto_uidc;" ;\
echo "extern int auto_uida; /* alias user */" ;\
echo "extern int auto_uidd; /* qmail daemon user */" ;\
echo "extern int auto_uidl; /* qmail log user */" ;\
echo "extern int auto_uido; /* root user */" ;\
echo "extern int auto_uidp; /* password access user */" ;\
echo "extern int auto_uidq; /* qmail queue user */" ;\
echo "extern int auto_uidr; /* qmail remote user */" ;\
echo "extern int auto_uids; /* qmail send user */" ;\
echo "extern int auto_uidi; /* indimail user */" ;\
echo "extern int auto_uidv; /* virus scan user */" ;\
echo ""; \
echo "extern int auto_gidq;" ;\
echo "extern int auto_gidn;" ;\
echo "extern int auto_gidv;" ;\
echo "extern int auto_gidc;" ;\
echo "extern int auto_gidq; /* qmail group */" ;\
echo "extern int auto_gidn; /* nofiles gorup */" ;\
echo "extern int auto_gidi; /* indimail user */" ;\
echo "extern int auto_gidv; /* virus scan group */" ;\
echo "extern int auto_gidc; /* certs access user */" ;\
echo ""; \
echo "int uidinit(int, int);"; \
echo "char *get_user(uid_t);"; \
Expand All @@ -262,20 +264,21 @@ auto_uids.h: conf-users conf-groups
) > auto_uids.h

auto_uids.c: auto-uid auto-gid conf-users conf-groups
(./auto-uid auto_uidv `head -9 conf-users | tail -1` \
&& ./auto-uid auto_uida `head -1 conf-users` \
( ./auto-uid auto_uida `head -1 conf-users` \
&&./auto-uid auto_uidd `head -2 conf-users | tail -1` \
&&./auto-uid auto_uidl `head -3 conf-users | tail -1` \
&&./auto-uid auto_uido `head -4 conf-users | tail -1` \
&&./auto-uid auto_uidp `head -5 conf-users | tail -1` \
&&./auto-uid auto_uidq `head -6 conf-users | tail -1` \
&&./auto-uid auto_uidr `head -7 conf-users | tail -1` \
&&./auto-uid auto_uids `head -8 conf-users | tail -1` \
&&./auto-uid auto_uidc `head -10 conf-users | tail -1` \
&&./auto-uid auto_uido `head -4 conf-users | tail -1` \
&&./auto-gid auto_gidv `head -3 conf-groups | tail -1` \
&&./auto-uid auto_uidi `head -9 conf-users | tail -1` \
&&./auto-uid auto_uidv `head -10 conf-users | tail -1` \
&&./auto-gid auto_gidq `head -1 conf-groups` \
&&./auto-gid auto_gidn `head -2 conf-groups | tail -1` \
&&./auto-gid auto_gidc `head -4 conf-groups | tail -1` \
&&./auto-gid auto_gidi `head -3 conf-groups | tail -1` \
&&./auto-gid auto_gidv `head -4 conf-groups | tail -1` \
&&./auto-gid auto_gidc `head -5 conf-groups | tail -1` \
) > auto_uids.c.tmp && mv auto_uids.c.tmp auto_uids.c

auto_uids.o: compile auto_uids.c
Expand Down
9 changes: 6 additions & 3 deletions indimail-mta-x/cleanq.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: cleanq.c,v $
* Revision 1.13 2023-02-14 07:45:58+05:30 Cprogrammer
* renamed auto_uidc, auto_gidc to auto_uidv, auto_gidv
*
* Revision 1.12 2021-08-29 23:27:08+05:30 Cprogrammer
* define functions as noreturn
*
Expand Down Expand Up @@ -231,7 +234,7 @@ main(int argc, char **argv)
if (optind + 1 == argc && chdir(argv[optind++]) == -1)
strerr_die3sys(111, FATAL, "chdir: ", argv[optind]);
uid = getuid();
if (uid != auto_uidc && setreuid(auto_uidc, auto_uidc))
if (uid != auto_uidv && setreuid(auto_uidv, auto_uidv))
strerr_die2sys(111, FATAL, "setreuid failed: ");
if ((fdsourcedir = open(".", O_RDONLY | O_NDELAY)) == -1)
strerr_die2sys(111, FATAL, "unable to open current directory: ");
Expand All @@ -246,7 +249,7 @@ main(int argc, char **argv)
_exit(111);
if (stat(".", &st) == -1)
strerr_die2sys(111, FATAL, "unable to stat '.'");
if (st.st_uid != auto_uidc) {
if (st.st_uid != auto_uidv) {
strerr_warn2(FATAL, "current directory not owned by qscand", 0);
_exit(111);
}
Expand Down Expand Up @@ -274,7 +277,7 @@ main(int argc, char **argv)
void
getversion_cleanq_c()
{
static char *x = "$Id: cleanq.c,v 1.12 2021-08-29 23:27:08+05:30 Cprogrammer Exp mbhangui $";
static char *x = "$Id: cleanq.c,v 1.13 2023-02-14 07:45:58+05:30 Cprogrammer Exp mbhangui $";

x++;
}
8 changes: 5 additions & 3 deletions indimail-mta-x/conf-groups
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ qmail
nofiles
indimail
qscand
qcerts

These are the qmail groups. The second group should not have access to
any files, but it must be usable for processes; this requirement
excludes the ``nogroup'' and ``nobody'' groups on many systems.
These are the qmail,indimail groups. The second group should not
have access to any files, but it must be usable for processes;
this requirements excludes the ``nogroup'' and ``nobody''
groups on many systems.
2 changes: 1 addition & 1 deletion indimail-mta-x/conf-users
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ qscand
The qmail system is heavily partitioned for security; it does almost
nothing as root.

The first nine lines of this file are the alias user, the daemon user,
The first ten lines of this file are the alias user, the daemon user,
the log user, the owner of miscellaneous files such as binaries, the
passwd user, the queue user, the remote user, the send user, the
indimail user and the virus scan user.
9 changes: 6 additions & 3 deletions indimail-mta-x/create_services.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cp=$(which cp)
# End USER Configuration OPTIONS
#

# $Id: create_services.in,v 2.117 2022-11-07 20:45:29+05:30 Cprogrammer Exp mbhangui $
# $Id: create_services.in,v 2.118 2023-02-14 17:58:06+05:30 Cprogrammer Exp mbhangui $

usage()
{
Expand Down Expand Up @@ -453,7 +453,7 @@ do
e_opt="--remote-authsmtp=plain --localfilter --remotefilter"
e_opt="$e_opt --deliverylimit-count=-1 --deliverylimit-size=-1"
e_opt="$e_opt --rbl=-rzen.spamhaus.org --rbl=-rdnsbl-1.uceprotect.net"
e_opt="$e_opt --dmemory=$send_soft_mem --utf8"
e_opt="$e_opt --dmemory=$send_soft_mem --setgroups --utf8"
fi
if [ $tcpserver_plugin -eq 1 ] ; then
e_opt="$e_opt --shared-objects=1 --use-dlmopen=1"
Expand Down Expand Up @@ -498,7 +498,7 @@ eval $svctool --slowq --servicedir=$servicedir --qbase=$qbase \
--dmemory=$send_soft_mem --min-free=52428800 --dkverify=$ver_opt \
--dksign=$sign_opt --private_key=$controldir/domainkeys/%/$dkimkeyfn \
--remote-authsmtp=plain --localfilter --remotefilter \
--deliverylimit-count="-1" --deliverylimit-size="-1" --utf8
--deliverylimit-count="-1" --deliverylimit-size="-1" --setgroups --utf8
#
# Greylist
#
Expand Down Expand Up @@ -758,6 +758,9 @@ fi

#
# $Log: create_services.in,v $
# Revision 2.118 2023-02-14 17:58:06+05:30 Cprogrammer
# added --setgroups to set USE_SETGROUPS env variable for qmail-start
#
# Revision 2.117 2022-11-07 20:45:29+05:30 Cprogrammer
# removed domainkeys for new installs
#
Expand Down
4 changes: 2 additions & 2 deletions indimail-mta-x/debian/indimail-mta.postinst.in
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ do
extra_opt="--remote-authsmtp=login --localfilter --remotefilter"
extra_opt="$extra_opt --deliverylimit-count=-1 --deliverylimit-size=-1"
extra_opt="$extra_opt --rbl=-rzen.spamhaus.org --rbl=-rdnsbl-1.uceprotect.net"
extra_opt="$extra_opt --dmemory=$send_soft_mem --utf8"
extra_opt="$extra_opt --dmemory=$send_soft_mem --setgroups --utf8"
fi
if [ $tcpserver_plugin -eq 1 ] ; then
extra_opt="$extra_opt --shared-objects=1 --use-dlmopen=1"
Expand Down Expand Up @@ -350,7 +350,7 @@ eval ${prefix}/sbin/svctool --slowq --servicedir=${servicedir} --qbase=${qbase}
--dmemory=${send_soft_mem} --min-free=52428800 --dkverify=${ver_opt} \
--dksign=${sign_opt} --private_key=${qsysconfdir}/control/domainkeys/%/${dkimkeyfn} \
--remote-authsmtp=login --localfilter --remotefilter \
--deliverylimit-count="-1" --deliverylimit-size="-1" --utf8
--deliverylimit-count="-1" --deliverylimit-size="-1" --setgroups --utf8

#odmr
${prefix}/sbin/svctool --smtp=366 --odmr --servicedir=${servicedir} \
Expand Down
5 changes: 3 additions & 2 deletions indimail-mta-x/debian/indimail-mta.preinst.in
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ case "$1" in
/usr/bin/getent group nofiles > /dev/null || /usr/sbin/groupadd nofiles || true
/usr/bin/getent group qmail > /dev/null || /usr/sbin/groupadd qmail || true
/usr/bin/getent group qscand > /dev/null || /usr/sbin/groupadd qscand || true
/usr/bin/getent group qcerts > /dev/null || /usr/sbin/groupadd qcerts || true

for i in indimail alias qmaild qmaill qmailp qmailq qmailr qmails qscand
do
Expand All @@ -100,11 +101,11 @@ case "$1" in
/usr/sbin/useradd -r -g indimail -u 555 -d ${qmaildir} indimail || \
test $? = 4 && /usr/sbin/useradd -r -g indimail -d ${qmaildir} indimail || true
/usr/bin/getent passwd alias > /dev/null || /usr/sbin/useradd -M -g nofiles -d ${qmaildir}/alias -s /sbin/nologin alias || true
/usr/bin/getent passwd qmaild > /dev/null || /usr/sbin/useradd -M -g nofiles -d ${qmaildir} -s /sbin/nologin qmaild || true
/usr/bin/getent passwd qmaild > /dev/null || /usr/sbin/useradd -M -g nofiles -d ${qmaildir} -s /sbin/nologin qmaild -G qcerts || true
/usr/bin/getent passwd qmaill > /dev/null || /usr/sbin/useradd -M -g nofiles -d ${logdir} -s /sbin/nologin qmaill || true
/usr/bin/getent passwd qmailp > /dev/null || /usr/sbin/useradd -M -g nofiles -d ${qmaildir} -s /sbin/nologin qmailp || true
/usr/bin/getent passwd qmailq > /dev/null || /usr/sbin/useradd -M -g qmail -d ${qmaildir} -s /sbin/nologin qmailq || true
/usr/bin/getent passwd qmailr > /dev/null || /usr/sbin/useradd -M -g qmail -d ${qmaildir} -s /sbin/nologin qmailr || true
/usr/bin/getent passwd qmailr > /dev/null || /usr/sbin/useradd -M -g qmail -d ${qmaildir} -s /sbin/nologin qmailr -G qcerts || true
/usr/bin/getent passwd qmails > /dev/null || /usr/sbin/useradd -M -g qmail -d ${qmaildir} -s /sbin/nologin qmails || true
/usr/bin/getent passwd qscand > /dev/null || /usr/sbin/useradd -M -g qscand -d ${qmaildir}/qscanq -G qmail,qscand -s /sbin/nologin qscand || true
if [ $nscd_up -ge 1 ] ; then
Expand Down
11 changes: 8 additions & 3 deletions indimail-mta-x/dknewkey.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# $Id: dknewkey.sh,v 1.17 2023-02-11 23:01:57+05:30 Cprogrammer Exp mbhangui $
# $Id: dknewkey.sh,v 1.18 2023-02-14 07:48:10+05:30 Cprogrammer Exp mbhangui $
#

usage()
Expand Down Expand Up @@ -125,6 +125,8 @@ force=0
bits=2048
ktype="rsa"
domain=""
cert_user="root"
cert_group="qcerts"
eval set -- "$options"
while :; do
case "$1" in
Expand Down Expand Up @@ -218,7 +220,7 @@ else
selector=$(basename $selector)
fi
if [ ! -d $dir ] ; then
if (! mkdir -p $dir || ! chown root:qmail $dir || ! chmod 755 $dir) ; then
if (! mkdir -p $dir || ! chown $cert_user:$cert_group $dir || ! chmod 755 $dir) ; then
exit 1
fi
fi
Expand Down Expand Up @@ -272,7 +274,7 @@ else
fi

exec 2>&3 # restore stderr
if ( ! chown root:qmail $selector $selector.pub || ! chmod 640 $selector || ! chmod 644 $selector.pub) ; then
if ( ! chown $cert_user:$cert_group $selector $selector.pub || ! chmod 640 $selector || ! chmod 644 $selector.pub) ; then
exit 1
fi
print_key "$domain" "$selector"
Expand All @@ -281,6 +283,9 @@ exit 0

#
# $Log: dknewkey.sh,v $
# Revision 1.18 2023-02-14 07:48:10+05:30 Cprogrammer
# use qcerts group for certificate group permission
#
# Revision 1.17 2023-02-11 23:01:57+05:30 Cprogrammer
# generate ed25519 public key without ASN.1 structure (skip first 12 bytes)
#
Expand Down
30 changes: 30 additions & 0 deletions indimail-mta-x/doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,36 @@ multi-signature generation
signature verification status on fd 2
- 13/02/2022
21. removed yahoo domainkeys
- 14/02/2022
22. cleanq.c, qhpsi.c, qscanq.c: renamed auto_uidc, auto_gidc to auto_uidv, auto_gidv
23. dknewkey.sh: use qcerts group for certificate group permission
24. get_uid.c: added qcerts group ID for certificate group permissionA
25. get_uid.c: renamed auto_uidv, auto_gidv to auto_uidi, auto_gidi
26. get_uid.c: added auto_gidc for qcerts group ID
27. indimail-mta.spec: added group ID qcerts for certificate group permissions.
28. perm_list.in: updated group ownership of certs, domainkeys directory to
qcerts
29. qlocal_upgrade.in: add group ID qcerts
30. qlocal_upgrade.in: updated group id of certs to qcerts
31. qlocal_upgrade.in: added qcerts as supplementary group for qmaild, qmailr
and apache
32. qmail-poppass.c, sql-database.c: renamed auto_uidv to auto_uidi, auto_gidv
to auto_gidi
33. qmail-showctl.c: renamed auto_uidv to auto_uidi, auto_uidc to auto_uidv,
auto_gidv to auto_gidi
34. qmail-showctl.c: added auto_uidc for qcerts group ID
35. qmail-sql.c: renamed auto_uidv, auto_gidv to auto_uidi, auto_gidi
36. smtpd.c: fix dossl function - return on error
37. svctool.in: use tcpserver -u qmaild for running qmail-smtpd for qcerts
supplememtary group
38. svctool.in: create qcerts group ID and added qcerts as supplementary group
for qmailr, qmaild, apache
39. svctool.in: create certs with root:qcerts owner:group
40. update_tmprsadh: create rsa/dh parameter files with root:qcerts
owner:group
41. create_services.in, svctool.in, indimail-mta.spec.in,
debian/indimail-mta.postinst.in: added --setgroups to set USE_SETGROUPS
env variable for qmail-start

* Mon Jan 30 2023 13:14:56 +0000 Manvendra Bhangui <indimail-mta@indimail.org> 3.0.2-1.1%{?dist}
Release 3.0.2-1.1 Start 08/09/2022 End 30/11/2023
Expand Down
28 changes: 18 additions & 10 deletions indimail-mta-x/get_uid.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
/*
* $Log: get_uid.c,v $
* Revision 1.5 2023-02-14 07:49:06+05:30 Cprogrammer
* added qcerts group ID for certificate group permission
* renamed auto_uidc, auto_gidc to auto_uidv, auto_gidv
* renamed auto_uidv, auto_gidv to auto_uidi, auto_gidi
* added auto_gidc for qcerts group ID
*
* Revision 1.4 2022-03-09 13:03:12+05:30 Cprogrammer
* use qendpwent(), qendgrent() when using functions from qgetpwgr.c
*
Expand Down Expand Up @@ -57,7 +63,7 @@ UIDARRAY uid_a[] = {{ALIASU,-1,-1}, {QMAILD,-1,-1}, {QMAILL,-1,-1},
{QMAILR,-1,-1}, {QMAILS,-1,-1}, {INDIUSER,-1,-1},
{QSCANDU,-1,-1}, {0}};
GIDARRAY gid_a[] = {{QMAILG,-1,-1}, {NOFILESG,-1,-1},
{INDIGROUP,-1,-1}, {QSCANDG,-1,-1}, {0}};
{INDIGROUP,-1,-1}, {QSCANDG,-1,-1}, {QCERTSG, -1, -1}, {0}};

static int
get_uid(char *user, int exit_on_error)
Expand Down Expand Up @@ -160,12 +166,13 @@ uidinit(int closeflag, int exit_on_error)
DO_UID(auto_uidq, u, QMAILQ, exit_on_error, not_found);
DO_UID(auto_uidr, u, QMAILR, exit_on_error, not_found);
DO_UID(auto_uids, u, QMAILS, exit_on_error, not_found);
DO_UID(auto_uidv, u, INDIUSER, exit_on_error, not_found);
DO_UID(auto_uidc, u, QSCANDU, exit_on_error, not_found);
DO_UID(auto_uidi, u, INDIUSER, exit_on_error, not_found);
DO_UID(auto_uidv, u, QSCANDU, exit_on_error, not_found);
DO_GID(auto_gidq, g, QMAILG, exit_on_error, not_found);
DO_GID(auto_gidn, g, NOFILESG, exit_on_error, not_found);
DO_GID(auto_gidv, g, INDIGROUP, exit_on_error, not_found);
DO_GID(auto_gidc, g, QSCANDG, exit_on_error, not_found);
DO_GID(auto_gidi, g, INDIGROUP, exit_on_error, not_found);
DO_GID(auto_gidv, g, QSCANDG, exit_on_error, not_found);
DO_GID(auto_gidc, g, QCERTSG, exit_on_error, not_found);
if (closeflag) {
use_pwgr ? qendpwent() : endpwent();
use_pwgr ? qendgrent() : endgrent();
Expand Down Expand Up @@ -201,8 +208,8 @@ get_user(uid_t uid)
GET_USER(uid, auto_uidq, QMAILQ);
GET_USER(uid, auto_uidr, QMAILR);
GET_USER(uid, auto_uids, QMAILS);
GET_USER(uid, auto_uidv, INDIUSER);
GET_USER(uid, auto_uidc, QSCANDU);
GET_USER(uid, auto_uidi, INDIUSER);
GET_USER(uid, auto_uidv, QSCANDU);
if (!(pw = (use_pwgr ? qgetpwuid : getpwuid) (uid))) {
strnum[fmt_ulong(strnum, uid)] = 0;
strerr_die3sys(111, "get_user: unable to get uid for uid ", strnum, ": ");
Expand All @@ -219,8 +226,9 @@ get_group(gid_t gid)
return ((char *) 0);
GET_GROUP(gid, auto_gidq, QMAILG);
GET_GROUP(gid, auto_gidn, NOFILESG);
GET_GROUP(gid, auto_gidv, INDIGROUP);
GET_GROUP(gid, auto_gidc, QSCANDG);
GET_GROUP(gid, auto_gidi, INDIGROUP);
GET_GROUP(gid, auto_gidv, QSCANDG);
GET_GROUP(gid, auto_gidc, QCERTSG);
GET_GROUP(gid, 0, "root");
if (!(gr = (use_pwgr ? qgetgrgid : getgrgid) (gid))) {
strnum[fmt_ulong(strnum, gid)] = 0;
Expand All @@ -232,7 +240,7 @@ get_group(gid_t gid)
void
getversion_get_uid_c()
{
static char *x = "$Id: get_uid.c,v 1.4 2022-03-09 13:03:12+05:30 Cprogrammer Exp mbhangui $";
static char *x = "$Id: get_uid.c,v 1.5 2023-02-14 07:49:06+05:30 Cprogrammer Exp mbhangui $";

x++;
}
Loading

0 comments on commit 0b01b7f

Please sign in to comment.