Commit a67271b0 authored by claes's avatar claes

Initial commit

parent 18fd3957
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(linkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(rt_msg_objs) \
endif
//
// rt_mozilla
// Mozilla cannot be started by a program that has the suid bit set, if
// the current user is not equal to the original user.
// This program resets to original uid before starting mozilla.
//
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
int main( int argc, char *argv[])
{
char cmd[200];
int sts;
bool remote = false;
strcpy( cmd, "mozilla ");
for ( int i = 1; i < argc; i++) {
if ( strcmp( argv[i], "-remote") == 0) {
remote = true;
strcat( cmd, argv[i]);
strcat( cmd, " \"");
}
else {
strcat( cmd, argv[i]);
if ( i != argc - 1)
strcat( cmd, " ");
}
}
if ( remote)
strcat( cmd, "\"");
uid_t uid = getuid();
// printf( "rt_mozilla '%s' uid: %d\n", cmd, uid);
setuid( uid);
sts = system( cmd);
if ( sts)
exit(1);
else
exit(0);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment