Changeset 1dd3554 in code


Ignore:
Timestamp:
Mar 5, 2014, 5:39:17 PM (11 years ago)
Author:
Mike Belopuhov <mike@…>
Branches:
master
Children:
b28dd0e
Parents:
4e66b3a
git-author:
Mike Belopuhov <mike@…> (03/05/14 17:38:50)
git-committer:
Mike Belopuhov <mike@…> (03/05/14 17:39:17)
Message:

Chroot the logger process into the icbd user home directory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • logger.c

    r4e66b3a r1dd3554  
    9898                exit(EX_NOPERM);
    9999
     100        if (chroot(pw->pw_dir) < 0) {
     101                syslog(LOG_ERR, "%s: %m", pw->pw_dir);
     102                exit(EX_UNAVAILABLE);
     103        }
     104
    100105        if (setuid(pw->pw_uid) < 0) {
    101106                syslog(LOG_ERR, "%d: %m", pw->pw_uid);
     
    103108        }
    104109
    105         if (chdir(pw->pw_dir) < 0) {
     110        if (chdir("/") < 0) {
    106111                syslog(LOG_ERR, "chdir: %m");
    107112                exit(EX_UNAVAILABLE);
Note: See TracChangeset for help on using the changeset viewer.