bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] New sol10priv module


From: Jim Meyering
Subject: Re: [PATCH] New sol10priv module
Date: Sun, 03 May 2009 19:23:55 +0200

David Bartley wrote:
...
> Updated the gnulib patch accordingly.
>
>> Jim, I leave it to you to commit this for David, since I don't want to
>> interfere with your coreutils release.

Thanks to both of you.
I've just pushed that to gnulib, and the following to coreutils:

>From 6249eb0596dfe50e1f959c4121e3c2515216cc60 Mon Sep 17 00:00:00 2001
From: David Bartley <address@hidden>
Date: Wed, 29 Apr 2009 03:48:15 -0400
Subject: [PATCH] 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.
---
 bootstrap.conf |    1 +
 gnulib         |    2 +-
 src/mv.c       |    4 ++++
 src/rm.c       |    4 ++++
 4 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 475dad4..d8c7013 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -160,6 +160,7 @@ gnulib_modules="
   posix-shell
   posixtm
   posixver
+  priv-set
   progname
   propername
   putenv
diff --git a/gnulib b/gnulib
index 9ccd438..a771b77 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 9ccd438ce337e6fb8c95d9261f1e06a3952261c2
+Subproject commit a771b77559753840d51609c779d526590e6a0144
diff --git a/src/mv.c b/src/mv.c
index 0613236..8b9b6a1 100644
--- a/src/mv.c
+++ b/src/mv.c
@@ -32,6 +32,7 @@
 #include "quote.h"
 #include "remove.h"
 #include "root-dev-ino.h"
+#include "priv-set.h"

 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "mv"
@@ -354,6 +355,9 @@ main (int argc, char **argv)

   cp_option_init (&x);

+  /* Try to disable the ability to unlink a directory.  */
+  priv_set_remove_linkdir ();
+
   /* FIXME: consider not calling getenv for SIMPLE_BACKUP_SUFFIX unless
      we'll actually use backup_suffix_string.  */
   backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX");
diff --git a/src/rm.c b/src/rm.c
index 8fecfdd..a70c559 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)
--
1.6.3.rc4.190.g4648




reply via email to

[Prev in Thread] Current Thread [Next in Thread]