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. Software Security

Software Security

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminsecuritytutorialquestion
7 Posts 5 Posters 2 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.
  • G Offline
    G Offline
    Gunnar Matzler
    wrote on last edited by
    #1

    What i have to do is to limit the amount of users able to access an application over the network at the same time. The application i am talking about ist not a client server app. It's just something like a calculator sitting on a network cd-rom drive. i have to find out, how many users started this application on their workstation. If the limit of users has been reached, the next user shall not be able to start it. i have not the slightest idea how to achieve this. Could someone please give me a hint? :((

    A T J realJSOPR 4 Replies Last reply
    0
    • G Gunnar Matzler

      What i have to do is to limit the amount of users able to access an application over the network at the same time. The application i am talking about ist not a client server app. It's just something like a calculator sitting on a network cd-rom drive. i have to find out, how many users started this application on their workstation. If the limit of users has been reached, the next user shall not be able to start it. i have not the slightest idea how to achieve this. Could someone please give me a hint? :((

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      So the application is executed on separate machines, right? In this case you need some place to keep "shared application state" - number of users. You can store it in some database available to all workstations or in a file located on network server. When your app starts, it should increment the number of users. During app shutdown you should decrement this number. The hard part begins when you realize that application can crash and leave inconsistent information in database/shared file. Possible workaround would be saving separate 'record' for each workstation running your program. This record would contain workstation ID and "last access time". The time field is updated periodically when program runs, the updating stops after crash. If application crashes, the record would remain, but another instance of the application could be able to determine - by using time field - that the record is invalid. In this case, you need common time settings on all workstations. Tomasz Sowinski -- http://www.shooltz.com.pl

      G 1 Reply Last reply
      0
      • G Gunnar Matzler

        What i have to do is to limit the amount of users able to access an application over the network at the same time. The application i am talking about ist not a client server app. It's just something like a calculator sitting on a network cd-rom drive. i have to find out, how many users started this application on their workstation. If the limit of users has been reached, the next user shall not be able to start it. i have not the slightest idea how to achieve this. Could someone please give me a hint? :((

        A Offline
        A Offline
        Anders Molin
        wrote on last edited by
        #3

        I have never done anything like that, but it should be possible to ask the server (Win NT/2000?) how many users there is that has the file opened... I don't see any other way to do it. I have to say that I don't know how to deny other users access, sorry... - Anders Money talks, but all mine ever says is "Goodbye!"

        1 Reply Last reply
        0
        • T Tomasz Sowinski

          So the application is executed on separate machines, right? In this case you need some place to keep "shared application state" - number of users. You can store it in some database available to all workstations or in a file located on network server. When your app starts, it should increment the number of users. During app shutdown you should decrement this number. The hard part begins when you realize that application can crash and leave inconsistent information in database/shared file. Possible workaround would be saving separate 'record' for each workstation running your program. This record would contain workstation ID and "last access time". The time field is updated periodically when program runs, the updating stops after crash. If application crashes, the record would remain, but another instance of the application could be able to determine - by using time field - that the record is invalid. In this case, you need common time settings on all workstations. Tomasz Sowinski -- http://www.shooltz.com.pl

          G Offline
          G Offline
          Gunnar Matzler
          wrote on last edited by
          #4

          Thank you. I was already thinking about some kind of file located on a network server. The thing with the timestamp is a good idea. Would be even better if i could use server time. I will have to figure that out. What really troubles me is the installation of such a thing. i think the user has to be admin to install the application. And at which directory should that file be stored. It should be definitely a common directory because every workstation has to access it. Every workstation should have the writeaccess to this directory. i don't think it will be the system-directory because in most cases only admin has writeaccess to the system-directory. So how do i figure out which directory to use? I can't ask the user during installation "please tell me a common directory on the network-server where i can put the secret access control file". So as always the details are killing me. any further help would be appriciated. :confused:

          T 1 Reply Last reply
          0
          • G Gunnar Matzler

            Thank you. I was already thinking about some kind of file located on a network server. The thing with the timestamp is a good idea. Would be even better if i could use server time. I will have to figure that out. What really troubles me is the installation of such a thing. i think the user has to be admin to install the application. And at which directory should that file be stored. It should be definitely a common directory because every workstation has to access it. Every workstation should have the writeaccess to this directory. i don't think it will be the system-directory because in most cases only admin has writeaccess to the system-directory. So how do i figure out which directory to use? I can't ask the user during installation "please tell me a common directory on the network-server where i can put the secret access control file". So as always the details are killing me. any further help would be appriciated. :confused:

            T Offline
            T Offline
            Tomasz Sowinski
            wrote on last edited by
            #5

            > I can't ask the user during installation "please tell > me a common directory on the network-server where i can > put the secret access control file". The installer should read this info from some config file, editable by the network admin. Note that the location should be specified using \\server\share syntax - without network drive letters, which may be assigned differently on different workstations. Tomasz Sowinski -- http://www.shooltz.com.pl

            1 Reply Last reply
            0
            • G Gunnar Matzler

              What i have to do is to limit the amount of users able to access an application over the network at the same time. The application i am talking about ist not a client server app. It's just something like a calculator sitting on a network cd-rom drive. i have to find out, how many users started this application on their workstation. If the limit of users has been reached, the next user shall not be able to start it. i have not the slightest idea how to achieve this. Could someone please give me a hint? :((

              J Offline
              J Offline
              Jon Shute
              wrote on last edited by
              #6

              There was an idea posted in, I think, DDJ a few years about which suggested creating a DirectPlay session and having each client join it. You can very easily restrict the number of allowed connections (players). It should be a lot harder to crack than something like a network share reference count.

              1 Reply Last reply
              0
              • G Gunnar Matzler

                What i have to do is to limit the amount of users able to access an application over the network at the same time. The application i am talking about ist not a client server app. It's just something like a calculator sitting on a network cd-rom drive. i have to find out, how many users started this application on their workstation. If the limit of users has been reached, the next user shall not be able to start it. i have not the slightest idea how to achieve this. Could someone please give me a hint? :((

                realJSOPR Offline
                realJSOPR Offline
                realJSOP
                wrote on last edited by
                #7

                The only good way to do this is to write two programs - a client service that monitors execution of programs, and a server side service that kees track of open instances. 1) When the user clicks on the targetted executable, the client side service would contact the server and ask if it's okay to run the app in question. 2) The server side would return an appropriate response associated with the number of users it thinks is using the software in question 3) The client side would allow/disallow access based on the response from the server. 4) Every x number of seconds, the client side service would tell the server side service whether or not the app was still running. You can also make it so that the client side would shut dwn the app in question if for some reason it could not contact the server after x minutes (or seconds). 5) If the server doesn't get a signal from the client side in x number of secods, it could assume that the app isn't running any longer and can automatically free up one reference to the executable, thereby allowing another user to use the executable. This mechanism could be used to control access to any number of applications through a database or the registry.

                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