Use snprintf(3) instead of strcpy(3) + strncat(3)
This commit is contained in:
parent
a8e37ee0ac
commit
0602630cc7
@ -185,8 +185,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
|
||||
* But we create a symlink from cnf->home -> "/usr" -> cnf->home
|
||||
*/
|
||||
if (strchr(cnf->home+1, '/') == NULL) {
|
||||
strcpy(dbuf, "/usr");
|
||||
strncat(dbuf, cnf->home, MAXPATHLEN-5);
|
||||
snprintf(dbuf, MAXPATHLEN, "/usr%s", cnf->home);
|
||||
if (mkdir(dbuf, _DEF_DIRMODE) != -1 || errno == EEXIST) {
|
||||
chown(dbuf, 0, 0);
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user