[v2] eal: enable windows apps to run on non-admin users
diff mbox series

Message ID 20201026184458.8492-1-pallavi.kadam@intel.com
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series
  • [v2] eal: enable windows apps to run on non-admin users
Related show

Checks

Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/checkpatch success coding style OK

Commit Message

Kadam, Pallavi Oct. 26, 2020, 6:44 p.m. UTC
Currently, since there is no runtime directory set, the code tries to
create a file in C:\ which is only writable with administrator
privileges. As a result, if the user is not admin, the application will
fail.
So, forcing no_shconf to 1 to prevent the code having to create files in
the runtime directory.

Suggested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
---
 lib/librte_eal/windows/eal.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Dmitry Kozlyuk Oct. 27, 2020, 11:10 p.m. UTC | #1
On Mon, 26 Oct 2020 11:44:58 -0700, Pallavi Kadam wrote:
> Currently, since there is no runtime directory set, the code tries to
> create a file in C:\ which is only writable with administrator
> privileges. As a result, if the user is not admin, the application will
> fail.
> So, forcing no_shconf to 1 to prevent the code having to create files in
> the runtime directory.
> 
> Suggested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
> ---
>  lib/librte_eal/windows/eal.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c
> index 6334aca03..105549de1 100644
> --- a/lib/librte_eal/windows/eal.c
> +++ b/lib/librte_eal/windows/eal.c
> @@ -295,6 +295,7 @@ rte_eal_init(int argc, char **argv)
>  		RTE_LOG(WARNING, EAL, "Multi-process support is requested, "
>  			"but not available.\n");
>  		internal_conf->in_memory = 1;
> +		internal_conf->no_shconf = 1;
>  	}
>  
>  	if (!internal_conf->no_hugetlbfs && (eal_hugepage_info_init() < 0)) {

Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Burakov, Anatoly Oct. 28, 2020, 12:41 p.m. UTC | #2
On 26-Oct-20 6:44 PM, Pallavi Kadam wrote:
> Currently, since there is no runtime directory set, the code tries to
> create a file in C:\ which is only writable with administrator
> privileges. As a result, if the user is not admin, the application will
> fail.
> So, forcing no_shconf to 1 to prevent the code having to create files in
> the runtime directory.
> 
> Suggested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
> ---
>   lib/librte_eal/windows/eal.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c
> index 6334aca03..105549de1 100644
> --- a/lib/librte_eal/windows/eal.c
> +++ b/lib/librte_eal/windows/eal.c
> @@ -295,6 +295,7 @@ rte_eal_init(int argc, char **argv)
>   		RTE_LOG(WARNING, EAL, "Multi-process support is requested, "
>   			"but not available.\n");
>   		internal_conf->in_memory = 1;
> +		internal_conf->no_shconf = 1;
>   	}
>   
>   	if (!internal_conf->no_hugetlbfs && (eal_hugepage_info_init() < 0)) {
> 

This is the correct way, as in-memory implies no_shconf. I would like to 
deprecate noshconf option as it's a subset of what in-memory does.

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Narcisa Ana Maria Vasile Oct. 29, 2020, 6:37 p.m. UTC | #3
On Mon, Oct 26, 2020 at 11:44:58AM -0700, Pallavi Kadam wrote:
> Currently, since there is no runtime directory set, the code tries to
> create a file in C:\ which is only writable with administrator
> privileges. As a result, if the user is not admin, the application will
> fail.
> So, forcing no_shconf to 1 to prevent the code having to create files in
> the runtime directory.
> 
> Suggested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
> ---
>  lib/librte_eal/windows/eal.c | 1 +
>  1 file changed, 1 insertion(+)
> 
Acked-by: Narcisa Vasile <navasile@linux.microsoft.com>
Thomas Monjalon Nov. 3, 2020, 8:28 p.m. UTC | #4
28/10/2020 13:41, Burakov, Anatoly:
> On 26-Oct-20 6:44 PM, Pallavi Kadam wrote:
> > Currently, since there is no runtime directory set, the code tries to
> > create a file in C:\ which is only writable with administrator
> > privileges. As a result, if the user is not admin, the application will
> > fail.
> > So, forcing no_shconf to 1 to prevent the code having to create files in
> > the runtime directory.
> > 
> > Suggested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> > Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> > Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
> > ---
> >   		internal_conf->in_memory = 1;
> > +		internal_conf->no_shconf = 1;
> 
> This is the correct way, as in-memory implies no_shconf. I would like to 
> deprecate noshconf option as it's a subset of what in-memory does.
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks

Patch
diff mbox series

diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c
index 6334aca03..105549de1 100644
--- a/lib/librte_eal/windows/eal.c
+++ b/lib/librte_eal/windows/eal.c
@@ -295,6 +295,7 @@  rte_eal_init(int argc, char **argv)
 		RTE_LOG(WARNING, EAL, "Multi-process support is requested, "
 			"but not available.\n");
 		internal_conf->in_memory = 1;
+		internal_conf->no_shconf = 1;
 	}
 
 	if (!internal_conf->no_hugetlbfs && (eal_hugepage_info_init() < 0)) {