Skip to content

Commit 385bc79

Browse files
committed
BF: CS-886: qresub fails for jobs that are part of the defaultdepartment
1 parent 71ec552 commit 385bc79

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

doc/markdown/man/man5/sge_access_list.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ Allows to submit, control and delete advance reservations (see qsub(1)).
4141

4242
Allows to specify a deadline for jobs (see qsub(1) -dl).
4343

44+
## defaultdepartment
45+
46+
The *defaultdepartment* is the default department for users that are not assigned to any other department.
47+
In difference to other departments, users or groups of users must not explicitly be referenced in the *entries* field of the *defaultdepartment* so that a user can be part of the *defaultdepartment*.
48+
4449
# FORMAT
4550

4651
The following list of access list parameters specifies the access list content:

source/daemons/qmaster/sge_userset_qmaster.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,13 @@ bool
289289
job_is_valid_department(lListElem *job, lList **alpp, const char *dept_name, const lList *userset_list) {
290290
DENTER(TOP_LAYER);
291291

292+
// Do we have a department name?
293+
if (dept_name == nullptr) {
294+
ERROR(MSG_JOB_NODEPTFOUND);
295+
answer_list_add(alpp, SGE_EVENT, STATUS_EUNKNOWN, ANSWER_QUALITY_ERROR);
296+
DRETURN(false);
297+
}
298+
292299
// Does the department exist?
293300
const lListElem *dept = lGetElemStr(userset_list, US_name, dept_name);
294301
if (!dept || !(lGetUlong(dept, US_type) & US_DEPT)) {
@@ -299,6 +306,12 @@ job_is_valid_department(lListElem *job, lList **alpp, const char *dept_name, con
299306
DRETURN(false);
300307
}
301308

309+
// Is the department name the default department then we can skip remaining tests.
310+
// The default department is always valid and the user or group(s) do not need to be part of it.
311+
if (!strcmp(dept_name, DEFAULT_DEPARTMENT)) {
312+
DRETURN(true);
313+
}
314+
302315
// Does the user belong to the department?
303316
const char *owner = lGetString(job, JB_owner);
304317
if (sge_contained_in_access_list(owner, nullptr, nullptr, dept)) {

0 commit comments

Comments
 (0)