1. 16 Dec, 2012 1 commit
    • Romain Francoise's avatar
      Add support for preserving ACL entries of files. · 7c3d167f
      Romain Francoise authored
      	* configure.ac (acl): New option.
      	(HAVE_POSIX_ACL): Test for POSIX ACL support.  This is typically
      	provided by libacl on GNU/Linux.
      
      	* fileio.c (Ffile_acl, Fset_file_acl): New functions.
      	(Fcopy_file): Change last arg to `preserve_extended_attributes'
      	and copy ACL entries of file in addition to SELinux context if
      	set.
      	(syms_of_fileio): Add `file-acl' and `set-file-acl'.
      
      	* Makefile.in (LIBACL_LIBS): New macro.
      	(LIBES): Use it.
      
      	* files.el (file-extended-attributes)
      	(set-file-extended-attributes): New functions.
      	(backup-buffer): Use them to handle both SELinux context and ACL
      	entries.
      	(backup-buffer-copy): Work with an alist of extended attributes,
      	rather than an SELinux context.
      	(basic-save-buffer-2): Ditto.
      
      	* files.texi (File Attributes): Document ACL support and new
      	`file-acl' function.
      	(Changing Files): Mention argument name change of `copy-file' and
      	document new function `set-file-acl'.
      7c3d167f
  2. 15 Dec, 2012 2 commits
    • Paul Eggert's avatar
      7d80ea23
    • Eli Zaretskii's avatar
      Fix bug #13079 on MS-Windows with temp files not being deleted. · b0728617
      Eli Zaretskii authored
       src/w32.h (_child_process): New members input_file and
       pending_deletion.
       (register_child): First argument is now pid_t.
       (record_infile, record_pending_deletion): New prototypes.
       src/w32proc.c (new_child): Initialize input_file and
       pending_deletion members of the child.
       (delete_child): Delete the child's temporary input file, if any,
       that is pending deletion.
       (register_child): First argument is now pid_t.
       (record_infile, record_pending_deletion): New functions.
       (reap_subprocess): Fix a typo in DebPrint string.
       (sys_spawnve, sys_kill): Use pid_t for PID arguments.
       src/fileio.c (internal_delete_file): Return an int again: non-zero
       if delete-file succeeds, zero otherwise.
       src/lisp.h (internal_delete_file): Adjust prototype.
       src/callproc.c (Fcall_process): Don't overwrite infile with result
       of DECODE_FILE.
       [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
       asynchronous subprocess, record the name of the input file name,
       if any.
       (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
       delete the file, record it as pending deletion when the subprocess
       exits.
      
       nt/inc/ms-w32.h (sys_unlink): Provide prototype.
      b0728617
  3. 14 Dec, 2012 6 commits
    • Paul Eggert's avatar
      Spelling fixes. · cccaebd2
      Paul Eggert authored
      My favorite was that the word "dictionary" was misspelled.
      Also, correct the title in the DeRemer & Pennello 1982 citation,
      and add a URL.
      cccaebd2
    • Eli Zaretskii's avatar
      Fix compilation warnings in the Windows build. · 7e90af26
      Eli Zaretskii authored
       src/editfns.c [HAVE_PWD_H]: Include grp.h.
       src/makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
      7e90af26
    • Paul Eggert's avatar
      Fix permissions bugs with setgid directories etc. · 97976f9f
      Paul Eggert authored
      * configure.ac (BSD4_2): Remove; no longer needed.
      * admin/CPP-DEFINES (BSD4_2): Remove.
      * doc/lispintro/emacs-lisp-intro.texi (Files List):
      directory-files-and-attributes now outputs t for attribute that's
      now a placeholder.
      * doc/lispref/files.texi (Testing Accessibility): Document GROUP arg
      of file-ownership-preserved-p.
      (File Attributes): Document that 9th element is now
      just a placeholder.
      * doc/lispref/os.texi (User Identification): Document new functions group-gid,
      group-real-gid.
      * etc/NEWS: Document changes to file-attributes,
      file-ownership-preserved-p.
      Mention new functions group-gid, group-real-gid.
      * lisp/files.el (backup-buffer): Don't rely on 9th output of
      file-attributes, as it's now a placeholder.  Instead, use the new
      optional arg of file-ownership-preserved-p.
      (file-ownership-preserved-p): New optional arg GROUP.
      Fix mishandling of setuid directories that would cause this
      function to return t when it should have returned nil.
      Document what happens if the file does not exist, and when
      it's not known whether the ownership will be preserved.
      * lisp/net/tramp-sh.el (tramp-sh-handle-file-ownership-preserved-p):
      Likewise.
      (tramp-get-local-gid): Use group-gid for integer, as that's
      faster and more reliable.
      * src/dired.c (Ffile_attributes): Return t as the 9th attribute,
      to mark it as a placeholder.  The old value was often wrong.
      The only user of this attribute has been changed to use
      file-ownership-preserved-p instead, with its new group arg.
      * src/editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
      
      Fixes: debbugs:13125
      97976f9f
    • Stefan Monnier's avatar
    • Stefan Monnier's avatar
      * src/xdisp.c (select_frame_for_redisplay): Keep selected_window and · 26ec1f49
      Stefan Monnier authored
      selected_frame in sync.
      26ec1f49
    • Eli Zaretskii's avatar
      Speed up most calls to 'stat' and 'lstat' on MS-Windows. · 5c207910
      Eli Zaretskii authored
       src/w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
       try to get accurate owner and group information from NT file
       security APIs.  This is to make most callers of 'stat' and
       'lstat', which don't need that information, much faster.
       src/dired.c (Ffile_attributes) [WINDOWSNT]: Set
       w32_stat_get_owner_group to a non-zero value, to request accurate
       owner and group information from 'lstat'.
      
       nt/inc/sys/stat.h: Declare w32_stat_get_owner_group.
      5c207910
  4. 13 Dec, 2012 4 commits
  5. 12 Dec, 2012 2 commits
  6. 11 Dec, 2012 8 commits
  7. 10 Dec, 2012 9 commits
  8. 08 Dec, 2012 8 commits
    • Jan Djärv's avatar
      * nsterm.m (fd_handler:): FD_ZERO fds. · a06ae17d
      Jan Djärv authored
      Fixes: debbugs:13103
      a06ae17d
    • Eli Zaretskii's avatar
      Fix putenv and unsetenv on MS-Windows. · a16e75cd
      Eli Zaretskii authored
       src/w32.c (unsetenv): Return 0 if the input string is too long.
      
       nt/inc/ms-w32.h (sys_putenv): Add prototype.
      
      Fixes: debbugs:13070
      a16e75cd
    • Paul Eggert's avatar
      Use putenv+unsetenv instead of modifying environ directly. · 5745a7df
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add putenv, unsetenv.
      * lib/putenv.c, lib/unsetenv.c, m4/putenv.m4, m4/setenv.m4:
      New files, copied automatically from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * src/alloc.c (xputenv): New function.
      * src/dbusbind.c (Fdbus_init_bus):
      * src/emacs.c (main):
      * src/xterm.c (x_term_init):
      Use xputenv instead of setenv or putenv, to detect memory exhaustion.
      * src/editfns.c (initial_tz): Move static var decl up.
      (tzvalbuf_in_environ): New static var.
      (init_editfns):	Initialize these two static vars.
      (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
      Save old TZ value on stack, if it's small.
      (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
      instead, use xputenv+unsetenv to set and restore TZ.
      (environbuf): Remove static var.  All uses removed.
      (Fset_time_zone_rule): Do not save TZ and environ;
      no longer needed here.
      (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
      Move to inside set_time_zone_rule; they don't need file scope any more.
      (set_time_zone_rule): Maintain the TZ=value string separately.
      (syms_of_editfns): Don't initialize initial_tz;
      init_editfns now does it.
      * src/emacs.c (dump_tz) [HAVE_TZSET]: Now const.
      * src/lisp.h (xputenv): New decl.
      
      Fixes: debbugs:13070
      5745a7df
    • Fabrice Popineau's avatar
    • Fabrice Popineau's avatar
      Fix incompatibilities with 64-bit Windows builds. · cb576b5c
      Fabrice Popineau authored
       src/w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
       DWORD_PTR, for compatibility with 64-bit builds.
       src/w32.c (_PROCESS_MEMORY_COUNTERS_EX): 
       (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
       (system_process_attributes): Use SIZE_T rather than DWORD, for
       compatibility with 64-bit builds.
      cb576b5c
    • Eli Zaretskii's avatar
      Provide unsetenv for MS-Windows and make putenv Posix-compatible. · 75ceee05
      Eli Zaretskii authored
       src/w32.c (unsetenv, sys_putenv): New functions.
      
       nt/inc/ms-w32.h (putenv): Redirect to sys_putenv.
       nt/config.nt (HAVE_UNSETENV): Define to 1.
      
      Fixes: debbugs:13070
      75ceee05
    • Chong Yidong's avatar
      * src/editfns.c (Finsert_char): Make the error message more informative. · 1b6dbfeb
      Chong Yidong authored
      Fixes: debbugs:12992
      1b6dbfeb
    • Paul Eggert's avatar
      Simplify get_lim_data. · 7be78020
      Paul Eggert authored
      * admin/CPP-DEFINES (ULIMIT_BREAK_VALUE): Remove.
      * configure.ac (ULIMIT_BREAK_VALUE): Remove.
      * src/vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
      Remove USG and vlimit methods; no longer used these days.
      Add #error catchall just in case.
      7be78020