]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix restart + -u issue FSCORE-199
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 8 Oct 2008 14:53:31 +0000 (14:53 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 8 Oct 2008 14:53:31 +0000 (14:53 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9892 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core.c

index 6531804f730c02ed2543a0b87c5362e6cb99d87a..b8bd229803c27fc93a7aba94b3db0b6d0ce15106 100644 (file)
@@ -564,6 +564,11 @@ SWITCH_DECLARE(int32_t) change_user_group(const char *user, const char *group)
                runas_gid = gr->gr_gid;
        }
 
+       if (runas_uid && getuid() == runas_uid && (!runas_gid || runas_gid == getgid())) {
+               /* already running as the right user and group, nothing to do! */
+               return 0;
+       }
+
        if (runas_uid) {
 #ifdef HAVE_SETGROUPS
                /*