none
Add read permission to a file for all users in C++ RRS feed

  • Question

  • Hi,

    I'm using Visual Studio 2008 on Windows 10 with AppLocker.

    I create a new file using ofstream.

    When switching a user, I see that the file that was created has no read permission by a user that didn't create the file.

    I want to add read permission for all users programmatically in C++.

    I'm not using C++17.

    Thanks,

    Zvika.

    Tuesday, June 4, 2019 1:09 PM

All replies

  • Hi,

    I'm using Visual Studio 2008 on Windows 10 with AppLocker.

    I create a new file using ofstream.

    When switching a user, I see that the file that was created has no read permission by a user that didn't create the file.

    I want to add read permission for all users programmatically in C++.

    I'm not using C++17.

    Thanks,

    Zvika.

    See the discussion and sample code at Modifying the ACLs of an Object in C++

    So you would use the sample to grant GENERIC_READ permission to the Everyone group.

    Tuesday, June 4, 2019 7:52 PM
  • Hi Zvika V._

    Sorry to trouble you and just want to confirm that if your issue is solved or not, if not, please feel free to let us know, we will try our best to help you out.

    BTW, if you think the reply is helpful and could please mark it as answer, that benefits for other community members who meet the similar issue, thanks in advance.

    If you have any other VS IDE issues, please let us know.

    Have a nice day!

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Monday, June 10, 2019 11:23 AM