Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

retag v1.3.4

  • Loading branch information...
commit 47d6ddda237ddb4e390d43b82bafee218388bd52 2 parents 3be6818 + dd04265
@jette jette authored
View
2  contribs/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = perlapi phpext torque
+SUBDIRS = perlapi torque
EXTRA_DIST = \
env_cache_builder.c \
View
2  contribs/Makefile.in
@@ -245,7 +245,7 @@ target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = perlapi phpext torque
+SUBDIRS = perlapi torque
EXTRA_DIST = \
env_cache_builder.c \
make.slurm.patch \
View
8 src/common/read_config.c
@@ -861,14 +861,6 @@ static void _init_slurmd_nodehash(void)
}
}
-extern void slurm_conf_nodehash_init(void)
-{
- slurm_conf_lock();
- _init_slurmd_nodehash();
- slurm_conf_unlock();
-}
-
-
/*
* Caller needs to call slurm_conf_lock() and hold the lock before
* calling this function (and call slurm_conf_unlock() afterwards).
View
130 src/plugins/accounting_storage/mysql/accounting_storage_mysql.c
@@ -616,9 +616,7 @@ static int _remove_common(mysql_conn_t *mysql_conn,
if(mysql_conn->rollback) {
mysql_db_rollback(mysql_conn->acct_mysql_db);
}
- list_destroy(mysql_conn->update_list);
- mysql_conn->update_list =
- list_create(destroy_acct_update_object);
+ list_flush(mysql_conn->update_list);
return SLURM_ERROR;
}
@@ -640,9 +638,7 @@ static int _remove_common(mysql_conn_t *mysql_conn,
if(mysql_conn->rollback) {
mysql_db_rollback(mysql_conn->acct_mysql_db);
}
- list_destroy(mysql_conn->update_list);
- mysql_conn->update_list =
- list_create(destroy_acct_update_object);
+ list_flush(mysql_conn->update_list);
return SLURM_ERROR;
}
xfree(query);
@@ -1836,6 +1832,7 @@ extern int acct_storage_p_add_clusters(mysql_conn_t *mysql_conn, uint32_t uid,
struct passwd *pw = NULL;
char *user = NULL;
int affect_rows = 0;
+ int added = 0;
if(_check_connection(mysql_conn) != SLURM_SUCCESS)
return SLURM_ERROR;
@@ -1931,7 +1928,8 @@ extern int acct_storage_p_add_clusters(mysql_conn_t *mysql_conn, uint32_t uid,
xfree(extra);
xfree(cols);
xfree(vals);
- continue;
+ added=0;
+ break;
}
affect_rows = _last_affected_rows(mysql_conn->acct_mysql_db);
@@ -1967,7 +1965,8 @@ extern int acct_storage_p_add_clusters(mysql_conn_t *mysql_conn, uint32_t uid,
if(rc != SLURM_SUCCESS) {
error("Couldn't add cluster root assoc");
xfree(extra);
- continue;
+ added=0;
+ break;
}
xstrfmtcat(query,
"insert into %s "
@@ -1981,10 +1980,18 @@ extern int acct_storage_p_add_clusters(mysql_conn_t *mysql_conn, uint32_t uid,
xfree(query);
if(rc != SLURM_SUCCESS) {
error("Couldn't add txn");
- }
+ } else
+ added++;
}
list_iterator_destroy(itr);
+ if(!added) {
+ if(mysql_conn->rollback) {
+ mysql_db_rollback(mysql_conn->acct_mysql_db);
+ }
+ list_flush(mysql_conn->update_list);
+ }
+
return rc;
#else
return SLURM_ERROR;
@@ -2337,6 +2344,9 @@ extern int acct_storage_p_add_associations(mysql_conn_t *mysql_conn,
xfree(extra);
}
list_iterator_destroy(itr);
+ if(rc != SLURM_SUCCESS)
+ goto end_it;
+
if(incr) {
char *up_query = xstrdup_printf(
"UPDATE %s SET rgt = rgt+%d "
@@ -2359,6 +2369,7 @@ extern int acct_storage_p_add_associations(mysql_conn_t *mysql_conn,
}
+end_it:
if(rc != SLURM_ERROR) {
if(txn_query) {
xstrcat(txn_query, ";");
@@ -2370,9 +2381,14 @@ extern int acct_storage_p_add_associations(mysql_conn_t *mysql_conn,
rc = SLURM_SUCCESS;
}
}
- } else
+ } else {
xfree(txn_query);
-
+ if(mysql_conn->rollback) {
+ mysql_db_rollback(mysql_conn->acct_mysql_db);
+ }
+ list_flush(mysql_conn->update_list);
+ }
+
xfree(old_parent);
xfree(old_cluster);
@@ -2906,7 +2922,7 @@ extern List acct_storage_p_modify_associations(mysql_conn_t *mysql_conn,
list_iterator_destroy(itr);
xstrcat(extra, ")");
} else {
- info("no user specified");
+ debug4("no user specified");
xstrcat(extra, " && user = '' ");
}
@@ -2993,9 +3009,29 @@ extern List acct_storage_p_modify_associations(mysql_conn_t *mysql_conn,
if(!is_admin) {
acct_coord_rec_t *coord = NULL;
+ char *account = row[MASSOC_ACCT];
+
+ /* Here we want to see if the person
+ * is a coord of the parent account
+ * since we don't want him to be able
+ * to alter the limits of the account
+ * he is directly coord of. They
+ * should be able to alter the
+ * sub-accounts though. If no parent account
+ * that means we are talking about a user
+ * association so account is really the parent
+ * of the user a coord can change that all day long.
+ */
+ if(row[MASSOC_PACCT][0])
+ account = row[MASSOC_PACCT];
+
if(!user.coord_accts) { // This should never
// happen
- error("We are here with no coord accts");
+ error("We are here with no coord accts.");
+ if(mysql_conn->rollback) {
+ mysql_db_rollback(
+ mysql_conn->acct_mysql_db);
+ }
errno = ESLURM_ACCESS_DENIED;
mysql_free_result(result);
xfree(vals);
@@ -3004,16 +3040,36 @@ extern List acct_storage_p_modify_associations(mysql_conn_t *mysql_conn,
}
itr = list_iterator_create(user.coord_accts);
while((coord = list_next(itr))) {
- if(!strcasecmp(coord->acct_name, row[1]))
+ if(!strcasecmp(coord->acct_name, account))
break;
}
list_iterator_destroy(itr);
if(!coord) {
- error("User %s(%d) does not have the "
- "ability to change this account (%s)",
- user.name, user.uid, row[1]);
- continue;
+ if(row[MASSOC_PACCT][0])
+ error("User %s(%d) can not modify "
+ "account (%s) because they "
+ "are not coordinators of "
+ "parent account '%s'.",
+ user.name, user.uid,
+ row[MASSOC_ACCT],
+ row[MASSOC_PACCT]);
+ else
+ error("User %s(%d) does not have the "
+ "ability to modify the account "
+ "(%s).",
+ user.name, user.uid,
+ row[MASSOC_ACCT]);
+
+ if(mysql_conn->rollback) {
+ mysql_db_rollback(
+ mysql_conn->acct_mysql_db);
+ }
+ errno = ESLURM_ACCESS_DENIED;
+ mysql_free_result(result);
+ xfree(vals);
+ list_destroy(ret_list);
+ return NULL;
}
}
@@ -3101,17 +3157,19 @@ extern List acct_storage_p_modify_associations(mysql_conn_t *mysql_conn,
if(mysql_conn->rollback) {
mysql_db_rollback(mysql_conn->acct_mysql_db);
}
- list_destroy(mysql_conn->update_list);
- mysql_conn->update_list =
- list_create(destroy_acct_update_object);
+ list_flush(mysql_conn->update_list);
list_destroy(ret_list);
xfree(vals);
+ errno = rc;
return NULL;
}
}
if(!list_count(ret_list)) {
+ if(mysql_conn->rollback) {
+ mysql_db_rollback(mysql_conn->acct_mysql_db);
+ }
errno = SLURM_NO_CHANGE_IN_DATA;
debug3("didn't effect anything");
xfree(vals);
@@ -3123,6 +3181,10 @@ extern List acct_storage_p_modify_associations(mysql_conn_t *mysql_conn,
if(_modify_common(mysql_conn, DBD_MODIFY_ASSOCS, now,
user_name, assoc_table, name_char, vals)
== SLURM_ERROR) {
+ if(mysql_conn->rollback) {
+ mysql_db_rollback(mysql_conn->acct_mysql_db);
+ }
+ list_flush(mysql_conn->update_list);
error("Couldn't modify associations");
list_destroy(ret_list);
ret_list = NULL;
@@ -3411,7 +3473,12 @@ extern List acct_storage_p_remove_coord(mysql_conn_t *mysql_conn, uint32_t uid,
error("User %s(%d) does not have the "
"ability to change this account (%s)",
user.name, user.uid, row[1]);
- continue;
+ errno = ESLURM_ACCESS_DENIED;
+ list_destroy(ret_list);
+ list_destroy(user_list);
+ xfree(extra);
+ mysql_free_result(result);
+ return NULL;
}
}
if(!last_user || strcasecmp(last_user, row[0])) {
@@ -3896,6 +3963,10 @@ extern List acct_storage_p_remove_associations(mysql_conn_t *mysql_conn,
mysql_free_result(result);
if(!name_char) {
+ if(mysql_conn->rollback) {
+ mysql_db_rollback(mysql_conn->acct_mysql_db);
+ }
+ list_flush(mysql_conn->update_list);
errno = SLURM_NO_CHANGE_IN_DATA;
debug3("didn't effect anything\n%s", query);
xfree(query);
@@ -3912,6 +3983,10 @@ extern List acct_storage_p_remove_associations(mysql_conn_t *mysql_conn,
debug3("%d query\n%s", mysql_conn->conn, query);
if(!(result = mysql_db_query_ret(
mysql_conn->acct_mysql_db, query, 0))) {
+ if(mysql_conn->rollback) {
+ mysql_db_rollback(mysql_conn->acct_mysql_db);
+ }
+ list_flush(mysql_conn->update_list);
xfree(query);
xfree(name_char);
return NULL;
@@ -3941,7 +4016,8 @@ extern List acct_storage_p_remove_associations(mysql_conn_t *mysql_conn,
error("User %s(%d) does not have the "
"ability to change this account (%s)",
user.name, user.uid, row[RASSOC_ACCT]);
- continue;
+ errno = ESLURM_ACCESS_DENIED;
+ goto end_it;
}
}
if(row[RASSOC_PART][0]) {
@@ -3988,16 +4064,20 @@ extern List acct_storage_p_remove_associations(mysql_conn_t *mysql_conn,
if(_remove_common(mysql_conn, DBD_REMOVE_ASSOCS, now,
user_name, assoc_table, name_char, assoc_char)
== SLURM_ERROR) {
- list_destroy(ret_list);
xfree(name_char);
xfree(assoc_char);
- return NULL;
+ goto end_it;
}
xfree(name_char);
xfree(assoc_char);
return ret_list;
end_it:
+ if(mysql_conn->rollback) {
+ mysql_db_rollback(mysql_conn->acct_mysql_db);
+ }
+ list_flush(mysql_conn->update_list);
+
if(ret_list) {
list_destroy(ret_list);
ret_list = NULL;
View
2  src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c
@@ -1556,7 +1556,7 @@ extern List jobacct_storage_p_get_jobs_cond(PGconn *acct_pgsql_db,
acct_job_cond_t *job_cond)
{
List job_list = NULL;
-#ifdef HAVE_MYSQL
+#ifdef HAVE_PGSQL
if(!acct_pgsql_db || PQstatus(acct_pgsql_db) != CONNECTION_OK) {
if(!pgsql_get_db_connection(&acct_pgsql_db,
pgsql_db_name, pgsql_db_info))
View
1  src/plugins/task/affinity/dist_tasks.c
@@ -32,6 +32,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\*****************************************************************************/
+#include <limits.h> /* INT_MAX */
#include "src/plugins/task/affinity/dist_tasks.h"
static slurm_lllp_ctx_t *lllp_ctx = NULL; /* binding context */
View
6 src/slurmctld/read_config.c
@@ -374,19 +374,19 @@ static int _build_single_nodeline_info(slurm_conf_node_t *node_ptr,
}
if ((alias_list = hostlist_create(node_ptr->nodenames)) == NULL) {
- error("Unable to create NodeName list from %s",
+ fatal("Unable to create NodeName list from %s",
node_ptr->nodenames);
error_code = errno;
goto cleanup;
}
if ((hostname_list = hostlist_create(node_ptr->hostnames)) == NULL) {
- error("Unable to create NodeHostname list from %s",
+ fatal("Unable to create NodeHostname list from %s",
node_ptr->hostnames);
error_code = errno;
goto cleanup;
}
if ((address_list = hostlist_create(node_ptr->addresses)) == NULL) {
- error("Unable to create NodeAddr list from %s",
+ fatal("Unable to create NodeAddr list from %s",
node_ptr->addresses);
error_code = errno;
goto cleanup;
Please sign in to comment.
Something went wrong with that request. Please try again.