svn commit: trunk/busybox/libbb
pgf at busybox.net
pgf at busybox.net
Thu Nov 8 01:12:39 UTC 2007
Author: pgf
Date: 2007-11-07 17:12:38 -0800 (Wed, 07 Nov 2007)
New Revision: 20383
Log:
follow symlinks to find the true passwd file before updating.
Modified:
trunk/busybox/libbb/update_passwd.c
Changeset:
Modified: trunk/busybox/libbb/update_passwd.c
===================================================================
--- trunk/busybox/libbb/update_passwd.c 2007-11-08 01:11:41 UTC (rev 20382)
+++ trunk/busybox/libbb/update_passwd.c 2007-11-08 01:12:38 UTC (rev 20383)
@@ -52,6 +52,10 @@
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 @@
free_mem:
free(fnamesfx);
- free((char*)username);
+ free((char *)filename);
+ free((char *)username);
return ret;
}
More information about the busybox-cvs
mailing list