← Commit list

53bd4015a

Paul Fox
Paul Fox
2007-11-08
FAILED Duration: 12s

Subject

follow symlinks to find the true passwd file before updating.

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/update_passwd.c+6 -1
@@ -52,6 +52,10 @@ int update_passwd(const char *filename, const char *username,
int cnt = 0;
int ret = -1; /* failure */
+ filename = xmalloc_readlink_follow(filename);
+ if (filename == NULL)
+ return -1;
+
check_selinux_update_passwd(username);
/* New passwd file, "/etc/passwd+" for now */
@@ -143,6 +147,7 @@ int update_passwd(const char *filename, const char *username,
free_mem:
free(fnamesfx);
- free((char*)username);
+ free((char *)filename);
+ free((char *)username);
return ret;
}