summaryrefslogtreecommitdiff
path: root/src/rm.c
diff options
context:
space:
mode:
authorDavid Bartley <dtbartle@csclub.uwaterloo.ca>2009-04-29 03:48:15 -0400
committerJim Meyering <meyering@redhat.com>2009-05-03 19:12:16 +0200
commit6249eb0596dfe50e1f959c4121e3c2515216cc60 (patch)
tree7078b6cede5902abdbdbd88f1bad4e6982a84062 /src/rm.c
parent181615b22a16eba3590cd747692af2432721b703 (diff)
downloadcoreutils-6249eb0596dfe50e1f959c4121e3c2515216cc60.tar.xz
mv, rm: adapt to new and improved gnulib interfaces
Use gnulib's new priv-set module and updated write-any-file. With them, the remove-called can_write_any_file function no longer tries to drop the unlink-directory privilege, so now each caller of remove must do that separately, calling priv_set_remove_linkdir. * bootstrap.conf (gnulib_modules): Add priv-set. * src/rm.c: Include "priv-set.h". (main): Call priv_set_remove_linkdir. * src/mv.c (main): Likewise. * gnulib: Update submodule to latest.
Diffstat (limited to 'src/rm.c')
-rw-r--r--src/rm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rm.c b/src/rm.c
index 8fecfdd5f..a70c559e8 100644
--- a/src/rm.c
+++ b/src/rm.c
@@ -55,6 +55,7 @@
#include "remove.h"
#include "root-dev-ino.h"
#include "yesno.h"
+#include "priv-set.h"
/* The official name of this program (e.g., no `g' prefix). */
#define PROGRAM_NAME "rm"
@@ -241,6 +242,9 @@ main (int argc, char **argv)
rm_option_init (&x);
+ /* Try to disable the ability to unlink a directory. */
+ priv_set_remove_linkdir ();
+
while ((c = getopt_long (argc, argv, "dfirvIR", long_opts, NULL)) != -1)
{
switch (c)