Announcement

Collapse
No announcement yet.

Reading Unix Files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reading Unix Files

    I want to upload an application written in DOS PB so people can
    run it on the Web. This works fine but I don't want them to be
    able to download it and run it on their PC's at home as it's a
    commercial product. To accomplish this I thought I'd just have
    the progam read a file in the local directory before it'd run.
    Since this file would not be on someone's computer if the app was
    downloaded the program wouldn't run. While this works fine on my
    PC, it doesn't work when I upload the app to my website (Linux OS).

    Can anyone tell me how I can accomplish this, either by reading the
    file or by some other method.

    Thanks, George Green

    ------------------

  • #2
    George,
    don't you just set the file permissions under Unix (using the CHMOD command) to allow execute but not to allow read or write?

    Then the program can't be read (downloaded) or written to (altered/overwritten) but can be executed.

    Paul.


    ------------------

    Comment


    • #3
      Just tried that but the program won't execute when read is
      disabled. When read is allowed it can be downloaded. I'm just
      putting a link to the program from a browser. Is there another
      way to excute a program on a Linux server?
      -George

      [This message has been edited by Geo. Green (edited August 15, 2003).]

      Comment


      • #4
        george,
        <<i don't want them to be able to download it and run it on their pc's at home as it's a commercial product.>>

        from that description i assumed you were executing this file on the server and just sending the results to the user.


        <<i'm just putting a link to the program from a browser.>>

        but from this description it sounds like you're downloading the program to the user's pc and executing it there.
        unless you've taken some steps to have the unix server run the dos code (such as mentioned at http://www.powerbasic.com/support/pb...ead.php?t=1124 )then your dos program will not run on any unix machine, they aren't compatible.

        paul.

        ------------------

        Comment


        • #5
          Hmm, sounds like you forgetting something. Correct me if I'm wrong;
          You have a Dos app, that needs to be run from the internet on the
          customers site, you have a link to this .exe on the website.
          People click on the link, the program is downloaded !! to the customers
          PC and runs on there.
          There is no way that you can protect this, as it needs to be transferred to
          the customer to be run anyway. Smart people could allways use
          debug.exe to write it to file. (Even XP has a debug.exe in the system32 directory).
          But a simple right click and 'save as' from within the webbrowser would do fine aswell.
          Only if the program would run on the server, you could absolutely protect
          it, but what you want now is a 'contradictious intermino'. Or in
          other words IMPOSSIBLE !

          Sorry

          Herman.


          ------------------
          You gotta run, and don't loop back.
          You gotta run, and don't loop back.

          Comment


          • #6
            Well impossible it is not, but the only way it could work, is
            build a loader, that has a transportmechanism (to-from the website),
            that loads the propriaty stuff , and runs it. This is the shortest
            possbile way I see to have some kind of protection on the program.

            Hope this will cheer you up a bit.

            Herman.


            ------------------
            You gotta run, and don't loop back.
            You gotta run, and don't loop back.

            Comment


            • #7
              What about having the program read a file off the web?
              I notice reference to "Direct Console I/O" in the latest powerbasic
              ads (I have the 1995 version 3.1). Would an upgrade to 3.5 (or
              whatever it is now) enable me to require that a file be read off
              a web site I'd have the file uploaded to? Without the file the
              program wouldn't run.

              -George

              Originally posted by Herman Kieskamp:
              Well impossible it is not, but the only way it could work, is
              build a loader, that has a transportmechanism (to-from the website),
              that loads the propriaty stuff , and runs it. This is the shortest
              possbile way I see to have some kind of protection on the program.

              Hope this will cheer you up a bit.

              Herman.




              ------------------

              Comment


              • #8
                Is there a absolute need for PB-DOS ??

                Otherwise I would switch over to PBCC, is the easiest step over from
                console based DOS to console based windows. You have TCP and thus website,ftp access,
                and much more...
                You should have a look at it. PB-Dos is going to be a to big a hassle, need all kind of
                library's, that might not even be around (anymore).

                Herman.


                ------------------
                You gotta run, and don't loop back.
                You gotta run, and don't loop back.

                Comment


                • #9
                  Actually I did purchase PBCC but I was looking for a quick way to put this
                  particular program on the web without making the conversion.
                  I used several 3rd party packages (including the full power toolkit)
                  to write the program initally. I may just have to suck it up
                  and do the rewrite.
                  -George


                  Originally posted by Herman Kieskamp:
                  Is there a absolute need for PB-DOS ??

                  Otherwise I would switch over to PBCC, is the easiest step over from
                  console based DOS to console based windows. You have TCP and thus website,ftp access,
                  and much more...
                  You should have a look at it. PB-Dos is going to be a to big a hassle, need all kind of
                  library's, that might not even be around (anymore).

                  Herman.




                  ------------------

                  Comment


                  • #10
                    The step from PBDos to PBCC is much easier and because of the
                    possibility to write eventless code, almost 1-on-1. Lots of same functions/commands,
                    you'll be suprised how easily it could be done if it is 'straightforward' programmed.
                    'straightforward' = no hardware interrupts, few software interrupts, not tomuch librarys or
                    third party pieces.

                    Wish you good luck in this chew.

                    Herman.


                    ------------------
                    You gotta run, and don't loop back.
                    You gotta run, and don't loop back.

                    Comment


                    • #11
                      Originally posted by Geo. Green:
                      I want to upload an application written in DOS PB so people can
                      run it on the Web. This works fine but I don't want them to be
                      able to download it and run it on their PC's at home as it's a
                      commercial product. To accomplish this I thought I'd just have
                      the progam read a file in the local directory before it'd run.
                      Since this file would not be on someone's computer if the app was
                      downloaded the program wouldn't run. While this works fine on my
                      PC, it doesn't work when I upload the app to my website (Linux OS).

                      Can anyone tell me how I can accomplish this, either by reading the
                      file or by some other method.

                      Thanks, George Green

                      Hi, George -

                      The only thing that comes to mind is the Client/Server model.

                      If you were to write your own client that allowed the user to interact with the program, but to not download or save the Server app...

                      I don't know how well this could be used with your current app. Without developing the Client/Server protocols and building them into your app to begin with, you might be stuck.


                      ------------------
                      Don't sweat it, it's only ones and zeros

                      Comment


                      • #12
                        Ok, well aside from the obvious fact that running a dos
                        executable on non-dos system presents problems, here's
                        a solution to the other problem:

                        configure apache to not allow files in the cgi-bin directory
                        to be downloaded (this is, in fact, the default setup in 99%
                        of all web servers on all linux systems). no worries about
                        looking for a file that anyone could find the name of by
                        running "strings < yourprogram.exe" anyway.

                        as for the dos vs. linux issue, i can think of a few solutions:

                        1. rewrite it in perl. (very similar to basic--and free!)
                        2. ask your client to install the ol' dos emulator.
                        write a perl script that starts up your program in
                        said dos emulator.
                        3. ask your client to go through the hell of configuring wine.

                        i would probably go with 1 or 2. 1 will be the easiest on your
                        client, which i would assume is the top priority.

                        ------------------

                        Comment


                        • #13
                          Hi George,

                          As Kim mentioned Apache, did you update httpd.conf for:

                          AddHandler cgi-script .cgi .pl .exe

                          To run perl from PB, you have to do SHELL to Perl?
                          Can you post the short code to run CGI script from PBDOS, such as
                          SHELL "C:\path\file.cgi"

                          Do you know a link or help topic on
                          How To write file.txt to file.exe in PB,
                          and to be run from PB?

                          Did you try Perl2Exe and watch IndigoStar Licence Agreement,
                          such as below question from a Linux User?

                          The below phrase is 1 of a few conditions of Licence Agreement
                          from Indigostar for using the Registered Version of Perl2Exe,
                          to generate my source codes, in Perl for Math Database, to an
                          exe program to be used on Windows:

                          "* Exe files generated by the registered version of Perl2exe may
                          be freely distributed."

                          Detail at: http://www.indigostar.com/pxman.htm#License

                          My questions:

                          The words "freely distributed" mean by:

                          1. Only myself.
                          2. Only Indigostar and by myself.
                          3. Any software pirates....?

                          Thank



                          ------------------
                          http://www.lecan.net
                          http://www.lecan.net

                          Comment

                          Working...
                          X