From 4ea62745cfeabbb570b37a501e6c7ccea51d55ee Mon Sep 17 00:00:00 2001 From: ariaworld <143797359+ariaworld@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:09:44 +0100 Subject: [PATCH 1/8] Fixes ckey transfers making keys lowercase --- code/modules/admin/admin.dm | 2 +- code/modules/mob/dead/observer/respawn.dm | 2 +- code/modules/mob/mob.dm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 891f6250da32..b529c0ed01c2 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1001,7 +1001,7 @@ log_admin("[key_name(usr)] stuffed [frommob.key] into [tomob.name].") SSblackbox.record_feedback("tally", "admin_verb", 1, "Ghost Drag Control") - tomob.ckey = frommob.ckey + tomob.key = frommob.key qdel(frommob) return TRUE diff --git a/code/modules/mob/dead/observer/respawn.dm b/code/modules/mob/dead/observer/respawn.dm index 5d1f65311df7..2390e6fd1e2a 100644 --- a/code/modules/mob/dead/observer/respawn.dm +++ b/code/modules/mob/dead/observer/respawn.dm @@ -180,5 +180,5 @@ client.view_size.resetToDefault() var/mob/dead/new_player/M = new /mob/dead/new_player - M.ckey = ckey + M.key = key return M diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index e9bb92516cbc..810930123835 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -461,7 +461,7 @@ client.prefs.chat_toggles ^= CHAT_OOC if (!(client.prefs.chat_toggles & CHAT_OOC) && isdead(new_mob)) client.prefs.chat_toggles ^= CHAT_OOC - new_mob.ckey = ckey + new_mob.key = key if(send_signal) SEND_SIGNAL(src, COMSIG_MOB_KEY_CHANGE, new_mob, src) return TRUE From caec26cd205e89775982519c562e7ba87936fcdf Mon Sep 17 00:00:00 2001 From: Letter N <24603524+LetterN@users.noreply.github.com> Date: Wed, 4 Dec 2024 23:05:09 +0800 Subject: [PATCH 2/8] buh --- code/datums/world_topic.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 679d2faf1117..154b735c02f9 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -26,7 +26,7 @@ var/require_comms_key = FALSE /datum/world_topic/proc/TryRun(list/input, addr) - key_valid = config && (CONFIG_GET(string/comms_key) == input["key"]) + key_valid = (CONFIG_GET(string/comms_key) == input["key"]) && CONFIG_GET(string/comms_key) && input["key"] if(require_comms_key && !key_valid) return "Bad Key" input -= "key" From 91c911383bd33c5f61ffb85a9826c2af7c28c0e1 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 4 Dec 2024 16:01:03 -0300 Subject: [PATCH 3/8] stuff --- code/datums/datacore.dm | 12 +++----- code/game/machinery/computer/security.dm | 38 ++++++++++++++++++++---- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index c82f8fa605fa..bfc2bc6f036c 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -142,18 +142,14 @@ var/static/list/show_directions = list(SOUTH, WEST) if(H.mind && (H.mind.assigned_role != H.mind.special_role)) var/assignment - var/displayed_rank if(H.mind.assigned_role) assignment = H.mind.assigned_role else if(H.job) assignment = H.job else assignment = "Unassigned" - if(C && C.prefs && C.prefs.alt_titles_preferences[assignment]) - assignment = C.prefs.alt_titles_preferences[assignment] - - if(assignment) - displayed_rank = C.prefs.alt_titles_preferences[assignment] + if(C && C.prefs && C.prefs.alt_titles_preferences[assignment]) + assignment = C.prefs.alt_titles_preferences[assignment] var/static/record_id_num = 1001 var/id = num2hex(record_id_num++,6) @@ -176,7 +172,7 @@ var/datum/data/record/G = new() G.fields["id"] = id G.fields["name"] = H.real_name - G.fields["rank"] = displayed_rank + G.fields["rank"] = assignment G.fields["age"] = H.age G.fields["species"] = H.dna.species.name G.fields["fingerprint"] = md5(H.dna.uni_identity) @@ -223,7 +219,7 @@ var/datum/data/record/L = new() L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") //surely this should just be id, like the others? L.fields["name"] = H.real_name - L.fields["rank"] = displayed_rank + L.fields["rank"] = assignment L.fields["age"] = H.age if(H.gender == MALE) G.fields["gender"] = "Male" diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 6322bbf7e9ae..c749e7f5ec4b 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -175,7 +175,12 @@ Gender: [active1.fields["gender"]]  Age: [active1.fields["age"]] "} dat += "Species: [active1.fields["species"]] " - dat += {"Rank: [active1.fields["rank"]]  + var/record_rank = GetJobName(active1.fields["rank"]) + var/datum/job/job_datum = SSjob.name_occupations[record_rank] + var/how_many_alts = job_datum ? length(job_datum.alt_titles) : null + dat += {"Rank: [active1.fields["rank"]]  +
+ Change title ([how_many_alts + 1] options) Fingerprint: [active1.fields["fingerprint"]]  Physical Status: [active1.fields["p_stat"]]  Mental Status: [active1.fields["m_stat"]]  @@ -692,23 +697,44 @@ What a mess.*/ temp += "
  • Discharged
  • " temp += "" if("rank") - if(istype(active1, /datum/data/record) && ((ACCESS_CAPTAIN in logged_access) || (ACCESS_HOP in logged_access))) + if(istype(active1, /datum/data/record) && ((ACCESS_CAPTAIN in logged_access) || (ACCESS_HOP in logged_access) || (ACCESS_CENT_GENERAL in logged_access))) temp = "
    Rank:
    " temp += "" else alert(usr, "You do not have the required rank to do this!") + if("alt_title") + if(istype(active1, /datum/data/record) && ((ACCESS_CAPTAIN in logged_access) || (ACCESS_HOP in logged_access) || (ACCESS_CENT_GENERAL in logged_access))) + temp = "
    Rank Title:
    " + temp += "" + else + alert(usr, "You do not have the required rank to do this!") + //TEMPORARY MENU FUNCTIONS else//To properly clear as per clear screen. temp=null switch(href_list["choice"]) if("Change Rank") if(active1) - active1.fields["rank"] = href_list["rank"] - if(href_list["rank"] in get_all_jobs()) - active1.fields["real_rank"] = href_list["real_rank"] + if(GetJobName(href_list["rank"]) != "Unknown") // hi hello you looking, stop trying to exploit html + active1.fields["rank"] = href_list["rank"] + active1.fields["real_rank"] = GetJobName(href_list["rank"]) if("Change Criminal Status") if(active2) From ad23911fe8071a05b7fef86e5417d85d7da3eb94 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 4 Dec 2024 16:10:09 -0300 Subject: [PATCH 4/8] set real rank, NOWWWW --- code/datums/datacore.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index bfc2bc6f036c..2e01b45d76a5 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -173,6 +173,7 @@ G.fields["id"] = id G.fields["name"] = H.real_name G.fields["rank"] = assignment + G.fields["real_rank"] = GetJobName(assignment) G.fields["age"] = H.age G.fields["species"] = H.dna.species.name G.fields["fingerprint"] = md5(H.dna.uni_identity) @@ -220,6 +221,7 @@ L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") //surely this should just be id, like the others? L.fields["name"] = H.real_name L.fields["rank"] = assignment + L.fields["real_rank"] = GetJobName(assignment) L.fields["age"] = H.age if(H.gender == MALE) G.fields["gender"] = "Male" From 7ef7fc4f393919f09139be60365da466f72e39c7 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 4 Dec 2024 16:12:06 -0300 Subject: [PATCH 5/8] i just realized this might be possible --- code/game/machinery/computer/security.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index c749e7f5ec4b..4e462a7ebf30 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -732,7 +732,7 @@ What a mess.*/ switch(href_list["choice"]) if("Change Rank") if(active1) - if(GetJobName(href_list["rank"]) != "Unknown") // hi hello you looking, stop trying to exploit html + if(GetJobName(href_list["rank"]) != "Unknown" && GetJobName(href_list["rank"]) != "Centcom") // hi hello you looking, stop trying to exploit html active1.fields["rank"] = href_list["rank"] active1.fields["real_rank"] = GetJobName(href_list["rank"]) From 62211ba7126b1dc26e30124f682dc2bc467b75f6 Mon Sep 17 00:00:00 2001 From: Sandstorm Bot <85452301+Sandstorm-Bot@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:20:12 +0000 Subject: [PATCH 6/8] Automatic changelog generation for PR #390 [ci skip] --- html/changelogs/AutoChangeLog-pr-390.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-390.yml diff --git a/html/changelogs/AutoChangeLog-pr-390.yml b/html/changelogs/AutoChangeLog-pr-390.yml new file mode 100644 index 000000000000..45dfb5deb461 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-390.yml @@ -0,0 +1,8 @@ +author: SandPoot +delete-after: true +changes: + - rscadd: Higher staff can now set titles for you on the manifest using the security + console. + - bugfix: Manifest will no longer have people with null jobs. + - bugfix: High security vulnerability, you can no longer set your rank to be anything + (see pr for info). From 4b12ee53bb49f962c88db32e6d98738984a9980a Mon Sep 17 00:00:00 2001 From: Sandstorm Bot <85452301+Sandstorm-Bot@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:21:13 +0000 Subject: [PATCH 7/8] Automatic changelog compile [ci skip] --- .../{AutoChangeLog-pr-390.yml => archive/2024-12.yml} | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) rename html/changelogs/{AutoChangeLog-pr-390.yml => archive/2024-12.yml} (86%) diff --git a/html/changelogs/AutoChangeLog-pr-390.yml b/html/changelogs/archive/2024-12.yml similarity index 86% rename from html/changelogs/AutoChangeLog-pr-390.yml rename to html/changelogs/archive/2024-12.yml index 45dfb5deb461..bd96c05db4a8 100644 --- a/html/changelogs/AutoChangeLog-pr-390.yml +++ b/html/changelogs/archive/2024-12.yml @@ -1,6 +1,5 @@ -author: SandPoot -delete-after: true -changes: +2024-12-04: + SandPoot: - rscadd: Higher staff can now set titles for you on the manifest using the security console. - bugfix: Manifest will no longer have people with null jobs. From 91e8a8ae3b3c30e68caf3da526e2a357fcf33cf3 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 4 Dec 2024 16:22:27 -0300 Subject: [PATCH 8/8] quick fix --- code/game/machinery/cryopod.dm | 2 +- code/modules/mob/living/silicon/ai/ai.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 5cdfaac9400f..0f107a0604ac 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -316,7 +316,7 @@ GLOBAL_LIST_EMPTY(cryopod_computers) // Make an announcement and log the person entering storage. if(GLOB.announcement_systems.len) var/obj/machinery/announcement_system/announcer = pick(GLOB.announcement_systems) - announcer.announce(tele ? "CRYOSTORAGE_TELE" : "CRYOSTORAGE", mob_occupant.real_name, announce_rank, list()) + announcer.announce(tele ? "CRYOSTORAGE_TELE" : "CRYOSTORAGE", mob_occupant.real_name, announce_rank, announce_rank, list()) visible_message(span_notice("\The [src] hums and hisses as it [tele ? "teleports" : "moves"] [mob_occupant.real_name] [tele ? "to centcom" : "into storage"].")) if(tele) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index fd767a774530..5306649e2515 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -1031,7 +1031,7 @@ if(GLOB.announcement_systems.len) // Sends an announcement the AI has cryoed. var/obj/machinery/announcement_system/announcer = pick(GLOB.announcement_systems) - announcer.announce("CRYOSTORAGE", src.real_name, announce_rank, list()) + announcer.announce("CRYOSTORAGE", real_name, announce_rank, announce_rank, list()) new /obj/structure/ai_core/latejoin_inactive(loc) if(src.mind) //Handle job slot/tater cleanup.