qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 7/8] os-posix: Provide new -runasid option


From: Ian Jackson
Subject: Re: [Qemu-devel] [PATCH 7/8] os-posix: Provide new -runasid option
Date: Fri, 6 Oct 2017 15:24:09 +0100

Peter Maydell writes ("Re: [Qemu-devel] [PATCH 7/8] os-posix: Provide new 
-runasid option"):
> On 4 October 2017 at 17:18, Ian Jackson <address@hidden> wrote:
> >  static void change_process_uid(void)
> >  {
> > -    if (user_pwd) {
> > -        if (setgid(user_pwd->pw_gid) < 0) {
> > +    if (user_pwd || user_uid != (uid_t)-1) {
> > +        if (setgid(user_pwd ? user_pwd->pw_gid : user_gid) < 0) {
> >              fprintf(stderr, "Failed to setgid(%d)\n", user_pwd->pw_gid);
> 
> If you're changing the gid we pass to setgid() I think you should
> also change the value we tell the user we tried to use in the
> error message, or it could be rather confusing.

Thanks for the review.  Sorry about the mess here.  I have fixed all
these problems.

Ian.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]