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
Forum Updated to NodeBB v4.3 + New Features

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 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.
  • F Offline
    F Offline
    Francis Chapet
    wrote on 17 Dec 2019, 07:59 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

    J 1 Reply Last reply 17 Dec 2019, 08:18
    0
    • F Francis Chapet
      17 Dec 2019, 07:59

      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

      J Offline
      J Offline
      JonB
      wrote on 17 Dec 2019, 08:18 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 17 Dec 2019, 08:36 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.

        J 1 Reply Last reply 17 Dec 2019, 08:45
        0
        • F Francis Chapet
          17 Dec 2019, 08:36

          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.

          J Offline
          J Offline
          JonB
          wrote on 17 Dec 2019, 08:45 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 17 Dec 2019, 10:28 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.

            J 1 Reply Last reply 17 Dec 2019, 12:42
            0
            • F Francis Chapet
              17 Dec 2019, 10:28

              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.

              J Offline
              J Offline
              JonB
              wrote on 17 Dec 2019, 12:42 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
              • M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 17 Dec 2019, 15:56 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.

                J 1 Reply Last reply 17 Dec 2019, 16:21
                2
                • M mrjj
                  17 Dec 2019, 15:56

                  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.

                  J Offline
                  J Offline
                  JonB
                  wrote on 17 Dec 2019, 16:21 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

                  2/8

                  17 Dec 2019, 08:18

                  6 unread
                  • Login

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