Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Access to Windows network shared folder from linux

Access to Windows network shared folder from linux

Scheduled Pinned Locked Moved Solved General and Desktop
qprocessmountlinuxnetwork shared
8 Posts 3 Posters 1.7k Views
  • 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.
  • F Offline
    F Offline
    Francis Chapet
    wrote on last edited by
    #1

    Hi everyone,

    I want to access to a Windows network shared folder, with domain and authentification, form my Qt application running on Ubuntu 19.10 to read and write files on it.

    The connection parameters are set in the application, so I can't mount the folder in a terminal of linux.

    I tried to execute the mount command with the QProcess class but I failed with a mount error 1: permission denied.

    Do you have any idea to solve my problem ?

    Thanks,

    Francis

    JonBJ 1 Reply Last reply
    0
    • F Francis Chapet

      Hi everyone,

      I want to access to a Windows network shared folder, with domain and authentification, form my Qt application running on Ubuntu 19.10 to read and write files on it.

      The connection parameters are set in the application, so I can't mount the folder in a terminal of linux.

      I tried to execute the mount command with the QProcess class but I failed with a mount error 1: permission denied.

      Do you have any idea to solve my problem ?

      Thanks,

      Francis

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Francis-Chapet said in Access to Windows network shared folder from linux:

      I tried to execute the mount command with the QProcess class but I failed with a mount error 1: permission denied.

      So are you able, running as yourself not root, to do the mount from the command line? If that is what you need to do for your issue (I don't know if it is, but...) then you'll either need to sort out the permissions or run the mount via sudo or similar....?

      1 Reply Last reply
      1
      • F Offline
        F Offline
        Francis Chapet
        wrote on last edited by
        #3

        I can execute successfully the mount command in a terminal with the sudo. there is the command i write in the terminal:

        sudo mount.cifs //Server/Shared /home/user/mount/shared -o user=lgn,pass=pwd,dom=dmn
        

        With the same command line in the QProcess::start parameter, I have the error mount 1 before having the sudo password request.

        JonBJ 1 Reply Last reply
        0
        • F Francis Chapet

          I can execute successfully the mount command in a terminal with the sudo. there is the command i write in the terminal:

          sudo mount.cifs //Server/Shared /home/user/mount/shared -o user=lgn,pass=pwd,dom=dmn
          

          With the same command line in the QProcess::start parameter, I have the error mount 1 before having the sudo password request.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @Francis-Chapet said in Access to Windows network shared folder from linux:

          With the same command line in the QProcess::start parameter, I have the error mount 1 before having the sudo password request.

          First please show the actual code for command you issue via QProcess to make sure you are getting it right.

          If that is true then sudo must be detecting no stdin/terminal for prompting for the password for itself, and skipping doing so I guess.

          In any case, if you are going to need sudo and if you are going to need that to prompt the user for password from a GUI Qt app, you are going to have a problem. I haven't got time to find them in this forum, but there have been many questions about this. Then answer ends up being look at the -S argument to sudo and use that to get the password across to it.

          1 Reply Last reply
          3
          • F Offline
            F Offline
            Francis Chapet
            wrote on last edited by
            #5

            I found the solution to my problem. I have to execute my application with sudo. After that it can run the mount command without any error.

            Thanks for your help.

            JonBJ 1 Reply Last reply
            0
            • F Francis Chapet

              I found the solution to my problem. I have to execute my application with sudo. After that it can run the mount command without any error.

              Thanks for your help.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #6

              @Francis-Chapet
              That is one potential solution. However, if that is the only thing your app needs sudo for it is not a very good one. If you supplied your application to me I would not be prepared to run it sudo. Up to you/your customers.

              1 Reply Last reply
              2
              • mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Hi
                Also be extremely careful if you delete files since you app now has the power
                to wipe all of the root system if something goes wrong.

                JonBJ 1 Reply Last reply
                2
                • mrjjM mrjj

                  Hi
                  Also be extremely careful if you delete files since you app now has the power
                  to wipe all of the root system if something goes wrong.

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by
                  #8

                  @mrjj
                  ...Which is one of the 1,000 reasons I would not be accepting this Qt application if it says I need to run it sudo... :)

                  1 Reply Last reply
                  1

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved