Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Real read-only file Windows

    General and Desktop
    2
    3
    2472
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      Gute last edited by

      I need to create a application for a LAN, like a little chat, but I need to save logs files with the conversations, but the files can't be erased or edited, is possible to do that? and if is possible I need a clue.

      thanks

      1 Reply Last reply Reply Quote 0
      • T
        tobias.hunger last edited by

        As far as I know that is not possible.

        Linux has a pretty obscure feature of an "append" flag for just such purposes. Files with this flag set can only have contents appended, no other write operations are possible. But even this flag is more meant as a way to prevent accidents than to stop file owners from editing it.

        Depending on how temper proof you need your system to be you could just run a logger process as some system user, have it log into files belonging to this system user and only allow read access to the users. Might be good enough, even though any admin (or anybody booting from a linux live CD) can still meddle with the logs.

        The only temper-proof way I can see is to write your file to a WORM (Write Once Read Many) medium.

        Alternatively you might be able to come up with a system based on hashes and asymetric encryption which could detect manipulation of the log file. But make sure to get lots of reviews on your architecture and implementation if you go down this alley: It is hard to get this right!

        1 Reply Last reply Reply Quote 0
        • G
          Gute last edited by

          Thanks for the answer, I thought it was not possible, and thanks for the alternatives

          1 Reply Last reply Reply Quote 0
          • First post
            Last post