Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 692274

Summary: app-admin/lib_users-0.13 - print newline at end of PERMWARNING(/UID0)
Product: Gentoo Linux Reporter: Jeroen Roovers (RETIRED) <jer>
Component: Current packagesAssignee: Tobias Klausmann (RETIRED) <klausman>
Status: RESOLVED UPSTREAM    
Severity: normal Keywords: PATCH
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=415051
Whiteboard:
Package list:
Runtime testing required: ---

Description Jeroen Roovers (RETIRED) gentoo-dev 2019-08-16 06:55:37 UTC
- print newline at end of PERMWARNING
- have PERMWARNINGUID0 be the warning printed for UID == 0
- have PERMWARNING be the warning printed for UID != 0

--- a/lib_users.py
+++ b/lib_users.py
@@ -16,8 +16,8 @@
 from collections import defaultdict
 from lib_users_util import common

-PERMWARNING = """Warning: Some files could not be read."""
-PERMWARNINGUID0="""\
+PERMWARNINGUID0 = """Warning: Some files could not be read.\n"""
+PERMWARNING="""\
 Warning: Some files could not be read. Note that lib_users has to be run as
 root to get a full list of deleted in-use libraries.\n"""

@@ -113,9 +113,9 @@

     if read_failure:
         if os.geteuid() == 0:
-            sys.stderr.write(PERMWARNING)
-        else:
             sys.stderr.write(PERMWARNINGUID0)
+        else:
+            sys.stderr.write(PERMWARNING)

     if len(users) > 0:
         if options.machine_readable:
Comment 1 Tobias Klausmann (RETIRED) gentoo-dev 2019-08-16 11:00:26 UTC
Committed:

https://github.com/klausman/lib_users/commit/62dce7c1be98c22aeac9d36e0b7c7ad82d293c50