projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
459a2ba
)
follow symlinks to find the true passwd file before updating.
author
Paul Fox
<pgf@brightstareng.com>
Thu, 8 Nov 2007 01:12:38 +0000
(
01:12
-0000)
committer
Paul Fox
<pgf@brightstareng.com>
Thu, 8 Nov 2007 01:12:38 +0000
(
01:12
-0000)
libbb/update_passwd.c
patch
|
blob
|
history
diff --git
a/libbb/update_passwd.c
b/libbb/update_passwd.c
index 388adf81fb7cc9cb33d9ebdfdcf7514c2ed24e63..e99db40c04b9b470c3005e6d7df679249d4f0088 100644
(file)
--- a/
libbb/update_passwd.c
+++ b/
libbb/update_passwd.c
@@
-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;
}