mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Use snprintf(3) instead of strcpy(3) + strncat(3)
This commit is contained in:
parent
a8e37ee0ac
commit
0602630cc7
1 changed files with 1 additions and 2 deletions
|
|
@ -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…
Reference in a new issue