PMAP: allow to ask for tcp/udp port, dont assume users only ever want the tcp port
[deb_libnfs.git] / lib / libnfs.c
index 1f78ca8b8fe9dacc3cc108556271e1ed9f2ad933..ace44668cfb02816c174a1662bb82bc05e0e08ae 100644 (file)
@@ -459,7 +459,7 @@ static void nfs_mount_2_cb(struct rpc_context *rpc, int status, void *command_da
                return;
        }
 
-       if (rpc_pmap_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, nfs_mount_3_cb, private_data) != 0) {
+       if (rpc_pmap_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, IPPROTO_TCP, nfs_mount_3_cb, private_data) != 0) {
                data->cb(-ENOMEM, nfs, command_data, data->private_data);
                free_nfs_cb_data(data);
                return;
@@ -686,6 +686,9 @@ static void nfs_stat_1_cb(struct rpc_context *rpc _U_, int status, void *command
        if (res->GETATTR3res_u.resok.obj_attributes.type == NF3DIR) {
                st.st_mode |= S_IFDIR ;
        }
+       if (res->GETATTR3res_u.resok.obj_attributes.type == NF3REG) {
+               st.st_mode |= S_IFREG ;
+       }
         st.st_nlink   = res->GETATTR3res_u.resok.obj_attributes.nlink;
         st.st_uid     = res->GETATTR3res_u.resok.obj_attributes.uid;
         st.st_gid     = res->GETATTR3res_u.resok.obj_attributes.gid;
@@ -3440,7 +3443,7 @@ static void mount_export_2_cb(struct rpc_context *rpc, int status, void *command
                return;
        }
 
-       if (rpc_pmap_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, mount_export_3_cb, private_data) != 0) {
+       if (rpc_pmap_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, IPPROTO_TCP, mount_export_3_cb, private_data) != 0) {
                data->cb(rpc, -ENOMEM, command_data, data->private_data);
                free_mount_cb_data(data);
                return;