[PD-cvs] externals/ggee/control shell.c,1.7,1.8
Guenter Geiger
ggeiger at users.sourceforge.net
Thu Oct 7 11:50:01 CEST 2004
- Previous message: [PD-cvs] pd/src makefile.in,1.1.1.3.2.15,1.1.1.3.2.16
- Next message: [PD-cvs] pd/src cvs_changes.txt,1.1.2.7,1.1.2.8 d_array.c,1.1.1.3.2.4,1.1.1.3.2.5 d_ctl.c,1.1.1.3.2.11,1.1.1.3.2.12 d_global.c,1.1.1.2.8.7,1.1.1.2.8.8 d_ugen.c,1.1.1.2.2.8,1.1.1.2.2.9 g_array.c,1.1.1.3.2.12,1.1.1.3.2.13 g_io.c,1.1.1.1.16.5,1.1.1.1.16.6 m_memory.c,1.1.1.2.2.2,1.1.1.2.2.3 m_pd.h,1.1.1.4.2.19,1.1.1.4.2.20 m_simd.h,1.1.2.7,1.1.2.8 m_simd_def.h,1.1.2.6,1.1.2.7 m_simd_sse_gcc.h,1.1.2.8,1.1.2.9 m_simd_sse_vc.c,1.1.2.7,1.1.2.8 m_simd_sse_vc.h,1.1.2.7,1.1.2.8 m_simd_ve_gcc.c,1.1.2.6,1.1.2.7 m_simd_ve_gcc.h,1.1.2.7,1.1.2.8 makefile.nt,1.1.1.3.2.2,1.1.1.3.2.3 s_inter.c,1.1.1.3.2.15,1.1.1.3.2.16
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/pure-data/externals/ggee/control
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31976
Modified Files:
shell.c
Log Message:
dropping privileges for shell process
Index: shell.c
===================================================================
RCS file: /cvsroot/pure-data/externals/ggee/control/shell.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** shell.c 12 Aug 2004 08:39:19 -0000 1.7
--- shell.c 7 Oct 2004 09:49:59 -0000 1.8
***************
*** 9,18 ****
--- 9,21 ----
#include <unistd.h>
#include <stdlib.h>
+ #include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
+ #include <sched.h>
void sys_rmpollfn(int fd);
+ void sys_addpollfn(int fd, void* fn, void *ptr);
/* ------------------------ shell ----------------------------- */
***************
*** 23,26 ****
--- 26,40 ----
+ static void drop_priority(void)
+ {
+ #ifdef _POSIX_PRIORITY_SCHEDULING
+ struct sched_param par;
+ int p1 ,p2, p3;
+ par.sched_priority = 0;
+ sched_setscheduler(0,SCHED_OTHER,&par);
+ #endif
+ }
+
+
typedef struct _shell
{
***************
*** 243,246 ****
--- 257,265 ----
dup2(x->fdpipe[1],1);
dup2(x->fdinpipe[1],0);
+
+ /* drop privileges */
+ drop_priority();
+ seteuid(getuid()); /* lose setuid priveliges */
+
post("executing %s",cmd);
system(cmd);
- Previous message: [PD-cvs] pd/src makefile.in,1.1.1.3.2.15,1.1.1.3.2.16
- Next message: [PD-cvs] pd/src cvs_changes.txt,1.1.2.7,1.1.2.8 d_array.c,1.1.1.3.2.4,1.1.1.3.2.5 d_ctl.c,1.1.1.3.2.11,1.1.1.3.2.12 d_global.c,1.1.1.2.8.7,1.1.1.2.8.8 d_ugen.c,1.1.1.2.2.8,1.1.1.2.2.9 g_array.c,1.1.1.3.2.12,1.1.1.3.2.13 g_io.c,1.1.1.1.16.5,1.1.1.1.16.6 m_memory.c,1.1.1.2.2.2,1.1.1.2.2.3 m_pd.h,1.1.1.4.2.19,1.1.1.4.2.20 m_simd.h,1.1.2.7,1.1.2.8 m_simd_def.h,1.1.2.6,1.1.2.7 m_simd_sse_gcc.h,1.1.2.8,1.1.2.9 m_simd_sse_vc.c,1.1.2.7,1.1.2.8 m_simd_sse_vc.h,1.1.2.7,1.1.2.8 m_simd_ve_gcc.c,1.1.2.6,1.1.2.7 m_simd_ve_gcc.h,1.1.2.7,1.1.2.8 makefile.nt,1.1.1.3.2.2,1.1.1.3.2.3 s_inter.c,1.1.1.3.2.15,1.1.1.3.2.16
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Pd-cvs
mailing list