[chrony-dev] create_dir in util.c - permissions

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


Something I noticed when enabling a non-privileged user after having previously been running chronyd as root.

If a directory already exists, create_dir just returns

    if (S_ISDIR(buf.st_mode))
      return 1;
    LOG(LOGS_ERR, LOGF_Util, "%s is not directory", p);
    return 0;


I think there should be a call to chown(p, uid, gid) before the return. 

Not sure what to do with any existing directory contents. Maybe they should also be chown() 'd.

Or maybe the system administrator should be doing all this manually. :)

--
Bryan
--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/