Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
3f60f234
Commit
3f60f234
authored
Jun 17, 2004
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If effective user id is root set it to real user id or pwrp
parent
7e56d208
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
src/exp/rt/src/rt_plc_process.c
src/exp/rt/src/rt_plc_process.c
+17
-1
No files found.
src/exp/rt/src/rt_plc_process.c
View file @
3f60f234
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#elif defined(OS_LYNX)
#elif defined(OS_LYNX)
#endif
#endif
#include <pwd.h>
#include "pwr.h"
#include "pwr.h"
#include "pwr_class.h"
#include "pwr_class.h"
#include "pwr_baseclasses.h"
#include "pwr_baseclasses.h"
...
@@ -121,7 +122,9 @@ int main (
...
@@ -121,7 +122,9 @@ int main (
{
{
pwr_tStatus
sts
;
pwr_tStatus
sts
;
plc_sProcess
*
pp
;
plc_sProcess
*
pp
;
uid_t
ruid
;
struct
passwd
*
pwd
;
pp
=
init_process
();
pp
=
init_process
();
qcom_WaitAnd
(
&
sts
,
&
pp
->
eventQ
,
&
qcom_cQini
,
ini_mEvent_newPlcInit
,
qcom_cTmoEternal
);
qcom_WaitAnd
(
&
sts
,
&
pp
->
eventQ
,
&
qcom_cQini
,
ini_mEvent_newPlcInit
,
qcom_cTmoEternal
);
...
@@ -130,6 +133,19 @@ int main (
...
@@ -130,6 +133,19 @@ int main (
create_threads
(
pp
);
create_threads
(
pp
);
init_threads
(
pp
);
init_threads
(
pp
);
/* Once threads has set their priority don't run as root */
ruid
=
getuid
();
if
(
ruid
==
0
)
{
pwd
=
getpwnam
(
"pwrp"
);
if
(
pwd
!=
NULL
)
{
setreuid
(
pwd
->
pw_uid
,
pwd
->
pw_uid
);
}
}
else
setreuid
(
ruid
,
ruid
);
qcom_SignalOr
(
&
sts
,
&
qcom_cQini
,
ini_mEvent_newPlcInitDone
);
qcom_SignalOr
(
&
sts
,
&
qcom_cQini
,
ini_mEvent_newPlcInitDone
);
qcom_WaitAnd
(
&
sts
,
&
pp
->
eventQ
,
&
qcom_cQini
,
ini_mEvent_newPlcStart
,
qcom_cTmoEternal
);
qcom_WaitAnd
(
&
sts
,
&
pp
->
eventQ
,
&
qcom_cQini
,
ini_mEvent_newPlcStart
,
qcom_cTmoEternal
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment