Fix warnings
This commit is contained in:
parent
6f3ffa2ea8
commit
b471b98d5c
2
README
2
README
@ -106,7 +106,7 @@ ENV_NON_RESIDENT The same as ENV_UID, but controls the name of the NON_RESI
|
|||||||
|
|
||||||
There is no Makefile right now, but compile is as simple as:
|
There is no Makefile right now, but compile is as simple as:
|
||||||
|
|
||||||
> gcc -O2 -o execwrap execwrap.c && strip execwrap
|
> gcc -W -Wall -O2 -o execwrap execwrap.c && strip execwrap
|
||||||
|
|
||||||
Or similar, depending on taste. You need something other than an ancient compiler to make
|
Or similar, depending on taste. You need something other than an ancient compiler to make
|
||||||
it work, preferably C99. To install, make sure the file is owned by the super user and has
|
it work, preferably C99. To install, make sure the file is owned by the super user and has
|
||||||
|
11
execwrap.c
11
execwrap.c
@ -123,7 +123,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <grp.h>
|
||||||
|
|
||||||
/* The global child PID and previous SIGTERM handler. */
|
/* The global child PID and previous SIGTERM handler. */
|
||||||
int pid;
|
int pid;
|
||||||
@ -176,16 +177,14 @@ int main(int argc, char* argv[], char* envp[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Grab stuff from environment, and set defaults. */
|
/* Grab stuff from environment, and set defaults. */
|
||||||
int uid = DEFAULT_UID;
|
uid_t uid = DEFAULT_UID;
|
||||||
int gid = DEFAULT_GID;
|
gid_t gid = DEFAULT_GID;
|
||||||
char* target = 0;
|
char* target = 0;
|
||||||
char* args = 0;
|
|
||||||
char check_gid = 0;
|
char check_gid = 0;
|
||||||
char non_resident = 0;
|
char non_resident = 0;
|
||||||
char** p = envp;
|
char** p = envp;
|
||||||
char* s;
|
char* s;
|
||||||
char* t;
|
while(NULL != (s = *p++))
|
||||||
while(s = *p++)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Target UID. */
|
/* Target UID. */
|
||||||
|
Loading…
Reference in New Issue
Block a user