coreutils
[Top][All Lists]
Advanced

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

[PATCH 4/6] cp: -Z: tweak comments for selinux routines


From: Pádraig Brady
Subject: [PATCH 4/6] cp: -Z: tweak comments for selinux routines
Date: Tue, 4 Dec 2012 16:32:23 +0000

* src/selinux.c: Remove debugging comments and
standardise existing comments a bit.
---
 src/selinux.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/selinux.c b/src/selinux.c
index 3235309..565022d 100644
--- a/src/selinux.c
+++ b/src/selinux.c
@@ -59,11 +59,11 @@ mode_to_security_class (mode_t m)
 }
 
 /*
-  This function takes a path and a mode and then asks SELinux what the label
+  This function takes a PATH and a MODE and then asks SELinux what the label
   of the path object would be if the current process label created it.
-  it then returns the label.
+  It then returns the label.
 
-  Returns -1 on failure. errno will be set appropriately.
+  Returns -1 on failure.  errno will be set appropriately.
 */
 
 static int
@@ -100,7 +100,7 @@ quit:
   default type into label.  It tells the SELinux Kernel to label all new file
   system objects created by the current process with this label.
 
-  Returns -1 on failure. errno will be set appropriately.
+  Returns -1 on failure.  errno will be set appropriately.
 */
 int
 defaultcon (char const *path, mode_t mode)
@@ -129,7 +129,6 @@ defaultcon (char const *path, mode_t mode)
 
   rc = setfscreatecon (constr);
 
-//  printf("defaultcon %s %s\n", path, context_str(tcontext));
 quit:
   context_free (scontext);
   context_free (tcontext);
@@ -139,8 +138,8 @@ quit:
 }
 
 /*
-  This function takes a path of an existing file system object, and a boolean
-  that indicates whether the function should preserve the objects label or
+  This function takes a PATH of an existing file system object, and a boolean
+  that indicates whether the function should preserve the object's label or
   generate a new label using matchpathcon.  If the function
   is called with preserve, it will ask the SELinux Kernel what the default 
label
   for all objects created should be and then sets the label on the object.
@@ -148,7 +147,7 @@ quit:
   default label should be, extracts the type field and then modifies the file
   system object.
 
-  Returns -1 on failure. errno will be set appropriately.
+  Returns -1 on failure.  errno will be set appropriately.
 */
 static int
 restorecon_private (char const *path, bool preserve)
@@ -216,7 +215,6 @@ restorecon_private (char const *path, bool preserve)
   else
     rc = lsetfilecon (path, constr);
 
-//  printf("restorcon %s %s\n", path, context_str(tcontext));
 quit:
   close (fd);
   context_free (scontext);
@@ -229,15 +227,14 @@ quit:
 /*
   This function takes three parameters:
   Path of an existing file system object.
-  A boolean indicating whether it should call restorecon_private recursively
-  or not.
+  A boolean indicating whether it should call restorecon_private recursively.
   A boolean that indicates whether the function should preserve the object's
   label or generate a new label using matchpathcon.
 
   If Recurse is selected and the file system object is a directory, restorecon
   calls restorecon_private on every file system object in the directory.
 
-  Returns false on failure. errno will be set appropriately.
+  Returns false on failure.  errno will be set appropriately.
 */
 bool
 restorecon (char const *path, bool recurse, bool preserve)
-- 
1.7.6.4




reply via email to

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