aboutsummaryrefslogtreecommitdiffstats
path: root/src/ChangeLog
diff options
context:
space:
mode:
authorPaul Eggert2013-03-05 14:35:41 -0800
committerPaul Eggert2013-03-05 14:35:41 -0800
commit707431575aef93ac3e9923d450a6cbf18192c933 (patch)
treec81ecb9af767baaea6876c956b6fc921ebb6ac9e /src/ChangeLog
parent05e193f1706f5d9846530e734d0271b15b9a818c (diff)
downloademacs-707431575aef93ac3e9923d450a6cbf18192c933.tar.gz
emacs-707431575aef93ac3e9923d450a6cbf18192c933.zip
FILE's lock is now always .#FILE and may be a regular file.
* etc/NEWS: Document this. * nt/inc/unistd.h (O_NOFOLLOW): New macro. * src/filelock.c: Include <c-ctype.h>. (MAX_LFINFO): New top-level constant. (lock_info_type): Remove members pid, boot_time. Add members at, dot, colon. Change user member to be the entire buffer, not a pointer. This allows us to handle the case where a foreign pid or boot time exceeds the local range. All uses changed. (LINKS_MIGHT_NOT_WORK): New constant. (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing. (defined_WINDOWSNT): Remove. (MAKE_LOCK_NAME, file_in_lock_file_name): Always use .#FILE (not .#-FILE) for the file lock, even if it is a regular file. (rename_lock_file): New function. (create_lock_file): Use it. (create_lock_file, read_lock_data): Prefer a symbolic link for the lock file, falling back on a regular file if symlinks don't work. Do not try to create symlinks on MS-Windows, due to security hassles. Stick with POSIXish functions (open, read, write, close, fchmod, readlink, symlink, link, rename, unlink, mkstemp) when creating locks, as a GNUish host may be using a Windowsish file system, and cannot use MS-Windows-only system calls. Fall back on mktemp if mkstemp doesn't work. Don't fail merely because of a symlink-contents length limit in the current file system; fall back on regular files. Increase the symlink contents length limit to 8 KiB, this should be big enough for any real use and doesn't crunch the stack. (create_lock_file, lock_file_1, read_lock_data): Simplify allocation of lock file buffers now that they fit in 8 KiB. (lock_file_1): Return error number, not bool. All callers changed. (ELOOP): New macro, if not already defined. (read_lock_data): Return size of lock file contents, not Lisp object. All callers changed. Handle a race condition if some other process replaces a regular-file lock with a symlink lock or vice versa, while we're trying to read the lock. (current_lock_owner): Parse contents more carefully, to help avoid confusing a regular-file lock with some other application's use of the file. Check for lock file contents being too long, or not parsing correctly. (current_lock_owner, lock_file): Allow foreign pid and boot times that exceed the local range. (current_lock_owner, lock_if_free, lock_file): Simplify allocation of lock file contents. * src/w32.c (sys_rename_replace): New function, containing most of the contents of the old sys_rename. (sys_rename): Use it. (fchmod): New dummy function. * src/w32.h (sys_rename_replace, fchmod): New decls. Fixes: debbugs:13807
Diffstat (limited to 'src/ChangeLog')
-rw-r--r--src/ChangeLog52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c4b4703e59d..af03fa54291 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,55 @@
12013-03-05 Paul Eggert <eggert@cs.ucla.edu>
2
3 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
4 * filelock.c: Include <c-ctype.h>.
5 (MAX_LFINFO): New top-level constant.
6 (lock_info_type): Remove members pid, boot_time. Add members at,
7 dot, colon. Change user member to be the entire buffer, not a
8 pointer. This allows us to handle the case where a foreign
9 pid or boot time exceeds the local range. All uses changed.
10 (LINKS_MIGHT_NOT_WORK): New constant.
11 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
12 (defined_WINDOWSNT): Remove.
13 (MAKE_LOCK_NAME, file_in_lock_file_name):
14 Always use .#FILE (not .#-FILE) for the file lock,
15 even if it is a regular file.
16 (rename_lock_file): New function.
17 (create_lock_file): Use it.
18 (create_lock_file, read_lock_data):
19 Prefer a symbolic link for the lock file, falling back on a
20 regular file if symlinks don't work. Do not try to create
21 symlinks on MS-Windows, due to security hassles. Stick with
22 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
23 link, rename, unlink, mkstemp) when creating locks, as a GNUish
24 host may be using a Windowsish file system, and cannot use
25 MS-Windows-only system calls. Fall back on mktemp if mkstemp
26 doesn't work. Don't fail merely because of a symlink-contents
27 length limit in the current file system; fall back on regular
28 files. Increase the symlink contents length limit to 8 KiB, this
29 should be big enough for any real use and doesn't crunch the
30 stack.
31 (create_lock_file, lock_file_1, read_lock_data):
32 Simplify allocation of lock file buffers now that they fit in 8 KiB.
33 (lock_file_1): Return error number, not bool. All callers changed.
34 (ELOOP): New macro, if not already defined.
35 (read_lock_data): Return size of lock file contents, not Lisp object.
36 All callers changed. Handle a race condition if some other process
37 replaces a regular-file lock with a symlink lock or vice versa,
38 while we're trying to read the lock.
39 (current_lock_owner): Parse contents more carefully, to help avoid
40 confusing a regular-file lock with some other application's use
41 of the file. Check for lock file contents being too long, or
42 not parsing correctly.
43 (current_lock_owner, lock_file):
44 Allow foreign pid and boot times that exceed the local range.
45 (current_lock_owner, lock_if_free, lock_file):
46 Simplify allocation of lock file contents.
47 * w32.c (sys_rename_replace): New function, containing most of
48 the contents of the old sys_rename.
49 (sys_rename): Use it.
50 (fchmod): New dummy function.
51 * w32.h (sys_rename_replace, fchmod): New decls.
52
12013-03-05 Eli Zaretskii <eliz@gnu.org> 532013-03-05 Eli Zaretskii <eliz@gnu.org>
2 54
3 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or 55 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or