diff options
author | Felix Fietkau <nbd@openwrt.org> | 2005-03-23 14:31:49 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2005-03-23 14:31:49 +0000 |
commit | 588c9392dbe4c60177d6f46e862e52dc460de8f1 (patch) | |
tree | 1f269bb092e4e365b281a6c797282015b191313c /package/busybox | |
parent | c9683fd58bb06068eca0de690460018a2b0c6583 (diff) | |
download | master-187ad058-588c9392dbe4c60177d6f46e862e52dc460de8f1.tar.gz master-187ad058-588c9392dbe4c60177d6f46e862e52dc460de8f1.tar.bz2 master-187ad058-588c9392dbe4c60177d6f46e862e52dc460de8f1.zip |
make busybox passwd work when /etc/passwd is a symlink to /rom
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@431 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/busybox')
-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); |