diff options
author | Felix Fietkau <nbd@openwrt.org> | 2006-10-13 22:51:49 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-03-20 17:29:15 +0100 |
commit | 60c1f0f64d23003a19a07d6b9638542130f6641d (patch) | |
tree | 8fb2787f4c49baded97cd55e0c371fe1cffce2b6 /package/busybox/patches/140-unlink-passwd.patch | |
parent | d58a09110ccfa95f06c983fe796806f2e035c9d2 (diff) | |
parent | b3ce218b51746d3a576221ea542facf3a1703ab2 (diff) | |
download | upstream-60c1f0f64d23003a19a07d6b9638542130f6641d.tar.gz upstream-60c1f0f64d23003a19a07d6b9638542130f6641d.tar.bz2 upstream-60c1f0f64d23003a19a07d6b9638542130f6641d.zip |
finally move buildroot-ng to trunk
Diffstat (limited to 'package/busybox/patches/140-unlink-passwd.patch')
-rw-r--r-- | package/busybox/patches/140-unlink-passwd.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/package/busybox/patches/140-unlink-passwd.patch b/package/busybox/patches/140-unlink-passwd.patch new file mode 100644 index 0000000000..07b6767e6e --- /dev/null +++ b/package/busybox/patches/140-unlink-passwd.patch @@ -0,0 +1,32 @@ +--- busybox-1.00.old/loginutils/passwd.c 2004-09-15 04:39:09.000000000 +0200 ++++ busybox-1.00/loginutils/passwd.c 2005-03-23 15:31:07.000000000 +0100 +@@ -54,11 +54,12 @@ + snprintf(filename, sizeof filename, "%s", bb_path_passwd_file); + } + +- if (((fp = fopen(filename, "r+")) == 0) || (fstat(fileno(fp), &sb))) { ++ if (((fp = fopen(filename, "r")) == 0) || (fstat(fileno(fp), &sb))) { + /* return 0; */ + return 1; + } + ++#if 0 + /* Lock the password file before updating */ + lock.l_type = F_WRLCK; + lock.l_whence = SEEK_SET; +@@ -69,6 +70,7 @@ + return 1; + } + lock.l_type = F_UNLCK; ++#endif + + snprintf(buf, sizeof buf, "%s-", filename); + if (create_backup(buf, fp)) { +@@ -119,6 +121,7 @@ + fclose(fp); + return 1; + } ++ unlink(filename); + if (rename(buf, filename) < 0) { + fcntl(fileno(fp), F_SETLK, &lock); + fclose(fp); |