Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 16, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 16, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 16, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 16, 2025

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025

      Minecraft licensing robbed us of this controversial NFL schedule release video

      May 16, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The power of generators

      May 16, 2025
      Recent

      The power of generators

      May 16, 2025

      Simplify Factory Associations with Laravel’s UseFactory Attribute

      May 16, 2025

      This Week in Laravel: React Native, PhpStorm Junie, and more

      May 16, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025
      Recent

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»CodeSOD: Private Passwords

    CodeSOD: Private Passwords

    August 27, 2024

    Lisa was working on a project she quite liked. The tech was cool, the problems being solved were interesting, and the team had a good working process. Company-wide, however, budgets were tight, and other projects were in much worse shape, so the project Lisa was on got put on pause, and her team was moved onto a different project.

    Someone wanted to make sure that functions which had large side effects were only called in the right places. Now, most of us might use some mixture of public/private, clear documentation, and maybe some key flags and error checking to ensure this was the case.

    This team had a… different approach.

    // This is called so that Foo will unload all widgets before exiting.
    // It is currently only called from Form1.Closing(). A password is *required*. If not correct, this function immediately returns.
    public void UnloadAll(string pwd) {
    if (pwd == “FOO-> UNLOAD ALL”) {
    ProcessRequest(RequestType.Unload, Environments.All);
    }
    }

    The caller must supply a password to this method, otherwise it does nothing. I want to stress, this isn’t a password we expect the user to type in (having that hard-coded in the application code is a different WTF), but instead is a token that the calling code must supply if they want the function to execute.

    This entire project exists in a single .NET Assembly, and the keyword private is never used once.

    [Advertisement]
    Otter – Provision your servers automatically without ever needing to log-in to a command prompt. Get started today!

    Source: Read More 

    Hostinger
    Facebook Twitter Reddit Email Copy Link
    Previous ArticleUnderstanding Gutenberg Blocks, Patterns, and Templates
    Next Article This HR Learning Bundle is Packed with Lessons to Help You Thrive

    Related Posts

    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 16, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-47916 – Invision Community Themeeditor Remote Code Execution

    May 16, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    S.T.A.L.K.E.R. 2 developers reveal massive plans for 2025

    Development

    UX And Design Files Organization Template

    Tech & Work

    Windows 11’s PowerToys now lets you easily record screen, annotate technical presentations

    Operating Systems

    Automated test execution custom pdf reporting tool

    Development

    Highlights

    Top 12 Things To Do After Installing Elementary OS 8 (Circe)

    December 23, 2024

    In this post, we will look at the top 12 things to do after installing…

    That new Elden Ring Nightreign trailer has me more excited than ever for the roguelike RPG, but one thing has me worried

    May 2, 2025

    Xbox Gaming Handheld details emerge as millions of soon-to-be stuck Windows 10 PCs get an unlikely savior in ChromeOS and Microsoft prepares to celebrate its 50th anniversary

    March 16, 2025

    Zoom Adopts NIST-Approved Post-Quantum End-to-End Encryption for Meetings

    May 22, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.