diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-06-29 20:33:26 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-06-29 20:33:26 +0800 |
commit | a663ef44bfd6455e343c632cd82719ecde9fa56e (patch) | |
tree | f1dbe96aa74a075c46dbb6048481bbad5faeb099 /util | |
parent | e3d46d5b426120793937938158de0e1f5a48925e (diff) | |
download | pttbbs-a663ef44bfd6455e343c632cd82719ecde9fa56e.tar pttbbs-a663ef44bfd6455e343c632cd82719ecde9fa56e.tar.gz pttbbs-a663ef44bfd6455e343c632cd82719ecde9fa56e.tar.bz2 pttbbs-a663ef44bfd6455e343c632cd82719ecde9fa56e.tar.lz pttbbs-a663ef44bfd6455e343c632cd82719ecde9fa56e.tar.xz pttbbs-a663ef44bfd6455e343c632cd82719ecde9fa56e.tar.zst pttbbs-a663ef44bfd6455e343c632cd82719ecde9fa56e.zip |
root overwrite
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@991 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r-- | util/bbsctl.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/util/bbsctl.c b/util/bbsctl.c index 8daa89c3..936547a3 100644 --- a/util/bbsctl.c +++ b/util/bbsctl.c @@ -33,6 +33,10 @@ int HaveBBSADM(void) gid_t gids[NGROUPS_MAX]; int i, ngids; struct group *gr; + + if( getuid() == 0 || geteuid() == 0 ) + return 1; + ngids = getgroups(NGROUPS_MAX, gids); if( (gr = getgrnam("bbsadm")) == NULL ){ puts("group bbsadm not found"); @@ -40,7 +44,7 @@ int HaveBBSADM(void) } for( i = 0 ; i < ngids ; ++i ) - if( gr->gr_gid == gids[i] ) + if( gr->gr_gid == (int)gids[i] ) break; if( i == ngids ){ |