From Paul van der Zwan
[deb_libnfs.git] / lib / libnfs.c
index c637a7518f172d696ed63b4d54f9df62333280b6..905e9d80656ca99e38c567d50da6211a70f7a3b7 100644 (file)
@@ -646,6 +646,9 @@ static void nfs_stat_1_cb(struct rpc_context *rpc _U_, int status, void *command
         st.st_dev     = -1;
         st.st_ino     = res->GETATTR3res_u.resok.obj_attributes.fileid;
         st.st_mode    = res->GETATTR3res_u.resok.obj_attributes.mode;
+       if (res->GETATTR3res_u.resok.obj_attributes.type == NF3DIR) {
+               st.st_mode |= S_IFDIR ;
+       }
         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;