6 Replies Latest reply on Jan 14, 2020 12:52 PM by hari2020

    Wildfly Directory listing

    hari2020

      Hi,

      We recently facing an issue with directory listing in wildfly.  We have a directory on linux server where all the project related files are placed.  As par to client requirement  in our application, we provided a link that will show up the file in a specific directory. Right now when user clicks  on link, directory content is showing but there is a parent directory is displaying on screen that redirects to all other directories that they do not to see.

      Eg:   MainDirectory

                   Directory1

                      File1

                  Direcotry2

                     File2

      Support if link in the application is to File2 then on screen , above the File2 a folder icon is coming and this will redirect to a screen where all directories in MainDirectory is displayed.

      I understood this is all from wildfly configuration that we did in standalone.xml but not sure how to remove/stop that parent directory navigation.

      Attached a screenshot for reference.

       

      our standalon.xml code looks like this

       

                      <host name="default-host" alias="localhost">

                          <location name="/" handler="welcome-content"/>

                         <location name="/archive" handler="AHandler"/>

                      </host>

                      <handlers>

                      <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>

                      <file name="AHandler" path="/MainDirectory/" directory-listing="true" follow-symlink="true"/>

                      </handlers>

       

       

      Please suggest.

        • 1. Re: Wildfly Directory listing
          mayerw01

          One option ist to just remove the read permission from the ../ directory like 

          chmod o-r ../

          • 2. Re: Wildfly Directory listing
            hari2020

            If we remove read permission to main directory , how file in its inner directories are accessed?

            • 3. Re: Wildfly Directory listing
              hari2020

              can anyone please suggest the solution?

              • 4. Re: Wildfly Directory listing
                mayerw01

                I am not sure understanding your question correctly.
                But you do not need to have access to the parent directory for accessing files in the child folder.

                • 5. Re: Wildfly Directory listing
                  hari2020

                  My file structure  looks like    Main/sub1/file

                                                                Main/sub2/file

                                                                Main/sub3/file

                   

                  Mian folder is owned by that same user as application war file.  So to access the files under Main/sub folders user should have read permission to Main folder.

                  removing permissions to others do not work.  Please suggest if any other option.

                  • 6. Re: Wildfly Directory listing
                    hari2020

                    My file structure  looks like    Main/sub1/file

                                                                  Main/sub2/file

                                                                  Main/sub3/file

                     

                    Mian folder is owned by that same user as application war file.  So to access the files under Main/sub folders user should have read permission to Main folder.

                    removing permissions to others do not work.  Please suggest if any other option.