diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 13 | ||||
| -rw-r--r-- | src/callint.c | 2 | ||||
| -rw-r--r-- | src/filelock.c | 14 | ||||
| -rw-r--r-- | src/lisp.h | 3 | ||||
| -rw-r--r-- | src/macros.c | 2 |
5 files changed, 26 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5e3112a26af..4135dadf28a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2013-02-27 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with | ||
| 4 | _SH_DENYRW flag, instead of emacs_open, to deny any other process | ||
| 5 | access to the lock file until it is written and closed. | ||
| 6 | (Bug#13807) | ||
| 7 | |||
| 8 | 2013-02-27 Paul Eggert <eggert@cs.ucla.edu> | ||
| 9 | |||
| 10 | * callint.c (Qcall_interactively): | ||
| 11 | * macros.c (Qexecute_kbd_macro): | ||
| 12 | Now static. | ||
| 13 | |||
| 1 | 2013-02-26 Bastien Guerry <bzg@gnu.org> | 14 | 2013-02-26 Bastien Guerry <bzg@gnu.org> |
| 2 | 15 | ||
| 3 | * window.c (Frecenter): Tiny docstring enhancement. | 16 | * window.c (Frecenter): Tiny docstring enhancement. |
diff --git a/src/callint.c b/src/callint.c index b0d4bcdd011..212dd2e3d62 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -29,7 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 29 | #include "keymap.h" | 29 | #include "keymap.h" |
| 30 | 30 | ||
| 31 | Lisp_Object Qminus, Qplus; | 31 | Lisp_Object Qminus, Qplus; |
| 32 | Lisp_Object Qcall_interactively; | 32 | static Lisp_Object Qcall_interactively; |
| 33 | static Lisp_Object Qcommand_debug_status; | 33 | static Lisp_Object Qcommand_debug_status; |
| 34 | static Lisp_Object Qenable_recursive_minibuffers; | 34 | static Lisp_Object Qenable_recursive_minibuffers; |
| 35 | 35 | ||
diff --git a/src/filelock.c b/src/filelock.c index 4d556de2454..78cd60a12e1 100644 --- a/src/filelock.c +++ b/src/filelock.c | |||
| @@ -44,6 +44,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 44 | #include "coding.h" | 44 | #include "coding.h" |
| 45 | #include "systime.h" | 45 | #include "systime.h" |
| 46 | #ifdef WINDOWSNT | 46 | #ifdef WINDOWSNT |
| 47 | #include <share.h> | ||
| 47 | #include "w32.h" /* for dostounix_filename */ | 48 | #include "w32.h" /* for dostounix_filename */ |
| 48 | #endif | 49 | #endif |
| 49 | 50 | ||
| @@ -353,12 +354,17 @@ create_lock_file (char *lfname, char *lock_info_str, bool force) | |||
| 353 | create a regular file with the lock info written as its | 354 | create a regular file with the lock info written as its |
| 354 | contents. */ | 355 | contents. */ |
| 355 | { | 356 | { |
| 356 | int fd = emacs_open (lfname, O_WRONLY | O_BINARY | O_CREAT | O_EXCL, | 357 | /* Deny everybody else any kind of access to the file until we are |
| 357 | S_IREAD | S_IWRITE); | 358 | done writing it and close the handle. This makes the entire |
| 359 | open/write/close operation atomic, as far as other processes | ||
| 360 | are concerned. */ | ||
| 361 | int fd = _sopen (lfname, | ||
| 362 | _O_WRONLY | _O_BINARY | _O_CREAT | _O_EXCL | _O_NOINHERIT, | ||
| 363 | _SH_DENYRW, S_IREAD | S_IWRITE); | ||
| 358 | 364 | ||
| 359 | if (fd < 0 && errno == EEXIST && force) | 365 | if (fd < 0 && errno == EEXIST && force) |
| 360 | fd = emacs_open (lfname, O_WRONLY | O_BINARY | O_TRUNC, | 366 | fd = _sopen (lfname, _O_WRONLY | _O_BINARY | _O_TRUNC |_O_NOINHERIT, |
| 361 | S_IREAD | S_IWRITE); | 367 | _SH_DENYRW, S_IREAD | S_IWRITE); |
| 362 | if (fd >= 0) | 368 | if (fd >= 0) |
| 363 | { | 369 | { |
| 364 | ssize_t lock_info_len = strlen (lock_info_str); | 370 | ssize_t lock_info_len = strlen (lock_info_str); |
diff --git a/src/lisp.h b/src/lisp.h index 7b36878c0c5..3d018b2b45e 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3371,7 +3371,7 @@ extern void syms_of_minibuf (void); | |||
| 3371 | 3371 | ||
| 3372 | extern Lisp_Object Qminus, Qplus; | 3372 | extern Lisp_Object Qminus, Qplus; |
| 3373 | extern Lisp_Object Qwhen; | 3373 | extern Lisp_Object Qwhen; |
| 3374 | extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook; | 3374 | extern Lisp_Object Qmouse_leave_buffer_hook; |
| 3375 | extern void syms_of_callint (void); | 3375 | extern void syms_of_callint (void); |
| 3376 | 3376 | ||
| 3377 | /* Defined in casefiddle.c. */ | 3377 | /* Defined in casefiddle.c. */ |
| @@ -3532,7 +3532,6 @@ extern Lisp_Object exec_byte_code (Lisp_Object, Lisp_Object, Lisp_Object, | |||
| 3532 | Lisp_Object, ptrdiff_t, Lisp_Object *); | 3532 | Lisp_Object, ptrdiff_t, Lisp_Object *); |
| 3533 | 3533 | ||
| 3534 | /* Defined in macros.c. */ | 3534 | /* Defined in macros.c. */ |
| 3535 | extern Lisp_Object Qexecute_kbd_macro; | ||
| 3536 | extern void init_macros (void); | 3535 | extern void init_macros (void); |
| 3537 | extern void syms_of_macros (void); | 3536 | extern void syms_of_macros (void); |
| 3538 | 3537 | ||
diff --git a/src/macros.c b/src/macros.c index 0dcfbe5532c..48d23a977b1 100644 --- a/src/macros.c +++ b/src/macros.c | |||
| @@ -28,7 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 28 | #include "window.h" | 28 | #include "window.h" |
| 29 | #include "keyboard.h" | 29 | #include "keyboard.h" |
| 30 | 30 | ||
| 31 | Lisp_Object Qexecute_kbd_macro; | 31 | static Lisp_Object Qexecute_kbd_macro; |
| 32 | static Lisp_Object Qkbd_macro_termination_hook; | 32 | static Lisp_Object Qkbd_macro_termination_hook; |
| 33 | 33 | ||
| 34 | /* Number of successful iterations so far | 34 | /* Number of successful iterations so far |