Changeset 341bd65 for unix.c


Ignore:
Timestamp:
2022-09-07T14:51:33Z (2 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
30491ca
Parents:
e9eee04
git-author:
Johannes Segitz <jsegitz@…> (16-12-21 16:12:11)
git-committer:
Jelmer Vernooij <jelmer@…> (07-09-22 14:51:33)
Message:

Make sure startup fails if privileges should be dropped to a given user
and something goes wrong

File:
1 edited

Legend:

Unmodified
Added
Removed
  • unix.c

    re9eee04 r341bd65  
    159159                if (!pw) {
    160160                        log_message(LOGLVL_ERROR, "Failed to look up user %s.", global.conf->user);
     161                        return(1);
    161162
    162163                } else if (initgroups(global.conf->user, pw->pw_gid) != 0) {
    163164                        log_message(LOGLVL_ERROR, "initgroups: %s.", strerror(errno));
     165                        return(1);
    164166
    165167                } else if (setgid(pw->pw_gid) != 0) {
    166168                        log_message(LOGLVL_ERROR, "setgid(%d): %s.", pw->pw_gid, strerror(errno));
     169                        return(1);
    167170
    168171                } else if (setuid(pw->pw_uid) != 0) {
    169172                        log_message(LOGLVL_ERROR, "setuid(%d): %s.", pw->pw_uid, strerror(errno));
     173                        return(1);
    170174                }
    171175        }
Note: See TracChangeset for help on using the changeset viewer.