Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
21c3c37d
Commit
21c3c37d
authored
17 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Disable setting triggers by other than user SlurmUser unless SlurmUser
is root for improved security.
parent
1d87541d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NEWS
+2
-0
2 additions, 0 deletions
NEWS
doc/man/man1/strigger.1
+11
-1
11 additions, 1 deletion
doc/man/man1/strigger.1
src/slurmctld/trigger_mgr.c
+20
-2
20 additions, 2 deletions
src/slurmctld/trigger_mgr.c
with
33 additions
and
3 deletions
NEWS
+
2
−
0
View file @
21c3c37d
...
@@ -4,6 +4,8 @@ documents those changes that are of interest to users and admins.
...
@@ -4,6 +4,8 @@ documents those changes that are of interest to users and admins.
* Changes in SLURM 1.2.6
* Changes in SLURM 1.2.6
========================
========================
-- Fix MPIRUN_PORT env variable in mvapich plugin
-- Fix MPIRUN_PORT env variable in mvapich plugin
-- Disable setting triggers by other than user SlurmUser unless SlurmUser
is root for improved security.
* Changes in SLURM 1.2.5
* Changes in SLURM 1.2.5
========================
========================
...
...
This diff is collapsed.
Click to expand it.
doc/man/man1/strigger.1
+
11
−
1
View file @
21c3c37d
.TH SCONTROL "1" "
March
2007" "strigger 1.2" "Slurm components"
.TH SCONTROL "1" "
April
2007" "strigger 1.2" "Slurm components"
.SH "NAME"
.SH "NAME"
strigger \- Used set, get or clear Slurm trigger information.
strigger \- Used set, get or clear Slurm trigger information.
...
@@ -19,6 +19,16 @@ script.
...
@@ -19,6 +19,16 @@ script.
Typical uses include notifying system administrators of node failures
Typical uses include notifying system administrators of node failures
and gracefully terminating a job when it's time limit is approaching.
and gracefully terminating a job when it's time limit is approaching.
\fBNOTE:\fR This command can only set triggers if run by the
user \fISlurmUser\fR unless \fISlurmUser\fR is configured as user root.
This is required for the \fIslurmctld\fR daemon to set the appropriate
user and group IDs for the executed program.
Also note that the program is executed on the same node that the
\fIslurmctld\fR daemon uses rather than some allocated compute node.
To check the value of \fISlurmUser\fR, run the command:
\fIscontrol show config | grep SlurmUser\fR
.SH "ARGUMENTS"
.SH "ARGUMENTS"
.TP
.TP
\fB\-\-block_err\fP
\fB\-\-block_err\fP
...
...
This diff is collapsed.
Click to expand it.
src/slurmctld/trigger_mgr.c
+
20
−
2
View file @
21c3c37d
...
@@ -45,12 +45,14 @@
...
@@ -45,12 +45,14 @@
#include
<errno.h>
#include
<errno.h>
#include
<fcntl.h>
#include
<fcntl.h>
#include
<grp.h>
#include
<stdlib.h>
#include
<stdlib.h>
#include
<sys/types.h>
#include
<sys/types.h>
#include
<sys/stat.h>
#include
<sys/stat.h>
#include
"src/common/bitstring.h"
#include
"src/common/bitstring.h"
#include
"src/common/list.h"
#include
"src/common/list.h"
#include
"src/common/uid.h"
#include
"src/common/xmalloc.h"
#include
"src/common/xmalloc.h"
#include
"src/common/xstring.h"
#include
"src/common/xstring.h"
#include
"src/slurmctld/locks.h"
#include
"src/slurmctld/locks.h"
...
@@ -268,11 +270,24 @@ extern int trigger_set(uid_t uid, gid_t gid, trigger_info_msg_t *msg)
...
@@ -268,11 +270,24 @@ extern int trigger_set(uid_t uid, gid_t gid, trigger_info_msg_t *msg)
bitstr_t
*
bitmap
=
NULL
;
bitstr_t
*
bitmap
=
NULL
;
trig_mgr_info_t
*
trig_add
;
trig_mgr_info_t
*
trig_add
;
struct
job_record
*
job_ptr
;
struct
job_record
*
job_ptr
;
/* Read config and job info */
slurmctld_lock_t
job_read_lock
=
slurmctld_lock_t
job_read_lock
=
{
NO
_LOCK
,
READ_LOCK
,
NO_LOCK
,
NO_LOCK
};
{
READ
_LOCK
,
READ_LOCK
,
NO_LOCK
,
NO_LOCK
};
lock_slurmctld
(
job_read_lock
);
lock_slurmctld
(
job_read_lock
);
slurm_mutex_lock
(
&
trigger_mutex
);
slurm_mutex_lock
(
&
trigger_mutex
);
if
((
slurmctld_conf
.
slurm_user_id
!=
0
)
&&
(
slurmctld_conf
.
slurm_user_id
!=
uid
))
{
/* If SlurmUser is not root, then it is unable to set the
* appropriate user id and group id for the program to be
* launched. To prevent the launched program for an arbitrary
* user being executed as user SlurmUser, disable all other
* users from setting triggers. */
rc
=
EPERM
;
goto
fini
;
}
if
(
trigger_list
==
NULL
)
{
if
(
trigger_list
==
NULL
)
{
trigger_list
=
list_create
(
_trig_del
);
trigger_list
=
list_create
(
_trig_del
);
}
else
if
((
uid
!=
0
)
&&
}
else
if
((
uid
!=
0
)
&&
...
@@ -756,7 +771,7 @@ static void _trigger_node_event(trig_mgr_info_t *trig_in, time_t now)
...
@@ -756,7 +771,7 @@ static void _trigger_node_event(trig_mgr_info_t *trig_in, time_t now)
static
void
_trigger_run_program
(
trig_mgr_info_t
*
trig_in
)
static
void
_trigger_run_program
(
trig_mgr_info_t
*
trig_in
)
{
{
char
program
[
1024
],
arg0
[
1024
],
arg1
[
1024
],
*
pname
;
char
program
[
1024
],
arg0
[
1024
],
arg1
[
1024
],
user_name
[
1024
],
*
pname
;
uid_t
uid
;
uid_t
uid
;
gid_t
gid
;
gid_t
gid
;
pid_t
child
;
pid_t
child
;
...
@@ -771,6 +786,8 @@ static void _trigger_run_program(trig_mgr_info_t *trig_in)
...
@@ -771,6 +786,8 @@ static void _trigger_run_program(trig_mgr_info_t *trig_in)
strncpy
(
arg1
,
trig_in
->
res_id
,
sizeof
(
arg1
));
strncpy
(
arg1
,
trig_in
->
res_id
,
sizeof
(
arg1
));
uid
=
trig_in
->
user_id
;
uid
=
trig_in
->
user_id
;
gid
=
trig_in
->
group_id
;
gid
=
trig_in
->
group_id
;
snprintf
(
user_name
,
sizeof
(
user_name
),
"%s"
,
uid_to_string
(
uid
));
child
=
fork
();
child
=
fork
();
if
(
child
>
0
)
{
if
(
child
>
0
)
{
trig_in
->
group_id
=
child
;
trig_in
->
group_id
=
child
;
...
@@ -782,6 +799,7 @@ static void _trigger_run_program(trig_mgr_info_t *trig_in)
...
@@ -782,6 +799,7 @@ static void _trigger_run_program(trig_mgr_info_t *trig_in)
setsid
();
setsid
();
setuid
(
uid
);
setuid
(
uid
);
setgid
(
gid
);
setgid
(
gid
);
initgroups
(
user_name
,
-
1
);
execl
(
program
,
arg0
,
arg1
,
NULL
);
execl
(
program
,
arg0
,
arg1
,
NULL
);
exit
(
1
);
exit
(
1
);
}
else
}
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment