[samba/f14/master] Fix root check in smb init script resolves: #577533

Guenther Deschner gd at fedoraproject.org
Fri Apr 1 16:06:48 UTC 2011


commit 0177d8f6e962e81032a87fc52fb879c4f8703c75
Author: Günther Deschner <gd at fedoraproject.org>
Date:   Fri Apr 1 18:02:21 2011 +0200

    Fix root check in smb init script
    resolves: #577533
    
    Guenther

 samba.spec |    2 ++
 smb.init   |    6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/samba.spec b/samba.spec
index f603d61..1e32641 100644
--- a/samba.spec
+++ b/samba.spec
@@ -672,6 +672,8 @@ exit 0
 * Fri Apr 01 2011 Guenther Deschner <gdeschner at redhat.com> - 3.5.8-76
 - Fix nmb init script description
 - resolves: #551631
+- Fix root check in smb init script
+- resolves: #577533
 
 * Tue Mar 22 2011 Guenther Deschner <gdeschner at redhat.com> - 3.5.8-75
 - Fix broken smb.conf.5 manpage
diff --git a/smb.init b/smb.init
index f3f87b4..54733c6 100644
--- a/smb.init
+++ b/smb.init
@@ -82,8 +82,10 @@ if [ "$1" = status ]; then
        exit $?
 fi
 
-# Check that we can write to it... so non-root users stop here
-[ -w /etc/samba/smb.conf ] || exit 4
+uid=`id | cut -d\( -f1 | cut -d= -f2`
+
+# Check that we stop here for non-root users
+[ $uid -ne 0 ] && exit 4
 
 
 


More information about the scm-commits mailing list