bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] unlinkdir: cannot_unlink_dir may modify process state


From: Jim Meyering
Subject: [PATCH] unlinkdir: cannot_unlink_dir may modify process state
Date: Wed, 04 Mar 2009 06:32:42 +0100

[oops, sent to bug-coreutils by mistake]

FYI, I've added this comment:

>From 8d2524ce78ca107074727cbd8780c26a203a107c Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 3 Mar 2009 15:07:45 +0100
Subject: [PATCH] unlinkdir: cannot_unlink_dir may modify process state

* lib/unlinkdir.c (cannot_unlink_dir): Add a comment warning that
it's neither thread-safe nor appropriate for use in a library.
---
 ChangeLog       |    6 ++++++
 lib/unlinkdir.c |    8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f4841af..3059649 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-03  Jim Meyering  <address@hidden>
+
+       unlinkdir: cannot_unlink_dir may modify process state
+       * lib/unlinkdir.c (cannot_unlink_dir): Add a comment warning that
+       it's neither thread-safe nor appropriate for use in a library.
+
 2009-03-03  Eric Blake  <address@hidden>

        test-closein: silence test under Darwin
diff --git a/lib/unlinkdir.c b/lib/unlinkdir.c
index 12e669e..9c3ff00 100644
--- a/lib/unlinkdir.c
+++ b/lib/unlinkdir.c
@@ -1,6 +1,6 @@
 /* unlinkdir.c - determine (and maybe change) whether we can unlink directories

-   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009 Free Software Foundation, Inc.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -30,7 +30,11 @@

 /* Return true if we cannot unlink directories, false if we might be
    able to unlink directories.  If possible, tell the kernel we don't
-   want to be able to unlink directories, so that we can return true.  */
+   want to be able to unlink directories, so that we can return true.
+
+   Note: this function may modify the process privilege set, to remove
+   the PRIV_SYS_LINKDIR privilege, so is neither thread-safe, nor
+   appropriate for use in a library.  */

 bool
 cannot_unlink_dir (void)
--
1.6.2.rc1.285.gc5f54




reply via email to

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