diff options
| author | Tom Tromey | 2013-03-17 05:17:24 -0600 |
|---|---|---|
| committer | Tom Tromey | 2013-03-17 05:17:24 -0600 |
| commit | 6bd488cd8d05aa3983ca55f70ee384732d8c0085 (patch) | |
| tree | 5645fc7b882638d6c0eb3f61fd55bde1a63fc190 /lib-src | |
| parent | 71f91792e3013b397996905224f387da5cc539a9 (diff) | |
| parent | 9c44569ea2a18099307e0571d523d8637000a153 (diff) | |
| download | emacs-6bd488cd8d05aa3983ca55f70ee384732d8c0085.tar.gz emacs-6bd488cd8d05aa3983ca55f70ee384732d8c0085.zip | |
merge from trunk
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 33 | ||||
| -rw-r--r-- | lib-src/Makefile.in | 4 | ||||
| -rw-r--r-- | lib-src/emacsclient.c | 6 | ||||
| -rw-r--r-- | lib-src/etags.c | 5 | ||||
| -rw-r--r-- | lib-src/movemail.c | 27 | ||||
| -rw-r--r-- | lib-src/pop.c | 2 |
6 files changed, 48 insertions, 29 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 81876d86165..0d7a0a4591e 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,34 @@ | |||
| 1 | 2013-03-16 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * pop.c: Fix ERRMAX typo (Bug#13925). | ||
| 4 | (socket_connection) [!HAVE_KRB5_ERROR_TEXT && HAVE_KRB5_ERROR_E_TEXT]: | ||
| 5 | Use ERROR_MAX, not ERRMAX. | ||
| 6 | |||
| 7 | 2013-03-16 Glenn Morris <rgm@gnu.org> | ||
| 8 | |||
| 9 | * Version 24.3 released. | ||
| 10 | |||
| 11 | 2013-03-13 Paul Eggert <eggert@cs.ucla.edu> | ||
| 12 | |||
| 13 | File synchronization fixes (Bug#13944). | ||
| 14 | * Makefile.in (LIB_FDATASYNC): New macro. | ||
| 15 | (emacsclient${EXEEXT}): Use it. | ||
| 16 | * emacsclient.c (main): Use fdatasync, not fsync, since we don't | ||
| 17 | care about metadata. Keep trying if interrupted. | ||
| 18 | * movemail.c (main, popmail): Don't worry about BSD_SYSTEM, since | ||
| 19 | fsync is available everywhere (or there is a substitute). | ||
| 20 | Don't report an error if fsync returns EINVAL. | ||
| 21 | |||
| 22 | Static checking by Sun C 5.12. | ||
| 23 | * etags.c (analyse_regex): Omit unreachable code. | ||
| 24 | |||
| 25 | * movemail.c (main): Call umask on all systems. | ||
| 26 | This is OK since Emacs already assumes umask elsewhere. | ||
| 27 | Don't grant more read permissions than necessary. | ||
| 28 | The old 0333 dates back to before we called setuid, | ||
| 29 | so it was needed back then to ensure user-readability, | ||
| 30 | but 0377 should suffice now. | ||
| 31 | |||
| 1 | 2013-02-08 Paul Eggert <eggert@cs.ucla.edu> | 32 | 2013-02-08 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 33 | ||
| 3 | * movemail.c (getenv): Remove decl (unused since 1994). | 34 | * movemail.c (getenv): Remove decl (unused since 1994). |
| @@ -5161,7 +5192,7 @@ | |||
| 5161 | (longopts): New long options without short counterpart are | 5192 | (longopts): New long options without short counterpart are |
| 5162 | globals, members, no-globals, no-members. Regexp options are now | 5193 | globals, members, no-globals, no-members. Regexp options are now |
| 5163 | defined conditionally to ETAGS_REGEXPS. | 5194 | defined conditionally to ETAGS_REGEXPS. |
| 5164 | (print_help): Updated. | 5195 | (print_help): Update. |
| 5165 | 5196 | ||
| 5166 | 1997-05-22 Francesco Potortì <F.Potorti@cnuce.cnr.it> | 5197 | 1997-05-22 Francesco Potortì <F.Potorti@cnuce.cnr.it> |
| 5167 | 5198 | ||
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index 8a6960ee2fe..7069af9767a 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in | |||
| @@ -161,6 +161,8 @@ LIBRESOLV=@LIBRESOLV@ | |||
| 161 | LIBS_MAIL=@LIBS_MAIL@ | 161 | LIBS_MAIL=@LIBS_MAIL@ |
| 162 | ## empty or -lrt or -lposix4 if HAVE_CLOCK_GETTIME | 162 | ## empty or -lrt or -lposix4 if HAVE_CLOCK_GETTIME |
| 163 | LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ | 163 | LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ |
| 164 | ## empty or -lrt or -lposix4 if HAVE_FDATASYNC | ||
| 165 | LIB_FDATASYNC = @LIB_FDATASYNC@ | ||
| 164 | 166 | ||
| 165 | ## Extra libraries to use when linking movemail. | 167 | ## Extra libraries to use when linking movemail. |
| 166 | LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \ | 168 | LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \ |
| @@ -334,7 +336,7 @@ pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h $(config_h) | |||
| 334 | emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(config_h) | 336 | emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(config_h) |
| 335 | $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \ | 337 | $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \ |
| 336 | -DVERSION="\"${version}\"" \ | 338 | -DVERSION="\"${version}\"" \ |
| 337 | $(LOADLIBES) -o emacsclient | 339 | $(LOADLIBES) $(LIB_FDATASYNC) -o emacsclient |
| 338 | 340 | ||
| 339 | hexl${EXEEXT}: ${srcdir}/hexl.c $(config_h) | 341 | hexl${EXEEXT}: ${srcdir}/hexl.c $(config_h) |
| 340 | $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl | 342 | $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl |
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 6feaf18ba60..898e8d69b07 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -1724,7 +1724,8 @@ main (int argc, char **argv) | |||
| 1724 | needlf = 2; | 1724 | needlf = 2; |
| 1725 | } | 1725 | } |
| 1726 | fflush (stdout); | 1726 | fflush (stdout); |
| 1727 | fsync (1); | 1727 | while (fdatasync (1) != 0 && errno == EINTR) |
| 1728 | continue; | ||
| 1728 | 1729 | ||
| 1729 | /* Now, wait for an answer and print any messages. */ | 1730 | /* Now, wait for an answer and print any messages. */ |
| 1730 | while (exit_status == EXIT_SUCCESS) | 1731 | while (exit_status == EXIT_SUCCESS) |
| @@ -1825,7 +1826,8 @@ main (int argc, char **argv) | |||
| 1825 | if (needlf) | 1826 | if (needlf) |
| 1826 | printf ("\n"); | 1827 | printf ("\n"); |
| 1827 | fflush (stdout); | 1828 | fflush (stdout); |
| 1828 | fsync (1); | 1829 | while (fdatasync (1) != 0 && errno == EINTR) |
| 1830 | continue; | ||
| 1829 | 1831 | ||
| 1830 | if (rl < 0) | 1832 | if (rl < 0) |
| 1831 | exit_status = EXIT_FAILURE; | 1833 | exit_status = EXIT_FAILURE; |
diff --git a/lib-src/etags.c b/lib-src/etags.c index c1e12e95da4..27a853a954a 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -5628,10 +5628,7 @@ analyse_regex (char *regex_arg) | |||
| 5628 | /* regexfile is a file containing regexps, one per line. */ | 5628 | /* regexfile is a file containing regexps, one per line. */ |
| 5629 | regexfp = fopen (regexfile, "r"); | 5629 | regexfp = fopen (regexfile, "r"); |
| 5630 | if (regexfp == NULL) | 5630 | if (regexfp == NULL) |
| 5631 | { | 5631 | pfatal (regexfile); |
| 5632 | pfatal (regexfile); | ||
| 5633 | return; | ||
| 5634 | } | ||
| 5635 | linebuffer_init (®exbuf); | 5632 | linebuffer_init (®exbuf); |
| 5636 | while (readline_internal (®exbuf, regexfp) > 0) | 5633 | while (readline_internal (®exbuf, regexfp) > 0) |
| 5637 | analyse_regex (regexbuf.buffer); | 5634 | analyse_regex (regexbuf.buffer); |
diff --git a/lib-src/movemail.c b/lib-src/movemail.c index cf93fb78d98..81ac8aa187c 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c | |||
| @@ -380,13 +380,9 @@ main (int argc, char **argv) | |||
| 380 | if (indesc < 0) | 380 | if (indesc < 0) |
| 381 | pfatal_with_name (inname); | 381 | pfatal_with_name (inname); |
| 382 | 382 | ||
| 383 | #ifdef BSD_SYSTEM | 383 | /* Make sure the user can read the output file. */ |
| 384 | /* In case movemail is setuid to root, make sure the user can | 384 | umask (umask (0) & 0377); |
| 385 | read the output file. */ | 385 | |
| 386 | /* This is desirable for all systems | ||
| 387 | but I don't want to assume all have the umask system call */ | ||
| 388 | umask (umask (0) & 0333); | ||
| 389 | #endif /* BSD_SYSTEM */ | ||
| 390 | outdesc = open (outname, O_WRONLY | O_CREAT | O_EXCL, 0666); | 386 | outdesc = open (outname, O_WRONLY | O_CREAT | O_EXCL, 0666); |
| 391 | if (outdesc < 0) | 387 | if (outdesc < 0) |
| 392 | pfatal_with_name (outname); | 388 | pfatal_with_name (outname); |
| @@ -470,10 +466,8 @@ main (int argc, char **argv) | |||
| 470 | } | 466 | } |
| 471 | } | 467 | } |
| 472 | 468 | ||
| 473 | #ifdef BSD_SYSTEM | 469 | if (fsync (outdesc) != 0 && errno != EINVAL) |
| 474 | if (fsync (outdesc) < 0) | ||
| 475 | pfatal_and_delete (outname); | 470 | pfatal_and_delete (outname); |
| 476 | #endif | ||
| 477 | 471 | ||
| 478 | /* Prevent symlink attacks truncating other users' mailboxes */ | 472 | /* Prevent symlink attacks truncating other users' mailboxes */ |
| 479 | if (setregid (-1, real_gid) < 0) | 473 | if (setregid (-1, real_gid) < 0) |
| @@ -754,21 +748,14 @@ popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse | |||
| 754 | } | 748 | } |
| 755 | } | 749 | } |
| 756 | 750 | ||
| 757 | /* On AFS, a call to write only modifies the file in the local | 751 | if (fsync (mbfi) != 0 && errno != EINVAL) |
| 758 | * workstation's AFS cache. The changes are not written to the server | ||
| 759 | * until a call to fsync or close is made. Users with AFS home | ||
| 760 | * directories have lost mail when over quota because these checks were | ||
| 761 | * not made in previous versions of movemail. */ | ||
| 762 | |||
| 763 | #ifdef BSD_SYSTEM | ||
| 764 | if (fsync (mbfi) < 0) | ||
| 765 | { | 752 | { |
| 766 | error ("Error in fsync: %s", strerror (errno), 0); | 753 | error ("Error in fsync: %s", strerror (errno), 0); |
| 754 | close (mbfi); | ||
| 767 | return EXIT_FAILURE; | 755 | return EXIT_FAILURE; |
| 768 | } | 756 | } |
| 769 | #endif | ||
| 770 | 757 | ||
| 771 | if (close (mbfi) == -1) | 758 | if (close (mbfi) != 0) |
| 772 | { | 759 | { |
| 773 | error ("Error in close: %s", strerror (errno), 0); | 760 | error ("Error in close: %s", strerror (errno), 0); |
| 774 | return EXIT_FAILURE; | 761 | return EXIT_FAILURE; |
diff --git a/lib-src/pop.c b/lib-src/pop.c index ba384db3d19..1f3f82baa68 100644 --- a/lib-src/pop.c +++ b/lib-src/pop.c | |||
| @@ -1198,7 +1198,7 @@ socket_connection (char *host, int flags) | |||
| 1198 | } | 1198 | } |
| 1199 | #elif defined HAVE_KRB5_ERROR_E_TEXT | 1199 | #elif defined HAVE_KRB5_ERROR_E_TEXT |
| 1200 | if (err_ret && err_ret->e_text && **err_ret->e_text) | 1200 | if (err_ret && err_ret->e_text && **err_ret->e_text) |
| 1201 | snprintf (pop_error + pop_error_len, ERRMAX - pop_error_len, | 1201 | snprintf (pop_error + pop_error_len, ERROR_MAX - pop_error_len, |
| 1202 | " [server says '%s']", *err_ret->e_text); | 1202 | " [server says '%s']", *err_ret->e_text); |
| 1203 | #endif | 1203 | #endif |
| 1204 | if (err_ret) | 1204 | if (err_ret) |