aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPaul Eggert2012-12-14 10:59:00 -0800
committerPaul Eggert2012-12-14 10:59:00 -0800
commit97976f9f3fcf588535bf4afad71de92860bb2f8e (patch)
tree48af44cc93624fd119f59ceb94fbb5c5f3eaaf7c /doc
parentad966fe7542070b5c9aa34ed019d586e7c3adae6 (diff)
downloademacs-97976f9f3fcf588535bf4afad71de92860bb2f8e.tar.gz
emacs-97976f9f3fcf588535bf4afad71de92860bb2f8e.zip
Fix permissions bugs with setgid directories etc.
* 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
Diffstat (limited to 'doc')
-rw-r--r--doc/lispintro/ChangeLog7
-rw-r--r--doc/lispintro/emacs-lisp-intro.texi2
-rw-r--r--doc/lispref/ChangeLog10
-rw-r--r--doc/lispref/files.texi14
-rw-r--r--doc/lispref/os.texi10
5 files changed, 36 insertions, 7 deletions
diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog
index 51c6a53fcd8..8e7278ee2ee 100644
--- a/doc/lispintro/ChangeLog
+++ b/doc/lispintro/ChangeLog
@@ -1,3 +1,10 @@
12012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2
3 Fix permissions bugs with setgid directories etc. (Bug#13125)
4 * emacs-lisp-intro.texi (Files List):
5 directory-files-and-attributes now outputs t for attribute that's
6 now a placeholder.
7
12012-12-06 Paul Eggert <eggert@cs.ucla.edu> 82012-12-06 Paul Eggert <eggert@cs.ucla.edu>
2 9
3 * doclicense.texi: Update to latest version from FSF. 10 * doclicense.texi: Update to latest version from FSF.
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi
index 34ef7cc093c..5111ee116a3 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -15687,7 +15687,7 @@ nil
15687"-rw-r--r--" 15687"-rw-r--r--"
15688@end group 15688@end group
15689@group 15689@group
15690nil 15690t
156912971624 156912971624
15692773) 15692773)
15693@end group 15693@end group
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index b0727694b3d..8a99f8c9c40 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,13 @@
12012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2
3 Fix permissions bugs with setgid directories etc. (Bug#13125)
4 * files.texi (Testing Accessibility): Document GROUP arg
5 of file-ownership-preserved-p.
6 (File Attributes): Document that 9th element is now
7 just a placeholder.
8 * os.texi (User Identification): Document new functions group-gid,
9 group-real-gid.
10
12012-12-11 Paul Eggert <eggert@cs.ucla.edu> 112012-12-11 Paul Eggert <eggert@cs.ucla.edu>
2 12
3 * internals.texi (C Integer Types): New section. 13 * internals.texi (C Integer Types): New section.
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 863acbe3949..c0c2221a394 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -895,11 +895,14 @@ returns @code{nil}. However, if the open fails, it signals an error
895using @var{string} as the error message text. 895using @var{string} as the error message text.
896@end defun 896@end defun
897 897
898@defun file-ownership-preserved-p filename 898@defun file-ownership-preserved-p filename &optional group
899This function returns @code{t} if deleting the file @var{filename} and 899This function returns @code{t} if deleting the file @var{filename} and
900then creating it anew would keep the file's owner unchanged. It also 900then creating it anew would keep the file's owner unchanged. It also
901returns @code{t} for nonexistent files. 901returns @code{t} for nonexistent files.
902 902
903If the optional argument @var{group} is non-@code{nil}, this function
904also checks that the file's group would be unchanged.
905
903If @var{filename} is a symbolic link, then, unlike the other functions 906If @var{filename} is a symbolic link, then, unlike the other functions
904discussed here, @code{file-ownership-preserved-p} does @emph{not} 907discussed here, @code{file-ownership-preserved-p} does @emph{not}
905replace @var{filename} with its target. However, it does recursively 908replace @var{filename} with its target. However, it does recursively
@@ -1246,8 +1249,7 @@ The file's modes, as a string of ten letters or dashes,
1246as in @samp{ls -l}. 1249as in @samp{ls -l}.
1247 1250
1248@item 1251@item
1249@code{t} if the file's @acronym{GID} would change if file were 1252An unspecified value, present for backward compatibility.
1250deleted and recreated; @code{nil} otherwise.
1251 1253
1252@item 1254@item
1253The file's inode number. If possible, this is an integer. If the 1255The file's inode number. If possible, this is an integer. If the
@@ -1279,7 +1281,7 @@ For example, here are the file attributes for @file{files.texi}:
1279 (20000 23 0 0) 1281 (20000 23 0 0)
1280 (20614 64555 902289 872000) 1282 (20614 64555 902289 872000)
1281 122295 "-rw-rw-rw-" 1283 122295 "-rw-rw-rw-"
1282 nil (5888 2 . 43978) 1284 t (5888 2 . 43978)
1283 (15479 . 46724)) 1285 (15479 . 46724))
1284@end group 1286@end group
1285@end example 1287@end example
@@ -1318,8 +1320,8 @@ end-of-line format is CR-LF.)
1318@item "-rw-rw-rw-" 1320@item "-rw-rw-rw-"
1319has a mode of read and write access for the owner, group, and world. 1321has a mode of read and write access for the owner, group, and world.
1320 1322
1321@item nil 1323@item t
1322would retain the same @acronym{GID} if it were recreated. 1324is merely a placeholder; it carries no information.
1323 1325
1324@item (5888 2 . 43978) 1326@item (5888 2 . 43978)
1325has an inode number of 6473924464520138. 1327has an inode number of 6473924464520138.
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index e2161f51489..4b9cdfaae9e 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -1157,6 +1157,16 @@ This function returns the effective @acronym{UID} of the user.
1157The value may be a floating point number. 1157The value may be a floating point number.
1158@end defun 1158@end defun
1159 1159
1160@defun group-gid
1161This function returns the effective @acronym{GID} of the Emacs process.
1162The value may be a floating point number.
1163@end defun
1164
1165@defun group-real-gid
1166This function returns the real @acronym{GID} of the Emacs process.
1167The value may be a floating point number.
1168@end defun
1169
1160@defun system-users 1170@defun system-users
1161This function returns a list of strings, listing the user names on the 1171This function returns a list of strings, listing the user names on the
1162system. If Emacs cannot retrieve this information, the return value 1172system. If Emacs cannot retrieve this information, the return value