Dataset Viewer
Auto-converted to Parquet Duplicate
diff
stringlengths
136
4.7k
msg
stringlengths
10
129
vccs_msg
stringlengths
0
6.14k
pdg_diff
stringlengths
54
30.7k
type
int64
0
4
diff_seq
stringlengths
71
2.45k
sec
int64
0
1
no_meta_seq
stringlengths
57
3.48k
description_processed
stringlengths
10
8.25k
--- tools/tpm2_getmanufec.c +++ tools/tpm2_getmanufec.c @@ -235,6 +235,12 @@ int createEKHandle(TSS2_SYS_CONTEXT *sapi_context) LOG_INFO("EK create succ.. Handle: 0x%8.8x", handle2048ek); if (!ctx.non_persistent_read) { + + if (!ctx.persistent_handle) { + LOG_ERR("Persistent handle for EK ...
tpm2_getmanufec: only attempt to persist the EK if a handle was provided
tpm2_getmanufec: fix NULL pointer dereference due missing password options option fixing: move to single getopt port tpm2_getmanufec to use common infrastructure #151 Add -X option to enable Hex format password
--- tools/tpm2_getmanufec.c +++ tools/tpm2_getmanufec.c int createEKHandle(TSS2_SYS_CONTEXT *sapi_context) sessionData.sessionHandle = ctx.auth_session_handle; if (ctx.endorse_passwd && strlen(ctx.endorse_passwd) > 0) { if (!ctx.hex_passwd) { memcpy(&sessionData.hmac.t.buffer[0], ctx.end...
0
--- tools/tpm2_getmanufec.c +++ tools/tpm2_getmanufec.c @@ -235,6 +235,12 @@ int createEKHandle(TSS2_SYS_CONTEXT *sapi_context) + + if (!ctx.persistent_handle) { + LOG_ERR("Persistent handle for EK was not provided"); + return 1; + } +
1
LOG_INFO("EK create succ.. Handle: 0x%8.8x", handle2048ek); if (!ctx.non_persistent_read) { + + if (!ctx.persistent_handle) { + LOG_ERR("Persistent handle for EK was not provided"); + return 1; + } + /* * To make EK persistent, use own auth ...
the tool has a -h option to provide a persistent handle to store a ek, but currently is trying to do it even if no handle was provided. make it fail early if that's the case since there's no point in attempting an operation that will fail.
--- tools/tpm2_import.c +++ tools/tpm2_import.c @@ -161,6 +161,7 @@ static bool encrypt_seed_with_tpm2_rsa_public_key(void) { return false; } return_code = RSA_generate_key_ex(rsa, 2048, bne, NULL); + BN_free(bne); if (return_code != 1) { LOG_ERR("RSA_generate_key_ex failed\n"); ...
tpm2_import: free exponent BIGNUM after RSA_generate_key_ex() call
tpm2_import: check if BIGNUM and RSA allocations failed [WIP] tpm2_import: new tool that uses tpm2_import to import a key
--- tools/tpm2_import.c +++ tools/tpm2_import.c static bool encrypt_seed_with_tpm2_rsa_public_key(void) { if (!rsa) { return_code = RSA_generate_key_ex(rsa, 2048, bne, NULL); + BN_free(bne); if (n == NULL) { - BN_free(bne);
0
--- tools/tpm2_import.c +++ tools/tpm2_import.c @@ -161,6 +161,7 @@ static bool encrypt_seed_with_tpm2_rsa_public_key(void) { + BN_free(bne); @@ -178,7 +179,6 @@ static bool encrypt_seed_with_tpm2_rsa_public_key(void) { - BN_free(bne);
1
return false; } return_code = RSA_generate_key_ex(rsa, 2048, bne, NULL); + BN_free(bne); if (return_code != 1) { LOG_ERR("RSA_generate_key_ex failed\n"); return false; LOG_ERR("Failed RSA_public_encrypt\n"); } RSA_free(rsa); - BN_free(bne); return ...
the rsa_generate_key_ex() creates a duplicate of the exponent component passed as an argument, so it can be freed just after the function call.
--- tools/tpm2_verifysignature.c +++ tools/tpm2_verifysignature.c @@ -194,6 +194,14 @@ static bool init(tpm2_verifysig_ctx *ctx) { /* If no digest is specified, compute it */ if (!ctx->flags.digest) { + if (!ctx->flags.msg) { + /* + * This is a redundant check since main() chec...
tpm2_verifysignature: ensure msg is not null
tpm2_verifysignature: port to use new common infrastructure
--- tools/tpm2_verifysignature.c +++ tools/tpm2_verifysignature.c static bool init(tpm2_verifysig_ctx *ctx) { bool res = generate_signature(ctx); if (!ctx->flags.digest) { + if (!ctx->flags.msg) { + /* + * This is a redundant check since main() checks this case, but we'll ad...
0
--- tools/tpm2_verifysignature.c +++ tools/tpm2_verifysignature.c @@ -194,6 +194,14 @@ static bool init(tpm2_verifysig_ctx *ctx) { + if (!ctx->flags.msg) { + /* + * This is a redundant check since main() checks this case, but we'll add it here to silence any + * complainers. + ...
1
/* If no digest is specified, compute it */ if (!ctx->flags.digest) { + if (!ctx->flags.msg) { + /* + * This is a redundant check since main() checks this case, but we'll add it here to silence any + * complainers. + */ + LOG_ERR("No digest se...
some tools complain about msg being null, so add a check to silence them.
--- lib/tpm2_tcti_ldr.c +++ lib/tpm2_tcti_ldr.c @@ -55,7 +55,7 @@ const TSS2_TCTI_INFO *tpm2_tcti_ldr_getinfo(void) { bool tpm2_tcti_ldr_is_tcti_present(const char *name) { char path[PATH_MAX]; - snprintf(path, sizeof(path), "libtss2-tcti-%s.so", name); + snprintf(path, sizeof(path), "libtss2-tcti-%s.so.0...
tcti_ldr: load a specific so version
tools: version show default TCTI
--- lib/tpm2_tcti_ldr.c +++ lib/tpm2_tcti_ldr.c bool tpm2_tcti_ldr_is_tcti_present(const char *name) { - snprintf(path, sizeof(path), "libtss2-tcti-%s.so", name); + snprintf(path, sizeof(path), "libtss2-tcti-%s.so.0", name); void *handle = dlopen (path, RTLD_LAZY);
0
--- lib/tpm2_tcti_ldr.c +++ lib/tpm2_tcti_ldr.c @@ -55,7 +55,7 @@ const TSS2_TCTI_INFO *tpm2_tcti_ldr_getinfo(void) { - snprintf(path, sizeof(path), "libtss2-tcti-%s.so", name); + snprintf(path, sizeof(path), "libtss2-tcti-%s.so.0", name);
1
bool tpm2_tcti_ldr_is_tcti_present(const char *name) { char path[PATH_MAX]; - snprintf(path, sizeof(path), "libtss2-tcti-%s.so", name); + snprintf(path, sizeof(path), "libtss2-tcti-%s.so.0", name); void *handle = dlopen (path, RTLD_LAZY); if (handle) {
use the so version suffix.
--- ldap/servers/slapd/back-ldbm/ldbm_bind.c +++ ldap/servers/slapd/back-ldbm/ldbm_bind.c @@ -76,8 +76,8 @@ ldbm_back_bind(Slapi_PBlock *pb) case LDAP_AUTH_SIMPLE: { Slapi_Value cv; if (slapi_entry_attr_find(e->ep_entry, "userpassword", &attr) != 0) { - slapi_send_ldap_result(pb, LDAP_...
Issue 4609 - CVE - info disclosure when authenticating
Ticket 49328 - Cleanup source code Bug 1347760 - CVE-2016-4992 389-ds-base: Information disclosure via repeated use of LDAP ADD operation, etc. Reduce the number of DN normalization Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. (foxworth)
--- ldap/servers/slapd/dse.c +++ ldap/servers/slapd/dse.c int if (slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &pdse) < 0 || slapi_pblock_get(pb, SLAPI_BIND_TARGET_SDN, &sdn) < 0 || slapi_pblock_get(pb, SLAPI_BIND_METHOD, &method) < 0 || slapi_pblock_get(pb, SLAPI_BIND_CREDENTIALS, &cred) < 0)...
0
--- ldap/servers/slapd/back-ldbm/ldbm_bind.c +++ ldap/servers/slapd/back-ldbm/ldbm_bind.c @@ -76,8 +76,8 @@ ldbm_back_bind(Slapi_PBlock *pb) - slapi_send_ldap_result(pb, LDAP_INAPPROPRIATE_AUTH, NULL, - NULL, 0, NULL); + slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, ...
0
case LDAP_AUTH_SIMPLE: { Slapi_Value cv; if (slapi_entry_attr_find(e->ep_entry, "userpassword", &attr) != 0) { - slapi_send_ldap_result(pb, LDAP_INAPPROPRIATE_AUTH, NULL, - NULL, 0, NULL); + slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, "Entry ...
description: if you bind as a user that does not exist. error is returned instead of error . as error discloses that the entry does not exist. when you bind as an entry that does not have userpassword set then error (inappropriate auth) is returned, but this discloses that the entry does indeed exist. instead we should...
--- ldap/servers/slapd/back-ldbm/ldbm_config.c +++ ldap/servers/slapd/back-ldbm/ldbm_config.c @@ -1243,7 +1243,7 @@ ldbm_config_search_entry_callback(Slapi_PBlock *pb __attribute__((unused)), if (attrs) { for (size_t i = 0; attrs[i]; i++) { if (ldbm_config_moved_attr(a...
Issue 4480 - Unexpected info returned to ldap request (#4491)
Ticket 49476 - refactor ldbm backend to allow replacement of BDB
--- ldap/servers/slapd/back-ldbm/ldbm_config.c +++ ldap/servers/slapd/back-ldbm/ldbm_config.c int ldbm_config_search_entry_callback(Slapi_PBlock *pb __attribute__((unused)), slapi_pblock_get(pb, SLAPI_SEARCH_ATTRS, &attrs); if (ldbm_config_moved_attr(attrs[i])) { - ...
0
--- ldap/servers/slapd/back-ldbm/ldbm_config.c +++ ldap/servers/slapd/back-ldbm/ldbm_config.c @@ -1243,7 +1243,7 @@ ldbm_config_search_entry_callback(Slapi_PBlock *pb __attribute__((unused)), - slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, "at least one required attribute has been moved to the BDB s...
0
if (attrs) { for (size_t i = 0; attrs[i]; i++) { if (ldbm_config_moved_attr(attrs[i])) { - slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, "at least one required attribute has been moved to the BDB scecific configuration entry"); + ...
bug description: if the bind entry does not exist, the bind result info reports that 'no such entry'. it should not give any information if the target entry exists or not fix description: does not return any additional information during a bind
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -795,6 +795,8 @@ int main(int argc, char** argv) unlink(core_basename); } +/* Because of #1211835 and #1126850 */ +#if 0 /* Save JVM crash log if it exists. (JVM's coredump per se * is nearly useless for JVM deve...
ccpp: stop reading hs_error.log from /tmp
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -795,6 +795,8 @@ int main(int argc, char** argv) +/* Because of #1211835 and #1126850 */ +#if 0 @@ -827,6 +829,7 @@ int main(int argc, char** argv) +#endif
0
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -795,6 +795,8 @@ int main(int argc, char** argv) +/* Because of #1211835 and #1126850 */ +#if 0 @@ -827,6 +829,7 @@ int main(int argc, char** argv) +#endif
1
unlink(core_basename); } +/* Because of #1211835 and #1126850 */ +#if 0 /* Save JVM crash log if it exists. (JVM's coredump per se * is nearly useless for JVM developers) */ close(src_fd); } } +#endif /* We close dump...
the file might contain anything and there is no way to verify its contents.
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -718,7 +718,8 @@ int main(int argc, char** argv) if (snprintf(path, sizeof(path), "%s/%s-coredump", g_settings_dump_location, last_slash) >= sizeof(path)) error_msg_and_die("Error saving '%s': truncated long file path", path); - ...
ccpp: save abrt core files only to new files
ccpp: ignore crashes of ABRT binaries if DebugLevel == 0 ccpp: check for overflow in abrt coredump path creation handle crashes in suided apps as kernel does, partially fixes rhbz#783450 rhbz#785163 Initial git commit
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c int main(int argc, char** argv) g_user_core_flags = O_EXCL; if (g_settings_debug_level == 0) if (snprintf(path, sizeof(path), "%s/%s-coredump", g_settings_dump_location, last_slash) >= sizeof(path)) error_msg_and_die("...
0
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -718,7 +718,8 @@ int main(int argc, char** argv) - int abrt_core_fd = xopen3(path, O_WRONLY | O_CREAT | O_TRUNC, 0600); + unlink(path); + int abrt_core_fd = xopen3(path, O_WRONLY | O_CREAT | O_EXCL, 0600);
1
if (snprintf(path, sizeof(path), "%s/%s-coredump", g_settings_dump_location, last_slash) >= sizeof(path)) error_msg_and_die("Error saving '%s': truncated long file path", path); - int abrt_core_fd = xopen3(path, O_WRONLY | O_CREAT | O_TRUNC, 0600); + unlink(path); + int abrt...
prior this commit abrt-hook-ccpp saved a core file generated by a process running a program whose name starts with "abrt" in dump_location/$(basename program)-coredump. if the file was a symlink, the hook followed and wrote core file to the symlink's target. addresses cve-2015-5287
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -678,7 +678,7 @@ int main(int argc, char** argv) { char *rootdir = get_rootdir(pid); - dd_create_basic_files(dd, fsuid, (rootdir && strcmp(rootdir, "/") != 0) ? rootdir : NULL); + dd_create_basic_files(dd, fsuid, NULL); ...
ccpp: do not read data from root directories
ccpp: fix symlink race conditions synchronize default dump dir mode with libreport ccpp-hook: fixed one nasty segfault rhbz#671354 - [RFE] Configurable core dump location change dd_create API to return dd pointer (no need to dd_init it separately) DebugDump.cpp: lowercase and rename functions Initial git commit
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c int main(int argc, char** argv) g_settings_dump_location, iso_date_string(NULL), (long)pid); dd = dd_create(path, fsuid, DEFAULT_DUMP_DIR_MODE); if (dd) char *rootdir = get_rootdir(pid); - dd_create_basic_files(dd, fsuid, ...
0
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -678,7 +678,7 @@ int main(int argc, char** argv) - dd_create_basic_files(dd, fsuid, (rootdir && strcmp(rootdir, "/") != 0) ? rootdir : NULL); + dd_create_basic_files(dd, fsuid, NULL);
1
{ char *rootdir = get_rootdir(pid); - dd_create_basic_files(dd, fsuid, (rootdir && strcmp(rootdir, "/") != 0) ? rootdir : NULL); + dd_create_basic_files(dd, fsuid, NULL); char source_filename[sizeof("/proc/%lu/somewhat_long_name") + sizeof(long)*3]; int source_base_ofs ...
users are allowed to modify /proc/[pid]/root to any directory by running their own mount namespace.
--- src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c +++ src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c @@ -182,6 +182,9 @@ int main(int argc, char **argv) if (u != 0) strcpy(path_env, "PATH=/usr/bin:/bin:"BIN_DIR); putenv(path_env); + + /* Use safe umask */ + ...
a-a-i-d-t-a-cache: sanitize umask
abrt-action-install-debuginfo: set real uid/gid to euid/gid run abrt-action-install-debuginfo.py using trivial sgid wrapper
--- src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c +++ src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c int main(int argc, char **argv) if (u != getuid()) + /* Use safe umask */ + umask(0022);
0
--- src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c +++ src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c @@ -182,6 +182,9 @@ int main(int argc, char **argv) + + /* Use safe umask */ + umask(0022);
0
if (u != 0) strcpy(path_env, "PATH=/usr/bin:/bin:"BIN_DIR); putenv(path_env); + + /* Use safe umask */ + umask(0022); } execvp(EXECUTABLE, (char **)args);
we cannot trust anything when running suided program.
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -399,7 +399,7 @@ static int open_user_core(uid_t uid, uid_t fsuid, pid_t pid, char **percent_valu static bool dump_fd_info(const char *dest_filename, char *source_filename, int source_base_ofs, uid_t uid, gid_t gid) { - FILE *fp = fopen(dest_filena...
ccpp: open file for dump_fd_info with O_EXCL
abrt-hook-ccpp: save limits, fd/N and fdinfo/N as "limits" and "open_fds" elements
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c static bool dump_fd_info(const char *dest_filename, char *source_filename, int source_base_ofs, uid_t uid, gid_t gid) - FILE *fp = fopen(dest_filename, "w"); + FILE *fp = fopen(dest_filename, "wx"); if (!fp) perror_msg("Can't change '%s' ...
0
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -399,7 +399,7 @@ static int open_user_core(uid_t uid, uid_t fsuid, pid_t pid, char **percent_valu - FILE *fp = fopen(dest_filename, "w"); + FILE *fp = fopen(dest_filename, "wx");
1
static bool dump_fd_info(const char *dest_filename, char *source_filename, int source_base_ofs, uid_t uid, gid_t gid) { - FILE *fp = fopen(dest_filename, "w"); + FILE *fp = fopen(dest_filename, "wx"); if (!fp) return false;
to avoid possible races.
--- src/dbus/abrt-dbus.c +++ src/dbus/abrt-dbus.c @@ -599,7 +599,7 @@ static void handle_method_call(GDBusConnection *connection, g_variant_get(parameters, "(&s&s&s)", &problem_id, &element, &value); - if (element == NULL || element[0] == '\0' || strlen(element) > 64) + if (!str_is_correct_fi...
dbus: report invalid element names
Use log_ family instead of VERBn log calls introduce DeleteElement D-Bus method introduce SetElement D-Bus method initial abrt-dbus API rewrite using glib
--- src/dbus/abrt-dbus.c +++ src/dbus/abrt-dbus.c static void handle_method_call(GDBusConnection *connection, caller_uid = get_caller_uid(connection, invocation, caller); if (g_strcmp0(method_name, "SetElement") == 0) g_variant_get(parameters, "(&s&s&s)", &problem_id, &element, &value); - if (el...
0
--- src/dbus/abrt-dbus.c +++ src/dbus/abrt-dbus.c @@ -599,7 +599,7 @@ static void handle_method_call(GDBusConnection *connection, - if (element == NULL || element[0] == '\0' || strlen(element) > 64) + if (!str_is_correct_filename(element)) @@ -658,6 +658,18 @@ static void handle_method_call(GDBusConnectio...
0
g_variant_get(parameters, "(&s&s&s)", &problem_id, &element, &value); - if (element == NULL || element[0] == '\0' || strlen(element) > 64) + if (!str_is_correct_filename(element)) { log_notice("'%s' is not a valid element name of '%s'", element, problem_id); ...
return d-bus error in case of invalid problem element name.
--- OpenEXR/IlmImf/ImfMultiPartInputFile.cpp +++ OpenEXR/IlmImf/ImfMultiPartInputFile.cpp @@ -571,7 +571,7 @@ MultiPartInputFile::Data::chunkOffsetReconstruction(OPENEXR_IMF_INTERNAL_NAMESPA - if(partNumber<0 || partNumber> static_cast<int>(parts.size())) + ...
Fix #491, issue with part number range check reconstructing chunk offset table
use static_cast in error test
--- OpenEXR/IlmImf/ImfMultiPartInputFile.cpp +++ OpenEXR/IlmImf/ImfMultiPartInputFile.cpp @@ -571,7 +571,7 @@ MultiPartInputFile::Data::chunkOffsetReconstruction(OPENEXR_IMF_INTERNAL_NAMESPA - if(partNumber<0 || partNumber> static_cast<int>(parts.size())) + if(partNumber<0 || partNumber>= static_c...
3
--- OpenEXR/IlmImf/ImfMultiPartInputFile.cpp +++ OpenEXR/IlmImf/ImfMultiPartInputFile.cpp @@ -571,7 +571,7 @@ MultiPartInputFile::Data::chunkOffsetReconstruction(OPENEXR_IMF_INTERNAL_NAMESPA - if(partNumber<0 || partNumber> static_cast<int>(parts.size())) + if(partNumber<0 || partNumber>= static_c...
0
- if(partNumber<0 || partNumber> static_cast<int>(parts.size())) + if(partNumber<0 || partNumber>= static_cast<int>(parts.size())) { throw IEX_NAMESPACE::IoExc("part number out of range"); }
the chunk offset was incorrectly testing for a part number that was the same size (i.e. an invalid index)
--- keepalived/core/main.c +++ keepalived/core/main.c @@ -882,7 +882,7 @@ set_umask(const char *optarg) if (*endptr || umask_long < 0 || umask_long & ~0777L) { fprintf(stderr, "Invalid --umask option %s", optarg); - return; + return 0; } umask_val = umask_long & 0777;
Fix compile warning introduced in commit c6247a9
Add command line and configuration option to set umask
--- keepalived/core/main.c +++ keepalived/core/main.c static mode_t if (*endptr || umask_long < 0 || umask_long & ~0777L) { - return; + return 0;
4
--- keepalived/core/main.c +++ keepalived/core/main.c @@ -882,7 +882,7 @@ set_umask(const char *optarg) - return; + return 0;
1
if (*endptr || umask_long < 0 || umask_long & ~0777L) { fprintf(stderr, "Invalid --umask option %s", optarg); - return; + return 0; } umask_val = umask_long & 0777;
commit c6247a9 - "add command line and configuration option to set umask" introduced a compile warning, although the code would have worked ok.
--- source/components/disassembler/dmresrc.c +++ source/components/disassembler/dmresrc.c @@ -544,6 +544,15 @@ AcpiDmIsResourceTemplate ( * intialization byte list. Because the resource macros will create * a buffer of the exact required length (buffer length will be equal * to the actual length). + ...
Add new comment, no functional change
--- source/components/disassembler/dmresrc.c +++ source/components/disassembler/dmresrc.c @@ -544,6 +544,15 @@ AcpiDmIsResourceTemplate ( + * + * NOTE (April 2017): Resource templates with this issue have been + * seen in the field. We still don't want to attempt to disassemble + * a buffer like this to...
1
--- source/components/disassembler/dmresrc.c +++ source/components/disassembler/dmresrc.c @@ -544,6 +544,15 @@ AcpiDmIsResourceTemplate ( + * + * NOTE (April 2017): Resource templates with this issue have been + * seen in the field. We still don't want to attempt to disassemble + * a buffer like this to...
1
* intialization byte list. Because the resource macros will create * a buffer of the exact required length (buffer length will be equal * to the actual length). + * + * NOTE (April 2017): Resource templates with this issue have been + * seen in the field. We still don't want to attempt to ...
new comment for disassembling buffers to resource templates.
--- source/components/namespace/nsxfname.c +++ source/components/namespace/nsxfname.c @@ -239,7 +239,7 @@ AcpiGetHandle ( { ACPI_STATUS Status; NAME_TABLE_ENTRY *ThisEntry; - ACPI_HANDLE Scope = NULL; + NAME_TABLE_ENTRY *Scope = NULL; if (!RetHandle || !Path...
Fixed bug in AcpiGetHandle(): searching for a relative path always
date 2000.01.07.00.31.00; author psdiefen; state Exp; New name/handle interfaces "Scope" parameter changed to "Parent" Eliminated "Name Tables" and replaced with "Named Objects"
--- source/components/namespace/nsxfname.c +++ source/components/namespace/nsxfname.c ACPI_STATUS ACPI_HANDLE Parent, - ACPI_HANDLE Scope = NULL; + NAME_TABLE_ENTRY *Scope = NULL; if (Parent) - Scope = Parent->Scope; + Scope = ((NAME_TABLE_ENTRY*) Parent)...
0
--- source/components/namespace/nsxfname.c +++ source/components/namespace/nsxfname.c @@ -239,7 +239,7 @@ AcpiGetHandle ( - ACPI_HANDLE Scope = NULL; + NAME_TABLE_ENTRY *Scope = NULL; @@ -247,7 +247,7 @@ AcpiGetHandle ( - Scope = Parent->Scope; + Scope = ((NAME_TABLE_ENTRY*) Paren...
1
{ ACPI_STATUS Status; NAME_TABLE_ENTRY *ThisEntry; - ACPI_HANDLE Scope = NULL; + NAME_TABLE_ENTRY *Scope = NULL; if (!RetHandle || !Pathname) { } if (Parent) - Scope = Parent->Scope; + Scope = ((NAME_TABLE_ENTRY*) Parent)->Scop...
failed because search being done at parent rather than parent->scope.
--- source/compiler/aslerror.c +++ source/compiler/aslerror.c @@ -247,6 +247,11 @@ AePrintException ( FILE *SourceFile; + if (Gbl_NoErrors) + { + return; + } + /* * Only listing files have a header, and remarks/optimizations * are always output --- source/co...
iASL: Add option to display summary only.
Support for iASL - multiple files and wildcards. Implemented several new compiler warnings Changes to track resource header changes strupr not POSIX, always use local AcpiUtStrupr Changed ASM include file extension to .INC Added -g switch to get all acpi tables Even more option fussing Overhaul of options, using new Ac...
--- source/compiler/aslmain.c +++ source/compiler/aslmain.c static void + printf (" -va Disable all errors and warnings (summary only)\n"); static int Gbl_Acpi2 = TRUE; BadCommandLine = TRUE; Gbl_DebugFlag = TRUE; Gbl_ParseOnlyFlag = TRUE; BadCommandLine =...
1
--- source/compiler/aslerror.c +++ source/compiler/aslerror.c @@ -247,6 +247,11 @@ AePrintException ( + if (Gbl_NoErrors) + { + return; + } + --- source/compiler/aslglobal.h +++ source/compiler/aslglobal.h @@ -188,6 +188,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ParseOnlyFlag, FALSE)...
1
FILE *SourceFile; + if (Gbl_NoErrors) + { + return; + } + /* * Only listing files have a header, and remarks/optimizations * are always output ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileTimesFlag, FALSE); ASL_EXTERN BOOLEAN ...
added -va option to disable all errors and warnings, and display the summary info only. useful for large batch compiles.
--- source/components/hardware/hwgpe.c +++ source/components/hardware/hwgpe.c @@ -222,7 +222,7 @@ AcpiHwLowSetGpe ( break; default: - ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u\n", Action)); + ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u", Action)); return (AE_BAD_PARAMETER); ...
Remove some extraneous newlines in ACPI_ERROR type calls..
Split large dsopcode.c and dsload.c files. Update for GPE enabling/disabling. Standardize integer output for ACPICA warnings/errors.
--- source/components/hardware/hwgpe.c +++ source/components/hardware/hwgpe.c ACPI_STATUS UINT32 Action) switch (Action) - ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u\n", Action)); + ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u", Action)); --- source/components/dispatcher/dso...
0
--- source/components/hardware/hwgpe.c +++ source/components/hardware/hwgpe.c @@ -222,7 +222,7 @@ AcpiHwLowSetGpe ( - ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u\n", Action)); + ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u", Action)); --- source/components/dispatcher/dswload2.c +++ source/components/di...
1
break; default: - ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u\n", Action)); + ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u", Action)); return (AE_BAD_PARAMETER); } */ ACPI_WARNING ((AE_INFO, "Type override - [%4.4s] had invali...
these macros/functions automatically insert a newline, so the format string should not contain a newline at the end. (this allows these functions to add information to the end of the output line.)
--- source/components/namespace/nseval.c +++ source/components/namespace/nseval.c @@ -428,6 +428,16 @@ AcpiNsEvaluate ( Status = AE_OK; } + else if (ACPI_FAILURE(Status)) + { + /* If ReturnObject exists, delete it */ + + if (Info->ReturnObject) + { + AcpiUtRemoveR...
acpi: acpica: fix acpi operand cache leak in nseval.c
Add argument typechecking for all predefined ACPI names. Consolidate method arg count validation code. Additional restructuring and cleanup of namespace evaluation functions Cleanup Deadlock fix - must unlock namespace before entering interpreter Broke up ExecuteMethod into two procedures
--- source/components/namespace/nseval.c +++ source/components/namespace/nseval.c ACPI_STATUS Info->ReturnObject = NULL; ACPI_NAMESPACE_NODE, &Info->ReturnObject), NULL); Info->ReturnObject, (void) AcpiNsCheckReturnValue (Info->Node, Info, Info->ParamCount, Status, &Info->ReturnO...
4
--- source/components/namespace/nseval.c +++ source/components/namespace/nseval.c @@ -428,6 +428,16 @@ AcpiNsEvaluate ( + else if (ACPI_FAILURE(Status)) + { + /* If ReturnObject exists, delete it */ + + if (Info->ReturnObject) + { + AcpiUtRemoveReference (Info->ReturnObject); + ...
0
Status = AE_OK; } + else if (ACPI_FAILURE(Status)) + { + /* If ReturnObject exists, delete it */ + + if (Info->ReturnObject) + { + AcpiUtRemoveReference (Info->ReturnObject); + Info->ReturnObject = NULL; + } + } ACPI_DEBUG_PRINT ((ACPI_...
i found an acpi cache leak in acpi early termination and boot continuing case. when early termination occurs due to malicious acpi table, linux kernel terminates acpi function and continues to boot process. while kernel terminates acpi function, kmem_cache_destroy() reports acpi-operand cache leak. boot log of acpi o...
--- source/components/tables/tbinstal.c +++ source/components/tables/tbinstal.c @@ -236,7 +236,7 @@ AcpiTbInstallTableWithOverride ( * DESCRIPTION: This function is called to verify and install an ACPI table. * When this function is called by "Load" or "LoadTable" opcodes, * or by AcpiLo...
Tables: Fix spelling mistake in comment
--- source/components/tables/tbinstal.c +++ source/components/tables/tbinstal.c @@ -236,7 +236,7 @@ AcpiTbInstallTableWithOverride ( - * After sucessfully returning from this function, table is + * After successfully returning from this function, table is
4
--- source/components/tables/tbinstal.c +++ source/components/tables/tbinstal.c @@ -236,7 +236,7 @@ AcpiTbInstallTableWithOverride ( - * After sucessfully returning from this function, table is + * After successfully returning from this function, table is
1
* DESCRIPTION: This function is called to verify and install an ACPI table. * When this function is called by "Load" or "LoadTable" opcodes, * or by AcpiLoadTable() API, the "Reload" parameter is set. - * After sucessfully returning from this function, table is + * ...
the spelling of "sucessfully" should be "successfully", fix this
--- source/components/events/evxfregn.c +++ source/components/events/evxfregn.c @@ -139,6 +139,12 @@ * * DESCRIPTION: Install a handler for all OpRegions of a given SpaceId. * + * NOTE: This function should only be called after AcpiEnableSubsystem has + * been called. This is because any _REG methods associated w...
Comment update; no functional change.
--- source/components/events/evxfregn.c +++ source/components/events/evxfregn.c @@ -139,6 +139,12 @@ + * NOTE: This function should only be called after AcpiEnableSubsystem has + * been called. This is because any _REG methods associated with the Space ID + * are executed here, and these methods can only be safely exec...
0
--- source/components/events/evxfregn.c +++ source/components/events/evxfregn.c @@ -139,6 +139,12 @@ + * NOTE: This function should only be called after AcpiEnableSubsystem has + * been called. This is because any _REG methods associated with the Space ID + * are executed here, and these methods can only be safely exec...
1
* * DESCRIPTION: Install a handler for all OpRegions of a given SpaceId. * + * NOTE: This function should only be called after AcpiEnableSubsystem has + * been called. This is because any _REG methods associated with the Space ID + * are executed here, and these methods can only be safely executed after + * the d...
add a usage note to installaddressspacehandler.
--- source/components/executer/exfldio.c +++ source/components/executer/exfldio.c @@ -613,13 +613,13 @@ AcpiExFieldDatumIo ( return_ACPI_STATUS (Status); } - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "I/O to Data Register: ValuePtr %p\n", Value)); - if (ReadWrite == ACPI_RE...
Update debug output for IndexField I/O.
Cleanup/formatting Add 2006 copyright Restructured field read code (again) to fix region overrun if Fix for Index Fields; Fix for write beyond end-of-field Removed ACPI_READ_ADR_SPACE (and WRITE). Uses common ACPI_READ and Implemented 64-bit field support for ACPI 2.0 Fix to zero upper unused bits for fields that span...
--- source/components/executer/exfldio.c +++ source/components/executer/exfldio.c static ACPI_STATUS ACPI_INTEGER *Value, if (!Value) Value = &LocalValue; *Value = 0; switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - ACPI_DEBUG_PR...
0
--- source/components/executer/exfldio.c +++ source/components/executer/exfldio.c @@ -613,13 +613,13 @@ AcpiExFieldDatumIo ( - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "I/O to Data Register: ValuePtr %p\n", Value)); - + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Read from Data Registe...
1
return_ACPI_STATUS (Status); } - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "I/O to Data Register: ValuePtr %p\n", Value)); - if (ReadWrite == ACPI_READ) { /* Read the datum from the DataRegister */ + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + ...
split the "data register i/o" with more informative read and write messages.
--- source/components/debugger/dbstats.c +++ source/components/debugger/dbstats.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbstats - Generation and display of ACPI table statistics - * $Revision: 1.89 $ + * $Revision...
Added additional object to SIZES command.
--- source/components/debugger/dbstats.c +++ source/components/debugger/dbstats.c * $Revision: 1.89 $ - * $Revision: 1.89 $ + * $Revision: 1.90 $ + AcpiOsPrintf ("AcpiObject %3d\n", sizeof (ACPI_OBJECT));
0
--- source/components/debugger/dbstats.c +++ source/components/debugger/dbstats.c @@ -1,7 +1,7 @@ - * $Revision: 1.89 $ + * $Revision: 1.90 $ @@ -592,6 +592,7 @@ AcpiDbDisplayStatistics ( + AcpiOsPrintf ("AcpiObject %3d\n", sizeof (ACPI_OBJECT));
1
/******************************************************************************* * * Module Name: dbstats - Generation and display of ACPI table statistics - * $Revision: 1.89 $ + * $Revision: 1.90 $ * ******************************************************************************/ ...
added acpi_object to the object sizes dumped by statistics/sizes
--- source/tools/acpiexec/aehandlers.c +++ source/tools/acpiexec/aehandlers.c @@ -1127,11 +1127,21 @@ AeInstallEarlyHandlers ( Status = AcpiDetachData (Handle, AeAttachedDataHandler); AE_CHECK_OK (AcpiDetachData, Status); - Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle); + ...
AcpiExec: Add support to test attach/delete root node objects.
Revert "AcpiExec: Add support to test attach/delete root node objects." AcpiExec: Add test for multiple attach data and node deletion. AcpiExec: Use ACPI_ROOT_OBJECT where appropriate. iASL/tools: Lint changes. Fix several AcpiAttachData problems. acpiexec: split large source file.
--- source/tools/acpiexec/aehandlers.c +++ source/tools/acpiexec/aehandlers.c ACPI_STATUS Status = AcpiInstallNotifyHandler (ACPI_ROOT_OBJECT, ACPI_DEVICE_NOTIFY, Status = AcpiGetHandle (NULL, "\\_SB", &Handle); if (ACPI_SUCCESS (Status)) AE_CHECK_OK (AcpiAttachData, Status); Status = AcpiDe...
1
--- source/tools/acpiexec/aehandlers.c +++ source/tools/acpiexec/aehandlers.c @@ -1127,11 +1127,21 @@ AeInstallEarlyHandlers ( - Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle); + /* Test attach data at the root object */ + + Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedData...
1
Status = AcpiDetachData (Handle, AeAttachedDataHandler); AE_CHECK_OK (AcpiDetachData, Status); - Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle); + /* Test attach data at the root object */ + + Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler, + ...
this change attaches two objects to the root node to test both the attach and the actual object deletion upon acpica termination. /10/14: patched reapplied after fixing inifinite loop error it exposed when it was first applied. dave box
--- source/components/utilities/utdecode.c +++ source/components/utilities/utdecode.c @@ -629,9 +629,9 @@ static const char *AcpiGbl_GenericNotify[ACPI_GENERIC_NOTIFY_MAX + 1] /* 09 */ "Device PLD Check", /* 0A */ "Reserved", /* 0B */ "System Locality Update", - /* 0C */ "Shutdown Request", ...
Utilities: Make a notify value reserved
--- source/components/utilities/utdecode.c +++ source/components/utilities/utdecode.c @@ -629,9 +629,9 @@ static const char *AcpiGbl_GenericNotify[ACPI_GENERIC_NOTIFY_MAX + 1] - /* 0C */ "Shutdown Request", /* Reserved in ACPI 6.0 */ + /* 0C */ "Reserved (was previously Shutdown Request)", /* Reserved ...
0
--- source/components/utilities/utdecode.c +++ source/components/utilities/utdecode.c @@ -629,9 +629,9 @@ static const char *AcpiGbl_GenericNotify[ACPI_GENERIC_NOTIFY_MAX + 1] - /* 0C */ "Shutdown Request", /* Reserved in ACPI 6.0 */ + /* 0C */ "Reserved (was previously Shutdown Request)", /* Reserved ...
1
/* 09 */ "Device PLD Check", /* 0A */ "Reserved", /* 0B */ "System Locality Update", - /* 0C */ "Shutdown Request", /* Reserved in ACPI 6.0 */ + /* 0C */ "Reserved (was previously Shutdown Request)", /* Reserved in ACPI 6.0 */ /* 0D */ "System Resource Affinity Update", - /* 0E */ "Heterog...
x0c (graceful shutdown) is now reverted to reserved. x81 takes the place of this value.
--- source/include/platform/acenv.h +++ source/include/platform/acenv.h @@ -224,8 +224,8 @@ typedef char *va_list; #endif /* va_arg */ -#define STRSTR(s1,s2) __strstr((char *) (s1), (char *) (s2)) -#define STRUPR(s) _strupr((char *) (s)) +#define STRSTR(s1,s2) _strstr((char *) (s1...
Changed _strupr to __strupr (two __) unable to link on WDM because
--- source/include/platform/acenv.h +++ source/include/platform/acenv.h @@ -224,8 +224,8 @@ typedef char *va_list; -#define STRSTR(s1,s2) __strstr((char *) (s1), (char *) (s2)) -#define STRUPR(s) _strupr((char *) (s)) +#define STRSTR(s1,s2) _strstr((char *) (s1), (char *) (s2)) +#defin...
0
--- source/include/platform/acenv.h +++ source/include/platform/acenv.h @@ -224,8 +224,8 @@ typedef char *va_list; -#define STRSTR(s1,s2) __strstr((char *) (s1), (char *) (s2)) -#define STRUPR(s) _strupr((char *) (s)) +#define STRSTR(s1,s2) _strstr((char *) (s1), (char *) (s2)) +#defin...
1
#endif /* va_arg */ -#define STRSTR(s1,s2) __strstr((char *) (s1), (char *) (s2)) -#define STRUPR(s) _strupr((char *) (s)) +#define STRSTR(s1,s2) _strstr((char *) (s1), (char *) (s2)) +#define STRUPR(s) __strupr((char *) (s)) #define STRLEN(s) _strlen(...
there is a _strupr already in the wdm libs slightly different types. rolled back previous change to _strstr.
--- source/components/events/evgpe.c +++ source/components/events/evgpe.c @@ -494,6 +494,16 @@ AcpiEvGpeDetect ( GpeRegisterInfo = &GpeBlock->RegisterInfo[i]; + /* + * Optimization: If there are no GPEs enabled within this + * register, we can safely ignore the entire...
GPE detect optimization - ignore unused GPE registers.
Add 64-bit support to AcpiRead and AcpiWrite. Split out the GPE Block support to a new file Added 2003 copyright to the legal header
--- source/components/events/evgpe.c +++ source/components/events/evgpe.c UINT32 for (i = 0; i < GpeBlock->RegisterCount; i++) GpeRegisterInfo = &GpeBlock->RegisterInfo[i]; + /* + * Optimization: If there are no GPEs enabled within this + * register, we can safe...
0
--- source/components/events/evgpe.c +++ source/components/events/evgpe.c @@ -494,6 +494,16 @@ AcpiEvGpeDetect ( + /* + * Optimization: If there are no GPEs enabled within this + * register, we can safely ignore the entire register. + */ + if (!(GpeRegisterInfo-...
1
GpeRegisterInfo = &GpeBlock->RegisterInfo[i]; + /* + * Optimization: If there are no GPEs enabled within this + * register, we can safely ignore the entire register. + */ + if (!(GpeRegisterInfo->EnableForRun | + GpeRegisterInfo...
this optimization will simply ignore gpe registers that contain no enabled gpes - there is no need to read the register. acpica bugzilla . lin ming. suggestion from joe liu.
--- source/components/namespace/nsdump.c +++ source/components/namespace/nsdump.c @@ -287,6 +287,13 @@ AcpiNsDumpOneObject ( } ThisNode = AcpiNsMapHandleToNode (ObjHandle); + if (!ThisNode) + { + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n", + ObjHandle)); + r...
Add error check to debug object dump routine.
--- source/components/namespace/nsdump.c +++ source/components/namespace/nsdump.c @@ -287,6 +287,13 @@ AcpiNsDumpOneObject ( + if (!ThisNode) + { + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n", + ObjHandle)); + return (AE_OK); + } +
1
--- source/components/namespace/nsdump.c +++ source/components/namespace/nsdump.c @@ -287,6 +287,13 @@ AcpiNsDumpOneObject ( + if (!ThisNode) + { + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n", + ObjHandle)); + return (AE_OK); + } +
1
} ThisNode = AcpiNsMapHandleToNode (ObjHandle); + if (!ThisNode) + { + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n", + ObjHandle)); + return (AE_OK); + } + Type = ThisNode->Type; /* Check if the owner matches */
add check for invalid handle in nsdumponeobject.
--- source/tools/acpidump/apdump.c +++ source/tools/acpidump/apdump.c @@ -154,7 +154,7 @@ ApIsValidHeader ( /* Check for minimum table length */ - if (Table->Length <= sizeof (ACPI_TABLE_HEADER)) + if (Table->Length < sizeof (ACPI_TABLE_HEADER)) { fprintf (stderr, "Table...
AcpiDump: Allow tables that contain only an ACPI table header.
New: Portable acpidump utility (get system ACPI tables).
--- source/tools/acpidump/apdump.c +++ source/tools/acpidump/apdump.c BOOLEAN ACPI_TABLE_HEADER *Table) if (!AcpiUtValidAcpiName (Table->Signature)) - if (Table->Length <= sizeof (ACPI_TABLE_HEADER)) + if (Table->Length < sizeof (ACPI_TABLE_HEADER)) fprintf (stderr, "Table ...
0
--- source/tools/acpidump/apdump.c +++ source/tools/acpidump/apdump.c @@ -154,7 +154,7 @@ ApIsValidHeader ( - if (Table->Length <= sizeof (ACPI_TABLE_HEADER)) + if (Table->Length < sizeof (ACPI_TABLE_HEADER))
1
/* Check for minimum table length */ - if (Table->Length <= sizeof (ACPI_TABLE_HEADER)) + if (Table->Length < sizeof (ACPI_TABLE_HEADER)) { fprintf (stderr, "Table length (0x%8.8X) is invalid\n", Table->Length);
apparently, some bioss create ssdts that contain an acpi table header but no other data. this change adds support to dump these tables. any tables shorter than the length of an acpi table header remain in error. (an error message is emitted.) reported by yi li.
--- source/components/hardware/hwregs.c +++ source/components/hardware/hwregs.c @@ -382,17 +382,19 @@ AcpiHwClearAcpiStatus ( Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS, ACPI_BITMASK_ALL_FIXED_STATUS); + + AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags); + if (ACPI_FAILUR...
Hardware: Fix possible recursive locking in hwregs.c
Convert hardware mutex to a spinlock, since code is used at xrupt level Fourth pass to include lint changes/comments/cleanup (64-bit)
--- source/components/hardware/hwregs.c +++ source/components/hardware/hwregs.c ACPI_STATUS LockFlags = AcpiOsAcquireLock (AcpiGbl_HardwareLock); if (ACPI_FAILURE (Status)) - goto UnlockAndExit; + AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags); } - UnlockAndExit: - AcpiOsReleaseLock (Ac...
4
--- source/components/hardware/hwregs.c +++ source/components/hardware/hwregs.c @@ -382,17 +382,19 @@ AcpiHwClearAcpiStatus ( + + AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags); + - goto UnlockAndExit; + goto Exit; -UnlockAndExit: - AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags); +Exit:
1
Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS, ACPI_BITMASK_ALL_FIXED_STATUS); + + AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags); + if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + goto Exit; } /* Clear the GPE Bits in all GPE registers i...
in linux calling pm-suspend might trigger a recursive lock in it's code path. in function acpihwclearacpistatus(), acpiosacquirelock() holds the lock acpigbl_hardwarelock before calling acpihwregisterwrite(), then without releasing acpigbl_hardwarelock, this function calls acpievwalkgpelist(), which tries to hold acpig...
--- source/components/parser/psargs.c +++ source/components/parser/psargs.c @@ -1051,6 +1051,9 @@ AcpiPsGetNextArg ( if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP) { + /* Free method call op and corresponding namestring sub-ob */ + + AcpiPsFreeOp (Arg->Comm...
Fix memory leak on unusual memory leak
Fix a problem with recent extra support for control method invocations Parser: Allow method invocations as target operands Enhanced error checking for namepath arguments
--- source/components/parser/psargs.c +++ source/components/parser/psargs.c ACPI_STATUS Arg, ACPI_POSSIBLE_METHOD_CALL); if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP) + /* Free method call op and corresponding namestring sub-ob */ + AcpiPsFreeOp (Arg->Co...
2
--- source/components/parser/psargs.c +++ source/components/parser/psargs.c @@ -1051,6 +1051,9 @@ AcpiPsGetNextArg ( + /* Free method call op and corresponding namestring sub-ob */ + + AcpiPsFreeOp (Arg->Common.Value.Arg);
1
if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP) { + /* Free method call op and corresponding namestring sub-ob */ + + AcpiPsFreeOp (Arg->Common.Value.Arg); AcpiPsFreeOp (Arg); Arg = NULL; WalkState->ArgCount...
fixes a single-object memory leak on a store-to-reference method invocation. acpica bz .
--- source/components/events/evgpeblk.c +++ source/components/events/evgpeblk.c @@ -613,6 +613,19 @@ AcpiEvInitializeGpeBlock ( GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j; GpeEventInfo = &GpeBlock->EventInfo[GpeIndex]; + GpeNumber = GpeIndex + GpeBlock->BlockBaseNumber; + + ...
Ensure GPEs are not enabled twice.
Add GPE support for dynamically loaded ACPI tables. Major update for GPE support code for shared GPEs. Split GPE block init to allow deferred execution of _PRW methods Support for WAKE vs RUNTIME GPEs
--- source/components/events/evgpeblk.c +++ source/components/events/evgpeblk.c ACPI_STATUS ACPI_NAMESPACE_NODE *GpeDevice, if (!GpeBlock) WalkInfo.GpeBlock = GpeBlock; GpeEnabledCount = 0; if (GpeDevice == AcpiGbl_FadtGpeDevice) GpeDevice = NULL; for (j = 0; j < ACPI_GPE_REG...
0
--- source/components/events/evgpeblk.c +++ source/components/events/evgpeblk.c @@ -613,6 +613,19 @@ AcpiEvInitializeGpeBlock ( + GpeNumber = GpeIndex + GpeBlock->BlockBaseNumber; + + /* + * If the GPE has already been enabled for runtime + * signalling, make sure that it r...
1
GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j; GpeEventInfo = &GpeBlock->EventInfo[GpeIndex]; + GpeNumber = GpeIndex + GpeBlock->BlockBaseNumber; + + /* + * If the GPE has already been enabled for runtime + * signalling, make sure that it remains ...
while developing the gpe reference counting code we overlooked the fact that acpi_ev_update_gpes() could have enabled gpes before acpi_ev_initialize_gpe_block() was called. as a result, some gpes are enabled twice during the initialization. to fix this issue avoid calling acpi_enable_gpe() from acpi_ev_initialize_gpe_...
--- source/compiler/aslwalks.c +++ source/compiler/aslwalks.c @@ -176,9 +176,12 @@ AnMethodTypingWalkEnd ( * The called method is untyped at this time (typically a * forward reference). * - * Check for a recursive method call first. + ...
iASL: Fix a possible fault in a Return statement
Improve typechecking, both compile-time and runtime iASL: Cleanup use of TrWalkParseTree, eliminate null callbacks. iASL: Split large file aslanalyze.c into three files.
--- source/compiler/aslwalks.c +++ source/compiler/aslwalks.c ACPI_STATUS ACPI_PARSE_OBJECT *Op, ThisOpBtype = AnGetBtype (Op->Asl.Child); if ((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_METHODCALL) && - * Check for a recursive method call first. + * Ch...
4
--- source/compiler/aslwalks.c +++ source/compiler/aslwalks.c @@ -176,9 +176,12 @@ AnMethodTypingWalkEnd ( - * Check for a recursive method call first. + * Check for a recursive method call first. Note: the + * Child->Node will be null if the method has not been + ...
1
* The called method is untyped at this time (typically a * forward reference). * - * Check for a recursive method call first. + * Check for a recursive method call first. Note: the + * Child->Node will be null if the m...
fault if the return value is a method call and the method is unresolved. acpica bz .
--- source/os_specific/service_layers/osunixxf.c +++ source/os_specific/service_layers/osunixxf.c @@ -879,10 +879,17 @@ AcpiOsDeleteSemaphore ( return (AE_BAD_PARAMETER); } +#ifdef __APPLE__ + if (sem_close (Sem) == -1) + { + return (AE_BAD_PARAMETER); + } +#else if (sem_destroy (Se...
MacOSX: Fix wrong sem_destroy definition
Support Mac OS X in Makefile
--- source/include/platform/acmacosx.h +++ source/include/platform/acmacosx.h #define sem_destroy sem_close - #define sem_destroy sem_close --- source/os_specific/service_layers/osunixxf.c +++ source/os_specific/service_layers/osunixxf.c @@ -879,10 +879,17 @@ AcpiOsDeleteSemaphore ( +#ifdef __APPLE__ + ...
4
--- source/os_specific/service_layers/osunixxf.c +++ source/os_specific/service_layers/osunixxf.c @@ -879,10 +879,17 @@ AcpiOsDeleteSemaphore ( +#ifdef __APPLE__ + if (sem_close (Sem) == -1) + { + return (AE_BAD_PARAMETER); + } +#else +#endif --- source/include/platform/acmacosx.h +++ source/include/pla...
1
return (AE_BAD_PARAMETER); } +#ifdef __APPLE__ + if (sem_close (Sem) == -1) + { + return (AE_BAD_PARAMETER); + } +#else if (sem_destroy (Sem) == -1) { return (AE_BAD_PARAMETER); } +#endif return (AE_OK); } #include "aclinux.h" #ifdef __APPLE__ -#defin...
the following build errors can be seen for macosx builds: .../osunixxf.c:882:9: error: 'sem_close' is deprecated [-werror,-wdeprecated-declarations] .../acmacosx.h:122:29: note: expanded from macro 'sem_destroy' sem_destroy sem_close sem_destroy() issue is caused by the wrong order of the following lines: sem_close <s...
--- source/tools/acpisrc/astable.c +++ source/tools/acpisrc/astable.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: astable - Tables used for source conversion - * $Revision: 1.18 $ + * $Revision: 1.19 $ * ************...
2008 Copyright support added.
Update copyright to 2007. Split from asmain.c
--- source/tools/acpisrc/astable.c +++ source/tools/acpisrc/astable.c - * $Revision: 1.18 $ + * $Revision: 1.19 $ {"INT8", "s8", REPLACE_WHOLE_WORD}, - " * Copyright (C) 2000 - 2007, R. Byron Moore\n" + " * Copyright (C) 2000 - 2008, Intel Corp....
0
--- source/tools/acpisrc/astable.c +++ source/tools/acpisrc/astable.c @@ -2,7 +2,7 @@ - * $Revision: 1.18 $ + * $Revision: 1.19 $ @@ -164,7 +164,7 @@ ACPI_STRING_TABLE StandardDataTypes[] = { -" * Copyright (C) 2000 - 2007, R. Byron Moore\n" +" * Copyright (C) 2000 - 2008, Intel Corp...
1
/****************************************************************************** * * Module Name: astable - Tables used for source conversion - * $Revision: 1.18 $ + * $Revision: 1.19 $ * *****************************************************************************/ char ...
copyright for base code and linux version. also, removed r. byron moore copyright and replaced with intel corp.
--- source/compiler/aslopcodes.c +++ source/compiler/aslopcodes.c @@ -956,7 +956,7 @@ OpcDoPld ( { UINT8 *Buffer; ACPI_PARSE_OBJECT *Node; - ACPI_PLD_INFO PldInfo = {0}; + ACPI_PLD_INFO PldInfo; ACPI_PARSE_OBJECT *NewOp; @@ -979,6 +979,8 @@ Opc...
iASL: Update for ToPLD macro.
iASL: Add support for ToPLD macro.
--- source/compiler/aslopcodes.c +++ source/compiler/aslopcodes.c static void - ACPI_PLD_INFO PldInfo = {0}; + ACPI_PLD_INFO PldInfo; if (!Buffer) + ACPI_MEMSET (&PldInfo, 0, sizeof (ACPI_PLD_INFO)); PldInfo.Revision = (UINT8) Node->Asl.Child->Asl.Value.Integer; ...
0
--- source/compiler/aslopcodes.c +++ source/compiler/aslopcodes.c @@ -956,7 +956,7 @@ OpcDoPld ( - ACPI_PLD_INFO PldInfo = {0}; + ACPI_PLD_INFO PldInfo; @@ -979,6 +979,8 @@ OpcDoPld ( + ACPI_MEMSET (&PldInfo, 0, sizeof (ACPI_PLD_INFO)); +
1
{ UINT8 *Buffer; ACPI_PARSE_OBJECT *Node; - ACPI_PLD_INFO PldInfo = {0}; + ACPI_PLD_INFO PldInfo; ACPI_PARSE_OBJECT *NewOp; return; } + ACPI_MEMSET (&PldInfo, 0, sizeof (ACPI_PLD_INFO)); + Node = Op->Asl.Child; whil...
use memset to clear the entire pld buffer before populating it. avoids a compile error with some compilers.
--- src/lib/Libifl/trq_auth.c +++ src/lib/Libifl/trq_auth.c @@ -998,6 +998,9 @@ int authorize_socket( if (trq_server_addr != NULL) free(trq_server_addr); + if (server_name != NULL) + free(server_name); + return(rc); } // END authorize_socket()
TRQ-3017 Leak in trqauthd
--- src/lib/Libifl/trq_auth.c +++ src/lib/Libifl/trq_auth.c @@ -998,6 +998,9 @@ int authorize_socket( + if (server_name != NULL) + free(server_name); +
2
--- src/lib/Libifl/trq_auth.c +++ src/lib/Libifl/trq_auth.c @@ -998,6 +998,9 @@ int authorize_socket( + if (server_name != NULL) + free(server_name); +
1
if (trq_server_addr != NULL) free(trq_server_addr); + if (server_name != NULL) + free(server_name); + return(rc); } // END authorize_socket()
fixed leak found by valgrind in trqauthd authorize_socket. server_name was allocated but not freed.
--- src/lib/Libutils/numa_chip.cpp +++ src/lib/Libutils/numa_chip.cpp @@ -1425,6 +1425,14 @@ void Chip::calculateStepCounts( int &place_count_remaining) { + if (lprocs_per_task == 0) + { + step = 0; + step_remainder = processing_units_per_task; + place_count = 0; + return; + } + if...
Made it so cores or threads can be allocated on
--- src/lib/Libutils/numa_chip.cpp +++ src/lib/Libutils/numa_chip.cpp if (lprocs_per_task == 1) + if (lprocs_per_task == 0) { + { step = (processing_units_per_task/2) + 1; + step = 0; step_remainder = 0; + step_remainder = processing_units_per_task; } + place_count = 0; else ...
0
--- src/lib/Libutils/numa_chip.cpp +++ src/lib/Libutils/numa_chip.cpp @@ -1425,6 +1425,14 @@ void Chip::calculateStepCounts( + if (lprocs_per_task == 0) + { + step = 0; + step_remainder = processing_units_per_task; + place_count = 0; + return; + } +
1
int &place_count_remaining) { + if (lprocs_per_task == 0) + { + step = 0; + step_remainder = processing_units_per_task; + place_count = 0; + return; + } + if (lprocs_per_task == 1) { step = (processing_units_per_task/2) + 1;
a numanode even if they will not be put into a cpuset
--- src/server/test/pbsd_main/scaffolding.c +++ src/server/test/pbsd_main/scaffolding.c @@ -290,7 +290,7 @@ void *queue_route(void *vp) exit(1); } -void acct_close(void) +void acct_close(bool) { fprintf(stderr, "The call to acct_close needs to be mocked!!\n"); exit(1);
Fixed unit test for pbsd_main.
added an include in hash_table for endianness.
--- src/server/test/pbsd_main/scaffolding.c +++ src/server/test/pbsd_main/scaffolding.c - void acct_close(void) + void acct_close(bool) fprintf(stderr, "The call to acct_close needs to be mocked!!\n"); exit(1);
0
--- src/server/test/pbsd_main/scaffolding.c +++ src/server/test/pbsd_main/scaffolding.c @@ -290,7 +290,7 @@ void *queue_route(void *vp) -void acct_close(void) +void acct_close(bool)
1
exit(1); } -void acct_close(void) +void acct_close(bool) { fprintf(stderr, "The call to acct_close needs to be mocked!!\n"); exit(1);
accomodated acct_close() stub signature in pbsd_main unit test
--- src/lib/Libattr/attr_fn_attr_req_info.c +++ src/lib/Libattr/attr_fn_attr_req_info.c @@ -180,6 +180,9 @@ int encode_attr_req_info( (attr->at_val.at_ptr == NULL)) return(PBSE_NONE); + if (atname == NULL) + return(PBSE_BAD_PARAMETER); + std::vector<std::string> names; std::vector<std::string>...
AC-8469 - fixed unit test to handle case where atname
AC-8469 Allow -L min/max and default specifications for queues
--- src/lib/Libattr/attr_fn_attr_req_info.c +++ src/lib/Libattr/attr_fn_attr_req_info.c int encode_attr_req_info( const char *atname, if ((attr == NULL) || (attr->at_val.at_ptr == NULL)) + if (atname == NULL) + return(PBSE_BAD_PARAMETER); std::vector<std::string> values; attr_req_info ...
0
--- src/lib/Libattr/attr_fn_attr_req_info.c +++ src/lib/Libattr/attr_fn_attr_req_info.c @@ -180,6 +180,9 @@ int encode_attr_req_info( + if (atname == NULL) + return(PBSE_BAD_PARAMETER); +
1
(attr->at_val.at_ptr == NULL)) return(PBSE_NONE); + if (atname == NULL) + return(PBSE_BAD_PARAMETER); + std::vector<std::string> names; std::vector<std::string> values;
is null in encode_attr_req_info.
--- src/resmom/mom_main.c +++ src/resmom/mom_main.c @@ -99,6 +99,7 @@ #define MAX_UPDATES_BEFORE_SENDING 20 #define PMOMTCPTIMEOUT 60 /* duration in seconds mom TCP requests will block */ +#define TCP_READ_PROTO_TIMEOUT 2 /* Global Data Items */ @@ -5556,7 +5557,7 @@ int tcp_read_proto_version( tmpT = ...
Changed the pbs_tcp_timeout value when reading the protocol
Restore temporarily setting the pbs_tcp_timeout to 0 when re-running do_tcp(). This is called repeatedly each time a tcp_connection is received. Port the patches from 4.0-fixes to trunk. This is revision 5903 to revision 6089.
--- src/resmom/mom_main.c +++ src/resmom/mom_main.c + #define TCP_READ_PROTO_TIMEOUT 2 int tcp_read_proto_version( - pbs_tcp_timeout = 0; + pbs_tcp_timeout = TCP_READ_PROTO_TIMEOUT;
0
--- src/resmom/mom_main.c +++ src/resmom/mom_main.c @@ -99,6 +99,7 @@ +#define TCP_READ_PROTO_TIMEOUT 2 @@ -5556,7 +5557,7 @@ int tcp_read_proto_version( - pbs_tcp_timeout = 0; + pbs_tcp_timeout = TCP_READ_PROTO_TIMEOUT;
1
#define MAX_UPDATES_BEFORE_SENDING 20 #define PMOMTCPTIMEOUT 60 /* duration in seconds mom TCP requests will block */ +#define TCP_READ_PROTO_TIMEOUT 2 /* Global Data Items */ tmpT = pbs_tcp_timeout; - pbs_tcp_timeout = 0; + pbs_tcp_timeout = TCP_READ_PROTO_TIMEOUT; *proto = disrsi(chan, &rc);...
version in do_tcp to tcp_read_proto_timeou
--- src/daemon_client/trq_auth_daemon.c +++ src/daemon_client/trq_auth_daemon.c @@ -39,6 +39,7 @@ static char *active_pbs_server; pbs_net_t trq_server_addr; char trq_hostname[PBS_MAXSERVERNAME + 1]; +/* Get the name of the active pbs_server */ int load_trqauthd_config( char **default_server_name,
Fixed problem with torque HA where trqauthd was
--- src/daemon_client/trq_auth_daemon.c +++ src/daemon_client/trq_auth_daemon.c @@ -39,6 +39,7 @@ static char *active_pbs_server; +/* Get the name of the active pbs_server */
0
--- src/daemon_client/trq_auth_daemon.c +++ src/daemon_client/trq_auth_daemon.c @@ -39,6 +39,7 @@ static char *active_pbs_server; +/* Get the name of the active pbs_server */
1
pbs_net_t trq_server_addr; char trq_hostname[PBS_MAXSERVERNAME + 1]; +/* Get the name of the active pbs_server */ int load_trqauthd_config( char **default_server_name,
not switching to the new server. trq-2265
--- src/test/node_func/test_uut.c +++ src/test/node_func/test_uut.c @@ -213,9 +213,7 @@ START_TEST(add_node_attribute_to_list_test) snprintf(line, sizeof(line), "bob,tom"); ptr = line; fail_unless(add_node_attribute_to_list(strdup("acl"), &ptr, &th, 1) == PBSE_NONE); - fail_unless(attrname.c_str() != NULL); ...
Revert "Trying to fix node_func unit tests"
Trying to fix node_func unit tests
--- src/test/node_func/test_uut.c +++ src/test/node_func/test_uut.c END_TEST - fail_unless(attrname.c_str() != NULL); - fail_unless(attrval.c_str() != NULL);
4
--- src/test/node_func/test_uut.c +++ src/test/node_func/test_uut.c @@ -213,9 +213,7 @@ START_TEST(add_node_attribute_to_list_test) - fail_unless(attrname.c_str() != NULL); - fail_unless(attrval.c_str() != NULL);
1
snprintf(line, sizeof(line), "bob,tom"); ptr = line; fail_unless(add_node_attribute_to_list(strdup("acl"), &ptr, &th, 1) == PBSE_NONE); - fail_unless(attrname.c_str() != NULL); fail_unless(strcmp(attrname.c_str(), "acl") == 0); - fail_unless(attrval.c_str() != NULL); fail_unless(strcmp(attrval.c_str(),...
this reverts commit fc6469cc12b3ec85f94148d37167d364992278b.
--- src/server/array_func.c +++ src/server/array_func.c @@ -180,6 +180,8 @@ job_array *get_array( char *tmpjobid; tmpjobid = get_correct_jobname(id); + if (tmpjobid == NULL) + return(NULL); pthread_mutex_lock(allarrays.allarrays_mutex);
Fixed coverity issue 1187608. Dereferencing a pointer
Make array jobs compatible with 'display_job_server_suffix = False' Re-work some of the job array code to fix several unsafe accesses to job arrays, including the fact that next_array() was returning an unlocked array. Many of the functions that called next_array() were then not locking the array, meaning they were wor...
--- src/server/array_func.c +++ src/server/array_func.c job_array *get_array( tmpjobid = get_correct_jobname(id); + if (tmpjobid == NULL) + return(NULL); pthread_mutex_lock(allarrays.allarrays_mutex); pa = (job_array *)get_from_hash_map(allarrays.hm, tmpjobid); if (pa != NULL) pthread_mutex_unlock(allar...
0
--- src/server/array_func.c +++ src/server/array_func.c @@ -180,6 +180,8 @@ job_array *get_array( + if (tmpjobid == NULL) + return(NULL);
1
char *tmpjobid; tmpjobid = get_correct_jobname(id); + if (tmpjobid == NULL) + return(NULL); pthread_mutex_lock(allarrays.allarrays_mutex);
before it was checked for null in get_array.
--- src/resmom/linux/cpuset.c +++ src/resmom/linux/cpuset.c @@ -784,10 +784,11 @@ int delete_cpuset( */ else if (!strcmp(pdirent->d_name, "tasks")) { + slept = 0; + do { npids = 0; - slept = 0; if ((fd = fopen(path, "r")) != NULL) ...
Fix an infinite loop (patch from Martin Siegert).
Check in Smt support, as well as the adaptation to use hwloc for cpusets in TORQUE. These were contributed by our friend Dr. Bernd Kallies at the ZUSE institute (ZIB). Thanks Bernd
--- src/resmom/linux/cpuset.c +++ src/resmom/linux/cpuset.c int delete_cpuset( else if (!strcmp(pdirent->d_name, "tasks")) - slept = 0; + slept = 0; slept++; } } while ((npids > 0) && (slept <= 5)); }
4
--- src/resmom/linux/cpuset.c +++ src/resmom/linux/cpuset.c @@ -784,10 +784,11 @@ int delete_cpuset( + slept = 0; + - slept = 0;
1
*/ else if (!strcmp(pdirent->d_name, "tasks")) { + slept = 0; + do { npids = 0; - slept = 0; if ((fd = fopen(path, "r")) != NULL) { while ((fgets(tid, sizeof(tid), fd)) != NULL)
this only happens if cpusets are enabled and processes are in an uninterruptible state.
--- src/lib/Libutils/numa_chip.cpp +++ src/lib/Libutils/numa_chip.cpp @@ -1616,7 +1616,11 @@ bool Chip::spread_place_cores( if (fits == true) { - int step_count = 1; + int step_count = step; + + if (lprocs_per_task_remaining == 1) + step_count = 1; + /* cores_placed and cores_to_fill are ...
Changed place=core=x to start placing cores
--- src/lib/Libutils/numa_chip.cpp +++ src/lib/Libutils/numa_chip.cpp int step_count = 1; - int step_count = 1; + int step_count = step; /* cores_placed and cores_to_fill are used because we only want to make sure we + if (lprocs_per_task_remaining == 1) fill the number of cores for this tas...
0
--- src/lib/Libutils/numa_chip.cpp +++ src/lib/Libutils/numa_chip.cpp @@ -1616,7 +1616,11 @@ bool Chip::spread_place_cores( - int step_count = 1; + int step_count = step; + + if (lprocs_per_task_remaining == 1) + step_count = 1; +
1
if (fits == true) { - int step_count = 1; + int step_count = step; + + if (lprocs_per_task_remaining == 1) + step_count = 1; + /* cores_placed and cores_to_fill are used because we only want to make sure we fill the number of cores for this task */
at instead of .
--- src/server/node_manager.c +++ src/server/node_manager.c @@ -4564,6 +4564,8 @@ int procs_requested( if (proplist(&str, &prop, &num_procs, &num_gpus, &num_mics)) { free(tmp_spec); + if (prop != NULL) + free_prop(prop); return(-1); } } @...
fixed to memory leaks for error cases in procs_requested.
Merge the MIC changes into TORQUE's main trunk. These were co-developed with Doug Johnson at OSC - thank you Doug - and offer our initial support for the MIC architecture. merged changes from 3.0-alpha. These are the job_radix changes. Update the synchronization for nodes. Protect some parts that were previously unprot...
--- src/server/node_manager.c +++ src/server/node_manager.c int procs_requested( struct prop *prop = NULL; if ((globs = strchr(tmp_spec, '#')) != NULL) while ((cp = strrchr(globs, '#')) != NULL) if (proplist(&str, &prop, &num_procs, &num_gpus, &num_mics)) + if (prop != NULL) + free...
0
--- src/server/node_manager.c +++ src/server/node_manager.c @@ -4564,6 +4564,8 @@ int procs_requested( + if (prop != NULL) + free_prop(prop); @@ -4576,6 +4578,8 @@ int procs_requested( + if (prop != NULL) + free_prop(prop);
1
if (proplist(&str, &prop, &num_procs, &num_gpus, &num_mics)) { free(tmp_spec); + if (prop != NULL) + free_prop(prop); return(-1); } } { /* must be a prop list with no number in front */ free(tmp_spec); + ...
patch submitted by craig prescott. trq-2498
--- src/cmds/qsub_functions.c +++ src/cmds/qsub_functions.c @@ -3669,6 +3669,10 @@ void process_opts( { while (fgets(cline, sizeof(cline), fP) != NULL) { + // Skip blank lines + if (*cline == '\n') + continue; + if (strlen(cline) < 5) break;
TRQ-3585. Fix an issue where leading newlines caused interactive jobs
Finished the merge from git tree Commit part one of the merge. This has some warnings, but those will be fixed immediately - I need John to fix them as they're in his code.
--- src/cmds/qsub_functions.c +++ src/cmds/qsub_functions.c void process_opts( while (fgets(cline, sizeof(cline), fP) != NULL) + // Skip blank lines + if (*cline == '\n') + continue; break; { {
4
--- src/cmds/qsub_functions.c +++ src/cmds/qsub_functions.c @@ -3669,6 +3669,10 @@ void process_opts( + // Skip blank lines + if (*cline == '\n') + continue; +
1
{ while (fgets(cline, sizeof(cline), fP) != NULL) { + // Skip blank lines + if (*cline == '\n') + continue; + if (strlen(cline) < 5) break;
not to apply submit filter changes.
--- src/server/req_runjob.c +++ src/server/req_runjob.c @@ -1729,7 +1729,7 @@ job *chk_job_torun( } } - if (pjob->ji_qs.ji_state != JOB_STATE_QUEUED) + if ((pjob->ji_qs.ji_state != JOB_STATE_QUEUED) && (pjob->ji_qs.ji_state != JOB_STATE_HELD)) { sprintf(EMsg, "job %s state %s", pjob->ji_qs.ji_...
TRQ-2681 Unable to qrun a held job.
TRQ-2670 Server keeping jobs on node after job has been requeued Restore asynchronous functionality by having the post-reply processing happen on a separate thread instead of the same thread which essentially made things synchronous instead of asynchronous. TRQ-1284. Reworked the syntax associated with specifying check...
--- src/server/req_runjob.c +++ src/server/req_runjob.c job *chk_job_torun( if ((pjob = chk_job_request(prun->rq_jid, preq)) == 0) if ((pjob->ji_qs.ji_state == JOB_STATE_TRANSIT) || (pjob->ji_qs.ji_state == JOB_STATE_EXITING) || (pjob->ji_qs.ji_substate == JOB_SUBSTATE_STAGEGO) || (pjob->ji_qs.ji_...
0
--- src/server/req_runjob.c +++ src/server/req_runjob.c @@ -1729,7 +1729,7 @@ job *chk_job_torun( - if (pjob->ji_qs.ji_state != JOB_STATE_QUEUED) + if ((pjob->ji_qs.ji_state != JOB_STATE_QUEUED) && (pjob->ji_qs.ji_state != JOB_STATE_HELD))
1
} } - if (pjob->ji_qs.ji_state != JOB_STATE_QUEUED) + if ((pjob->ji_qs.ji_state != JOB_STATE_QUEUED) && (pjob->ji_qs.ji_state != JOB_STATE_HELD)) { sprintf(EMsg, "job %s state %s", pjob->ji_qs.ji_jobid, PJobState[pjob->ji_qs.ji_state]); req_reject(PBSE_BADSTATE, 0, preq, NULL, EMsg);
this changes behavior modified by tr!-2665 which would only allow queued jobs to run. previously torque has allowed held jobs to be run with a qrun command.
--- src/lib/Libutils/machine.cpp +++ src/lib/Libutils/machine.cpp @@ -663,6 +663,7 @@ int Machine::spread_place_pu( int pu_per_task = 0; int lprocs_per_task = r.getExecutionSlots(); int tasks_placed = 0; + int tasks_for_this_node = tasks_for_node; if (pu_per_task > this->totalCores) return(P...
TRQ-3486 pinning of place={core|thread} not as expected
--- src/lib/Libutils/machine.cpp +++ src/lib/Libutils/machine.cpp + int tasks_for_this_node = tasks_for_node; if (this->sockets[j].how_many_tasks_fit(r, master.place_type) < tasks_for_node) - if (this->sockets[j].how_many_tasks_fit(r, master.place_type) < tasks_for_node) continue; + if (t...
0
--- src/lib/Libutils/machine.cpp +++ src/lib/Libutils/machine.cpp @@ -663,6 +663,7 @@ int Machine::spread_place_pu( + int tasks_for_this_node = tasks_for_node; @@ -690,7 +691,7 @@ int Machine::spread_place_pu( - if (this->sockets[j].how_many_tasks_fit(r, master.place_type) < tasks_for_node) + if (this->soc...
1
int pu_per_task = 0; int lprocs_per_task = r.getExecutionSlots(); int tasks_placed = 0; + int tasks_for_this_node = tasks_for_node; if (pu_per_task > this->totalCores) return(PBSE_IVALREQ); for (unsigned int j = 0; j < this->totalSockets; j++) { - if (this->sockets[j].how_...
fixed a problem where we were exiting the tasks_for_node loop in spread_place_pu too soon.
--- src/tunnel.c +++ src/tunnel.c @@ -666,7 +666,8 @@ static int ssl_verify_cert(struct tunnel *tunnel) #ifdef HAVE_X509_CHECK_HOST // Use OpenSSL native host validation if v >= 1.0.2. - if (X509_check_host(cert, common_name, FIELD_SIZE, 0, NULL)) + // correctly check return value of X509_check_host + if (X509_che...
correctly check return value of X509_check_host
Use X509_check_host instead of explicit CN match. (#242)
--- src/tunnel.c +++ src/tunnel.c @@ -666,7 +666,8 @@ static int ssl_verify_cert(struct tunnel *tunnel) - if (X509_check_host(cert, common_name, FIELD_SIZE, 0, NULL)) + // correctly check return value of X509_check_host + if (X509_check_host(cert, common_name, FIELD_SIZE, 0, NULL) == 1)
3
--- src/tunnel.c +++ src/tunnel.c @@ -666,7 +666,8 @@ static int ssl_verify_cert(struct tunnel *tunnel) - if (X509_check_host(cert, common_name, FIELD_SIZE, 0, NULL)) + // correctly check return value of X509_check_host + if (X509_check_host(cert, common_name, FIELD_SIZE, 0, NULL) == 1)
0
#ifdef HAVE_X509_CHECK_HOST // Use OpenSSL native host validation if v >= 1.0.2. - if (X509_check_host(cert, common_name, FIELD_SIZE, 0, NULL)) + // correctly check return value of X509_check_host + if (X509_check_host(cert, common_name, FIELD_SIZE, 0, NULL) == 1) cert_valid = 1; #else // Use explicit Common...
cve-2020-7041 incorrect use of x509_check_host (regarding return value) is fixed with this commit. the flaw came in with and prevented proper host name verification when openssl >= was in use since openfortivpn .
--- src/tunnel.c +++ src/tunnel.c @@ -652,7 +652,6 @@ static int ssl_verify_cert(struct tunnel *tunnel) char *line; int i; X509_NAME *subj; - char common_name[FIELD_SIZE + 1]; SSL_set_verify(tunnel->ssl_handle, SSL_VERIFY_PEER, NULL); @@ -666,10 +665,13 @@ static int ssl_verify_cert(struct tunnel *tunnel) ...
supply proper input buffer to X509_check_host
correctly check return value of X509_check_host Use X509_check_host instead of explicit CN match. (#242) Uniformize strncpy usage
--- src/tunnel.c +++ src/tunnel.c @@ -652,7 +652,6 @@ static int ssl_verify_cert(struct tunnel *tunnel) - char common_name[FIELD_SIZE + 1]; @@ -666,10 +665,13 @@ static int ssl_verify_cert(struct tunnel *tunnel) - // correctly check return value of X509_check_host - if (X509_check_host(cert, common_name, FIELD_SIZE, 0,...
0
--- src/tunnel.c +++ src/tunnel.c @@ -652,7 +652,6 @@ static int ssl_verify_cert(struct tunnel *tunnel) - char common_name[FIELD_SIZE + 1]; @@ -666,10 +665,13 @@ static int ssl_verify_cert(struct tunnel *tunnel) - // correctly check return value of X509_check_host - if (X509_check_host(cert, common_name, FIELD_SIZE, 0,...
0
char *line; int i; X509_NAME *subj; - char common_name[FIELD_SIZE + 1]; SSL_set_verify(tunnel->ssl_handle, SSL_VERIFY_PEER, NULL); #ifdef HAVE_X509_CHECK_HOST // Use OpenSSL native host validation if v >= 1.0.2. - // correctly check return value of X509_check_host - if (X509_check_host(cert, common_nam...
cve-2020-7042 use of uninitialized memory in x509_check_host is fixed with this commit the uninitialized buffer common_name was passed as argument to x509_check_host which prevented proper host name validation when openssl >= was in use. this came in with which went into openfortivpn . unfortunately, this problem has ...
--- src/gnutls_io.c +++ src/gnutls_io.c @@ -2,7 +2,7 @@ * Copyright 2004-2005 Paul Querna * Copyright 2008 Nikos Mavrogiannopoulos * Copyright 2011 Dash Shendy - * Copyright 2015-2020 Fiona Klute + * Copyright 2015-2022 Fiona Klute * * Licensed under the Apache License, Version 2.0 (the "License"); * ...
Fix loop in blocking read on transport timeout
Handle APR_TIMEUP return value from blocking ap_get_brigade() call Immediately retry on EINTR or EAGAIN for blocking receive gnutls_io_input_read: Retry gnutls_record_recv if necessary indented code - move hooks to gnutls_hooks.c working support for a ssl session cache via memcached. input and output filters
--- src/gnutls_io.c +++ src/gnutls_io.c - * Copyright 2015-2020 Fiona Klute + * Copyright 2015-2022 Fiona Klute static apr_status_t gnutls_io_input_read(mgs_handle_t * ctxt, ap_log_cerror(APLOG_MARK, APLOG_TRACE2, ctxt->input_rc, ctxt->c, __func__, gnutls_strerror(rc), ...
4
--- src/gnutls_io.c +++ src/gnutls_io.c @@ -2,7 +2,7 @@ - * Copyright 2015-2020 Fiona Klute + * Copyright 2015-2022 Fiona Klute @@ -277,6 +277,11 @@ static apr_status_t gnutls_io_input_read(mgs_handle_t * ctxt, + } else if (rc == GNUTLS_E_PULL_ERROR + && APR_STATUS_IS_TIMEUP(ctxt->inp...
0
* Copyright 2004-2005 Paul Querna * Copyright 2008 Nikos Mavrogiannopoulos * Copyright 2011 Dash Shendy - * Copyright 2015-2020 Fiona Klute + * Copyright 2015-2022 Fiona Klute * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the...
the loop was cased by an incorrect errno if the transport read in mgs_transport_read() fails with an apr timeup status, as happens when mod_reqtimeout limits are exceeded. setting the transport errno to egain meant that a blocking read would be retried endlessly, setting etimedout instead makes the read fail as it shou...
--- android/jansson_config.h +++ android/jansson_config.h @@ -36,4 +36,8 @@ otherwise to 0. */ #define JSON_HAVE_LOCALECONV 0 +/* Maximum recursion depth for parsing JSON input. + This limits the depth of e.g. array-within-array constructions. */ +#define JSON_PARSER_MAX_DEPTH 2048 + #endif --- src/load.c ++...
Fix for issue #282
Add JSON_REJECT_DUPLICATES decoding flag Initial import
--- src/load.c +++ src/load.c + size_t depth; static json_t *parse_value(lex_t *lex, size_t flags, json_error_t *error) + lex->depth++; + if(lex->depth > JSON_PARSER_MAX_DEPTH) { + error_set(error, lex, "maximum parsing depth reached"); + return NULL; + } case TOKEN_STRING: { ...
4
--- android/jansson_config.h +++ android/jansson_config.h @@ -36,4 +36,8 @@ +/* Maximum recursion depth for parsing JSON input. + This limits the depth of e.g. array-within-array constructions. */ +#define JSON_PARSER_MAX_DEPTH 2048 + --- src/load.c +++ src/load.c @@ -62,6 +62,7 @@ typedef struct { + size_t depth;...
0
otherwise to 0. */ #define JSON_HAVE_LOCALECONV 0 +/* Maximum recursion depth for parsing JSON input. + This limits the depth of e.g. array-within-array constructions. */ +#define JSON_PARSER_MAX_DEPTH 2048 + #endif stream_t stream; strbuffer_t saved_text; size_t flags; + size_t depth; ...
the fix limits recursion depths when parsing arrays and objects. the limit is configurable via the `json_parser_max_depth` setting within `jansson_config.h` and is set by default to . update the rfc conformance document to note the limit; the rfc allows limits to be set by the implementation so nothing has actually ch...
--- src/flex-scanner.h +++ src/flex-scanner.h @@ -112,7 +112,15 @@ static struct obstack obstack_for_string; # define STRING_1GROW(Char) \ obstack_1grow (&obstack_for_string, Char) -# define STRING_FREE() \ +# ifdef NDEBUG +# define STRING_FREE() ...
scanner: don't crash on strings containing a NUL byte
style: prefer 'FOO ()' to 'FOO' for function-like macros
--- src/flex-scanner.h +++ src/flex-scanner.h @@ -112,7 +112,15 @@ static struct obstack obstack_for_string; -# define STRING_FREE() \ +# ifdef NDEBUG +# define STRING_FREE() \ +# else +# define STRING_FREE() \ + do { ...
0
--- src/flex-scanner.h +++ src/flex-scanner.h @@ -112,7 +112,15 @@ static struct obstack obstack_for_string; -# define STRING_FREE() \ +# ifdef NDEBUG +# define STRING_FREE() \ +# else +# define STRING_FREE() \ + do { ...
0
# define STRING_1GROW(Char) \ obstack_1grow (&obstack_for_string, Char) -# define STRING_FREE() \ +# ifdef NDEBUG +# define STRING_FREE() \ obstack_free (&obstack_for_string, last_string) +# else +# define STRING_FREE() ...
we crash if the input contains a string containing a nul byte. reported by suhwan song. * src/flex-scanner.h (string_free): avoid accidental use of last_string. * src/scan-gram.l: don't call string_free without calling string_finish first. * tests/input.at (invalid inputs): check that case.
--- src/controller.cpp +++ src/controller.cpp @@ -1344,12 +1344,12 @@ std::string controller::bookmark( std::string bookmark_cmd = cfg.get_configvalue("bookmark-cmd"); bool is_interactive = cfg.get_configvalue_as_bool("bookmark-interactive"); if (bookmark_cmd.length() > 0) { - std::string cmdline = strprintf::fm...
Sanitize inputs to bookmark-cmd (#591)
Fix compiler warnings. Closes #430 Pull utils::{strprintf,split_format} into separate module Make utils::strprintf use variadic template Pass feed's title to bookmark script. Closes #341 implemented bookmark-interactive config option. Andreas Krennmair:
--- src/controller.cpp +++ src/controller.cpp std::string controller::bookmark( const std::string& title, const std::string& description, const std::string& feed_title) if (bookmark_cmd.length() > 0) { - std::string cmdline = strprintf::fmt("%s '%s' %s %s %s", + std::string cmdline = strprintf::fmt("%s '%s' ...
0
--- src/controller.cpp +++ src/controller.cpp @@ -1344,12 +1344,12 @@ std::string controller::bookmark( - std::string cmdline = strprintf::fmt("%s '%s' %s %s %s", + std::string cmdline = strprintf::fmt("%s '%s' '%s' '%s' '%s'", - quote_empty(stfl::quote(title)), - ...
1
std::string bookmark_cmd = cfg.get_configvalue("bookmark-cmd"); bool is_interactive = cfg.get_configvalue_as_bool("bookmark-interactive"); if (bookmark_cmd.length() > 0) { - std::string cmdline = strprintf::fmt("%s '%s' %s %s %s", + std::string cmdline = strprintf::fmt("%s '%s' '%s' '%s' '%s'", ...
newsbeuter didn't properly shell-escape the arguments passed to bookmarking command, which allows a remote attacker to perform remote code execution by crafting an rss item whose title and/or url contain something interpretable by the shell (most notably subshell invocations.) this has been reported by jeriko one <jer...
--- src/modules/rlm_ippool/rlm_ippool.c +++ src/modules/rlm_ippool/rlm_ippool.c @@ -556,12 +556,15 @@ static int ippool_postauth(void *instance, REQUEST *request) * If there is a Framed-IP-Address attribute in the reply, check for override */ if (pairfind(request->reply->vps, PW_FRAMED_IP_ADDRESS) != NULL) { + ...
Add more debugging output when we find an existing Framed-IP-Address attribute
Add new override option to rlm_ippool Move from authorize to post-auth
--- src/modules/rlm_ippool/rlm_ippool.c +++ src/modules/rlm_ippool/rlm_ippool.c static int ippool_postauth(void *instance, REQUEST *request) if (pairfind(request->reply->vps, PW_FRAMED_IP_ADDRESS) != NULL) { + DEBUG("rlm_ippool: Found Framed-IP-Address attribute in reply attribute list."); if (data->override) + ...
1
--- src/modules/rlm_ippool/rlm_ippool.c +++ src/modules/rlm_ippool/rlm_ippool.c @@ -556,12 +556,15 @@ static int ippool_postauth(void *instance, REQUEST *request) + DEBUG("rlm_ippool: Found Framed-IP-Address attribute in reply attribute list."); + DEBUG("rlm_ippool: override is set to yes. Override the existing Fram...
1
* If there is a Framed-IP-Address attribute in the reply, check for override */ if (pairfind(request->reply->vps, PW_FRAMED_IP_ADDRESS) != NULL) { + DEBUG("rlm_ippool: Found Framed-IP-Address attribute in reply attribute list."); if (data->override) { /* Override supplied Framed-IP-Address */ + DEB...
in the reply list
--- src/main/event.c +++ src/main/event.c @@ -1410,6 +1410,7 @@ static int proxy_to_virtual_server(REQUEST *request) } else { RDEBUG2("Unknown packet type %d", request->proxy->code); + request_free(&fake); return 0; }
Free fake on unknown packet.
--- src/main/event.c +++ src/main/event.c @@ -1410,6 +1410,7 @@ static int proxy_to_virtual_server(REQUEST *request) + request_free(&fake);
0
--- src/main/event.c +++ src/main/event.c @@ -1410,6 +1410,7 @@ static int proxy_to_virtual_server(REQUEST *request) + request_free(&fake);
1
} else { RDEBUG2("Unknown packet type %d", request->proxy->code); + request_free(&fake); return 0; }
this fixes coverity .
--- src/main/mainconfig.c +++ src/main/mainconfig.c @@ -404,7 +404,7 @@ static int generate_realms(const char *filename) strlen(authhost), sizeof(c->server) - 1); return -1; } - if (strlen(accthost) >= sizeof(c->acct_server)) { + if (accthost && strlen(accthost) >= sizeof(c->a...
Don't die if accthost/authost aren't defined.
Fixed bug in reporting authserver in warnings when marking dead the New 'free mainconfig' function, to remove more code from radiusd.c
--- src/main/mainconfig.c +++ src/main/mainconfig.c static int generate_realms(const char *filename) memset(c, 0, sizeof(REALM)); if ((accthost = cf_section_value_find(cs, "accthost")) == NULL) { if (strcmp(accthost, "LOCAL") == 0) { c->acct_ipaddr = ip_getaddr(accthost); if (strlen(authhost) >= sizeof(c->...
0
--- src/main/mainconfig.c +++ src/main/mainconfig.c @@ -404,7 +404,7 @@ static int generate_realms(const char *filename) - if (strlen(accthost) >= sizeof(c->acct_server)) { + if (accthost && strlen(accthost) >= sizeof(c->acct_server)) { @@ -418,8 +418,8 @@ static int generate_realms(const ...
1
strlen(authhost), sizeof(c->server) - 1); return -1; } - if (strlen(accthost) >= sizeof(c->acct_server)) { + if (accthost && strlen(accthost) >= sizeof(c->acct_server)) { radlog(L_ERR, "%s[%d]: Server name of length %d is greater than allowed: %d", ...
patch from liyan tan
--- src/lib/radius.c +++ src/lib/radius.c @@ -229,12 +229,10 @@ static int rad_sendto(int sockfd, void *data, size_t data_len, int flags, #ifdef WITH_UDPFROMTO /* - * Only IPv4 is supported for udpfromto. - * * And if they don't specify a source IP address, don't * use udpfromto. */ - if ((dst_ipaddr->a...
Enable udpfromto() for IPv6
Fix logic for using udpfromto Update rad_sendto && rad_recvfrom, to not call udpfromto for IPv6
--- src/lib/radius.c +++ src/lib/radius.c @@ -229,12 +229,10 @@ static int rad_sendto(int sockfd, void *data, size_t data_len, int flags, - * Only IPv4 is supported for udpfromto. - * - if ((dst_ipaddr->af == AF_INET) && + if (((dst_ipaddr->af == AF_INET) || (dst_ipaddr->af == AF_INET6)) && @@ -245,7 +243,7 @@ static...
0
--- src/lib/radius.c +++ src/lib/radius.c @@ -229,12 +229,10 @@ static int rad_sendto(int sockfd, void *data, size_t data_len, int flags, - * Only IPv4 is supported for udpfromto. - * - if ((dst_ipaddr->af == AF_INET) && + if (((dst_ipaddr->af == AF_INET) || (dst_ipaddr->af == AF_INET6)) && @@ -245,7 +243,7 @@ static...
1
#ifdef WITH_UDPFROMTO /* - * Only IPv4 is supported for udpfromto. - * * And if they don't specify a source IP address, don't * use udpfromto. */ - if ((dst_ipaddr->af == AF_INET) && + if (((dst_ipaddr->af == AF_INET) || (dst_ipaddr->af == AF_INET6)) && (src_ipaddr->af != AF_UNSPEC)) { return s...
on the theory that it will work, or that some magic will get it to work
--- src/modules/rlm_preprocess/rlm_preprocess.c +++ src/modules/rlm_preprocess/rlm_preprocess.c @@ -562,7 +562,7 @@ static void add_nas_attr(REQUEST *request) exit(1); } nas->lvalue = request->packet->src_ipaddr; - ip_ntoa(nas->strvalue, nas->lvalue); + ip_hostname(nas->strvalue, sizeof(nas->strvalue), nas->lva...
Call ip_hostname, to get host names, if the user wants them.
Put the string representation (nnn.nnn.nnn.nnn) of the IP address added attribute Request-Src-IP-Address, which rlm_preprocess add a NAS-IP-Address to the incoming request if the NAS was
--- src/modules/rlm_preprocess/rlm_preprocess.c +++ src/modules/rlm_preprocess/rlm_preprocess.c static void add_nas_attr(REQUEST *request) if (!nas) { nas->lvalue = request->packet->src_ipaddr; - ip_ntoa(nas->strvalue, nas->lvalue); + ip_hostname(nas->strvalue, sizeof(nas->strvalue), nas->lvalue);
0
--- src/modules/rlm_preprocess/rlm_preprocess.c +++ src/modules/rlm_preprocess/rlm_preprocess.c @@ -562,7 +562,7 @@ static void add_nas_attr(REQUEST *request) - ip_ntoa(nas->strvalue, nas->lvalue); + ip_hostname(nas->strvalue, sizeof(nas->strvalue), nas->lvalue);
1
exit(1); } nas->lvalue = request->packet->src_ipaddr; - ip_ntoa(nas->strvalue, nas->lvalue); + ip_hostname(nas->strvalue, sizeof(nas->strvalue), nas->lvalue); pairadd(&request->packet->vps, nas); }
bug noted by martin shears
--- src/main/proxy.c +++ src/main/proxy.c @@ -273,6 +273,15 @@ int proxy_send(REQUEST *request) return RLM_MODULE_NOOP; } + /* + * If the server has already decided to reject the request, + * then don't try to proxy it. + */ + if (request->reply->code == PW_AUTHENTICATION_REJECT) { + DEBUG2("Cancelling proxy...
If the 'authorize' section has decided to reject the request,
if the realm is a LOCAL one, then still add the 'Realm' attribute, added functionality for Proxy-To-Realm and Replicate-To-Realm, include/libradius.h RADIUS_PACKET now has a sockfd element
--- src/main/proxy.c +++ src/main/proxy.c int proxy_send(REQUEST *request) if (proxypair) { } else if (replicatepair) { + /* + * If the server has already decided to reject the request, + * then don't try to proxy it. + */ + if (request->reply->code == PW_AUTHENTICATION_REJECT) { + DEBUG2("Cancelling proxy ...
0
--- src/main/proxy.c +++ src/main/proxy.c @@ -273,6 +273,15 @@ int proxy_send(REQUEST *request) + /* + * If the server has already decided to reject the request, + * then don't try to proxy it. + */ + if (request->reply->code == PW_AUTHENTICATION_REJECT) { + DEBUG2("Cancelling proxy as request was already rejected"...
1
return RLM_MODULE_NOOP; } + /* + * If the server has already decided to reject the request, + * then don't try to proxy it. + */ + if (request->reply->code == PW_AUTHENTICATION_REJECT) { + DEBUG2("Cancelling proxy as request was already rejected"); + return RLM_MODULE_REJECT; + } + /* * Length == 0 mea...
then don't bother proxying it. instead, log a debug message saying that the proxy was cancelled.
--- src/main/process.c +++ src/main/process.c @@ -2688,6 +2688,8 @@ static void request_proxied(REQUEST *request, int action) switch (action) { case FR_ACTION_DUP: + if (!request->proxy_listener) return; + if ((home->state == HOME_STATE_IS_DEAD) || (request->proxy_listener->status != RAD_LISTEN_STATUS_...
Hack to work around race condition
--- src/main/process.c +++ src/main/process.c @@ -2688,6 +2688,8 @@ static void request_proxied(REQUEST *request, int action) + if (!request->proxy_listener) return; +
0
--- src/main/process.c +++ src/main/process.c @@ -2688,6 +2688,8 @@ static void request_proxied(REQUEST *request, int action) + if (!request->proxy_listener) return; +
1
switch (action) { case FR_ACTION_DUP: + if (!request->proxy_listener) return; + if ((home->state == HOME_STATE_IS_DEAD) || (request->proxy_listener->status != RAD_LISTEN_STATUS_KNOWN)) { request_proxy_anew(request);
we may give up on a proxied packet (and set proxy_listener = null) just as we're receiving a duplicate packet from the nas. in that case, we catch it, and do nothing
--- src/main/version.c +++ src/main/version.c @@ -38,6 +38,7 @@ void version(void) { fprintf(stderr, "%s: %s\n", progname, radiusd_version); +#if 0 fprintf(stderr, "Compilation flags: "); /* here are all the conditional feature flags */ @@ -51,6 +52,7 @@ void version(void) fprintf(stderr," WITH_SNMP"); #e...
No longer pretend that we print out autoconf info at runtime. This would
--- src/main/version.c +++ src/main/version.c @@ -38,6 +38,7 @@ void version(void) +#if 0 @@ -51,6 +52,7 @@ void version(void) +#endif
0
--- src/main/version.c +++ src/main/version.c @@ -38,6 +38,7 @@ void version(void) +#if 0 @@ -51,6 +52,7 @@ void version(void) +#endif
1
{ fprintf(stderr, "%s: %s\n", progname, radiusd_version); +#if 0 fprintf(stderr, "Compilation flags: "); /* here are all the conditional feature flags */ fprintf(stderr," WITH_SNMP"); #endif fprintf(stderr,"\n"); +#endif exit (0); }
be nice, but writing an automatic way is hard and manually doing it would be abandoned.
--- src/lib/valuepair.c +++ src/lib/valuepair.c @@ -71,6 +71,7 @@ VALUE_PAIR *paircreate(int attr, int type) if ((da = dict_attrbyvalue(attr)) != NULL) { strcpy(vp->name, da->name); vp->type = da->type; + vp->flags = da->flags; } else if (VENDOR(attr) == 0) { sprintf(vp->name, "Attr-%u", attr); } else {...
Fixed bug in 'paircreate' where it did not copy the vp->flags data structure
For unknown attributes, print vendor name, too. Initial revision
--- src/lib/valuepair.c +++ src/lib/valuepair.c VALUE_PAIR *paircreate(int attr, int type) memset(vp, 0, sizeof(VALUE_PAIR)); if ((da = dict_attrbyvalue(attr)) != NULL) { + vp->flags = da->flags;
0
--- src/lib/valuepair.c +++ src/lib/valuepair.c @@ -71,6 +71,7 @@ VALUE_PAIR *paircreate(int attr, int type) + vp->flags = da->flags;
1
if ((da = dict_attrbyvalue(attr)) != NULL) { strcpy(vp->name, da->name); vp->type = da->type; + vp->flags = da->flags; } else if (VENDOR(attr) == 0) { sprintf(vp->name, "Attr-%u", attr); } else {
item correctly, causing problems with attributes that require special handling such as tunnel-password. noted by chris brotsos <cbrotsos.net>
--- src/lib/valuepair.c +++ src/lib/valuepair.c @@ -516,12 +516,15 @@ VALUE_PAIR *pairmake(const char *attribute, const char *value, int operator) /* Wildcard tag for check items */ tag = TAG_ANY; *ts = 0; - } else { + } else if ((ts[1] >= 0) && (ts[1] <= '9')) { /* It's not...
When parsing tags, only allow numeric tags. If we see anything
Updated 'pairmake()' to allow parsing of Tags for attributes. added a bunch of 'const' added more error messages to valuepair.c
--- src/lib/valuepair.c +++ src/lib/valuepair.c VALUE_PAIR *pairmake(const char *attribute, const char *value, int operator) ts = strrchr( attribute, ':' ); if (ts && ts[1]) { if (ts[1] == '*' && ts[2] == 0) { - } else { + } else if ((ts[1] >= 0) && (ts[1] <= '9')) { tag = strtol(ts + 1, &t...
0
--- src/lib/valuepair.c +++ src/lib/valuepair.c @@ -516,12 +516,15 @@ VALUE_PAIR *pairmake(const char *attribute, const char *value, int operator) - } else { + } else if ((ts[1] >= 0) && (ts[1] <= '9')) { - *ts = 0; + *ts = 0; + } else { + librad_log("Invalid tag for attribute %s", attribute); + ...
1
/* Wildcard tag for check items */ tag = TAG_ANY; *ts = 0; - } else { + } else if ((ts[1] >= 0) && (ts[1] <= '9')) { /* It's not a wild card tag */ tag = strtol(ts + 1, &tc, 0); if (tc && !*tc && TAG_VALID_ZERO(tag)) - *ts = 0; + *ts = 0; ...
else, we give a parse error.
--- src/main/detail.c +++ src/main/detail.c @@ -580,7 +580,16 @@ int detail_recv(rad_listen_t *listener, alloc_packet: data->tries++; - rad_assert(data->state == STATE_QUEUED); + /* + * The writer doesn't check that the record was + * completely written. If the disk is full, this can + * result in a truncate...
Treat bad records as EOF.
--- src/main/detail.c +++ src/main/detail.c @@ -580,7 +580,16 @@ int detail_recv(rad_listen_t *listener, - rad_assert(data->state == STATE_QUEUED); + /* + * The writer doesn't check that the record was + * completely written. If the disk is full, this can + * result in a truncated record. When that happens, + * t...
0
--- src/main/detail.c +++ src/main/detail.c @@ -580,7 +580,16 @@ int detail_recv(rad_listen_t *listener, - rad_assert(data->state == STATE_QUEUED); + /* + * The writer doesn't check that the record was + * completely written. If the disk is full, this can + * result in a truncated record. When that happens, + * t...
1
alloc_packet: data->tries++; - rad_assert(data->state == STATE_QUEUED); + /* + * The writer doesn't check that the record was + * completely written. If the disk is full, this can + * result in a truncated record. When that happens, + * treat it as EOF. + */ + if (data->state != STATE_QUEUED) { + radlog(...
this helps when the disk is full, and rlm_detail writes a partial record.
--- src/main/listen.c +++ src/main/listen.c @@ -1715,7 +1715,7 @@ static rad_listen_t *listen_parse(const char *filename, CONF_SECTION *cs, const listen_type = NULL; DEBUG2(" listen {"); - + rcode = cf_item_parse(cs, "type", PW_TYPE_STRING_PTR, &listen_type, ""); if (rcode < 0) return NULL; @@ -17...
listen sections in the default config can point to a virtual
Moved some "listen" directives into the "server" section, to
--- src/main/listen.c +++ src/main/listen.c static rad_listen_t *listen_parse(const char *filename, CONF_SECTION *cs, const char *server) listen_type = NULL; rcode = cf_item_parse(cs, "type", PW_TYPE_STRING_PTR, if (type == RAD_LISTEN_NONE) { + /* + * Allow listen sections in the default config to + * refer to ...
0
--- src/main/listen.c +++ src/main/listen.c @@ -1715,7 +1715,7 @@ static rad_listen_t *listen_parse(const char *filename, CONF_SECTION *cs, const - + @@ -1735,6 +1735,16 @@ static rad_listen_t *listen_parse(const char *filename, CONF_SECTION *cs, const + /* + * Allow listen sections in the default config to + * refe...
1
listen_type = NULL; DEBUG2(" listen {"); - + rcode = cf_item_parse(cs, "type", PW_TYPE_STRING_PTR, &listen_type, ""); if (rcode < 0) return NULL; return NULL; } + /* + * Allow listen sections in the default config to + * refer to a server. + */ + if (!server) { + rcode = cf_item_parse(...
server. ones inside of a virtual server inherit their parent
--- src/main/listen.c +++ src/main/listen.c @@ -2072,6 +2072,21 @@ static int listen_bind(rad_listen_t *this) radlog(L_ERR, "Failed opening %s: %s", buffer, strerror(errno)); return -1; } + +#ifdef FD_CLOEXEC + /* + * We don't want child processes inheriting these + * file descriptors. + */ + rcode = fcntl(t...
Set "close on exec" flag
--- src/main/listen.c +++ src/main/listen.c @@ -2072,6 +2072,21 @@ static int listen_bind(rad_listen_t *this) + +#ifdef FD_CLOEXEC + /* + * We don't want child processes inheriting these + * file descriptors. + */ + rcode = fcntl(this->fd, F_GETFD); + if (rcode >= 0) { + if (fcntl(this->fd, F_SETFD, rcode | FD_CLOE...
0
--- src/main/listen.c +++ src/main/listen.c @@ -2072,6 +2072,21 @@ static int listen_bind(rad_listen_t *this) + +#ifdef FD_CLOEXEC + /* + * We don't want child processes inheriting these + * file descriptors. + */ + rcode = fcntl(this->fd, F_GETFD); + if (rcode >= 0) { + if (fcntl(this->fd, F_SETFD, rcode | FD_CLOE...
1
radlog(L_ERR, "Failed opening %s: %s", buffer, strerror(errno)); return -1; } + +#ifdef FD_CLOEXEC + /* + * We don't want child processes inheriting these + * file descriptors. + */ + rcode = fcntl(this->fd, F_GETFD); + if (rcode >= 0) { + if (fcntl(this->fd, F_SETFD, rcode | FD_CLOEXEC) < 0) { + close(th...
just to be safe.
--- src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c +++ src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c @@ -491,6 +491,7 @@ static int mschapv2_authenticate(void *arg, EAP_HANDLER *handler) response = pairmake("MS-CHAP2-Response", "0x00", T_OP_EQ); if (!response) { + pairfree(&challen...
If we've run out of memory, free(challenge), too.
A little better checks for length. Untested EAP-MS-CHAPv2 module, based on reading of the expired
--- src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c +++ src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c static int mschapv2_authenticate(void *arg, EAP_HANDLER *handler) if (!challenge) { if (!response) { + pairfree(&challenge);
0
--- src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c +++ src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c @@ -491,6 +491,7 @@ static int mschapv2_authenticate(void *arg, EAP_HANDLER *handler) + pairfree(&challenge);
1
response = pairmake("MS-CHAP2-Response", "0x00", T_OP_EQ); if (!response) { + pairfree(&challenge); radlog(L_ERR, "rlm_eap_mschapv2: out of memory"); return 0; }
just to be pedantic. this fixes coverity bug
--- src/modules/rlm_perl/rlm_perl.c +++ src/modules/rlm_perl/rlm_perl.c @@ -1053,6 +1053,9 @@ static int rlmperl_call(void *instance, REQUEST *request, char *function_name) PW_USER_NAME); request->password = pairfind(request->packet->vps, PW_USER_PASSWORD); + if (!request->password) + reques...
request->password is User-Password or CHAP-Password.
Commited a fix for bug #390 Reverted change 1.38 -> 1.39. pairmove() uses operators, which Make %RAD_REQUEST read-write Updated with latest set of changes from Boian Jordanov
--- src/modules/rlm_perl/rlm_perl.c +++ src/modules/rlm_perl/rlm_perl.c static int rlmperl_call(void *instance, REQUEST *request, char *function_name) if ((get_hv_content(rad_request_hv, &vp)) > 0 ) { pairfree(&request->packet->vps); request->password = pairfind(request->packet->vps, + if (!request->password) + ...
0
--- src/modules/rlm_perl/rlm_perl.c +++ src/modules/rlm_perl/rlm_perl.c @@ -1053,6 +1053,9 @@ static int rlmperl_call(void *instance, REQUEST *request, char *function_name) + if (!request->password) + request->password = pairfind(request->packet->vps, + PW_CHAP_PASSWORD);
1
PW_USER_NAME); request->password = pairfind(request->packet->vps, PW_USER_PASSWORD); + if (!request->password) + request->password = pairfind(request->packet->vps, + PW_CHAP_PASSWORD); } if ((get_hv_content(rad_reply_hv, &vp)) > 0 ) {
that's probably a bad idea
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
14