[Pdbg] [PATCH] main: Run as root

Amitay Isaacs amitay at ozlabs.org
Wed Mar 28 16:00:33 AEDT 2018


On Wed, 2018-03-28 at 15:19 +1100, Michael Neuling wrote:
> Thanks Amitay,
> 
> There are some parts of pgdb that won't need root. Seems like we
> should add
> something like this when we actually try to open a device and get an
> EPERM.  

What parts are those?  From my (non-existent) understanding of pdbg,
all of it requires root privileges.

> 
> Also a commit message as to why we need this would be nice here.
> 
> Mikey
> 
> 
> > Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
> > ---
> >  src/main.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/src/main.c b/src/main.c
> > index 121e4ad..878761c 100644
> > --- a/src/main.c
> > +++ b/src/main.c
> > @@ -493,6 +493,11 @@ int main(int argc, char *argv[])
> >  	if (target_select())
> >  		return 1;
> >  
> > +	if (geteuid() != 0) {
> > +		fprintf(stderr, "Run as root\n");
> > +		return 1;
> > +	}

Amitay.
-- 

We do not see things as they are. We see things as we are.


More information about the Pdbg mailing list