Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Restricting access to a file

Restricting access to a file

Scheduled Pinned Locked Moved C / C++ / MFC
javaxmlquestion
5 Posts 3 Posters 0 Views 1 Watching
  • 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.
  • T Offline
    T Offline
    theCPkid
    wrote on last edited by
    #1

    My application stores its settings in an XML file on user's PC. But the data inside the xml file can be easily read and changed by anyone who can see that file. I want to lock that file so that no one can open that file except my application. Is there any way to achieve this without encrypting/decrypting whatever I dump into file?

    the fruits of your success will be in direct ratio to the honesty and sincerity of your own efforts in keeping your own records, doing your own thinking and, reaching your own conclusions. ..surviving in autumn..in love with spring..

    S D 2 Replies Last reply
    0
    • T theCPkid

      My application stores its settings in an XML file on user's PC. But the data inside the xml file can be easily read and changed by anyone who can see that file. I want to lock that file so that no one can open that file except my application. Is there any way to achieve this without encrypting/decrypting whatever I dump into file?

      the fruits of your success will be in direct ratio to the honesty and sincerity of your own efforts in keeping your own records, doing your own thinking and, reaching your own conclusions. ..surviving in autumn..in love with spring..

      S Offline
      S Offline
      Saurabh Garg
      wrote on last edited by
      #2

      Locking alone will not do the job. If a file is on my system then I can view it. Period. Your best best is encryption in such a case. Saurabh

      1 Reply Last reply
      0
      • T theCPkid

        My application stores its settings in an XML file on user's PC. But the data inside the xml file can be easily read and changed by anyone who can see that file. I want to lock that file so that no one can open that file except my application. Is there any way to achieve this without encrypting/decrypting whatever I dump into file?

        the fruits of your success will be in direct ratio to the honesty and sincerity of your own efforts in keeping your own records, doing your own thinking and, reaching your own conclusions. ..surviving in autumn..in love with spring..

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Can you add an ACE to the file's ACL?

        "Love people and use things, not love things and use people." - Unknown

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        T 1 Reply Last reply
        0
        • D David Crow

          Can you add an ACE to the file's ACL?

          "Love people and use things, not love things and use people." - Unknown

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          T Offline
          T Offline
          theCPkid
          wrote on last edited by
          #4

          Suppose, I add write restriciton for the user but won't that restrict my application too from writing to that file? I am yet to look into this.

          the fruits of your success will be in direct ratio to the honesty and sincerity of your own efforts in keeping your own records, doing your own thinking and, reaching your own conclusions. ..surviving in autumn..in love with spring..

          D 1 Reply Last reply
          0
          • T theCPkid

            Suppose, I add write restriciton for the user but won't that restrict my application too from writing to that file? I am yet to look into this.

            the fruits of your success will be in direct ratio to the honesty and sincerity of your own efforts in keeping your own records, doing your own thinking and, reaching your own conclusions. ..surviving in autumn..in love with spring..

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            If access to your file was limited to a certain user, then you could run your program as that user. I've not done this before so it may or may not work for your situation.

            "Love people and use things, not love things and use people." - Unknown

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups