Re: [PATCH v4 15/15] daemon: opt-out on features that require posix

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

 



On Fri, Oct 22, 2010 at 12:00 AM, Erik Faye-Lund <kusmabite@xxxxxxxxx> wrote:
>        if (user_name) {
> -               pass = getpwnam(user_name);
> -               if (!pass)
> +               struct credentials c;
> +               cred = &c;
> +
> +               c->pass = getpwnam(user_name);
> +               if (!c->pass)
>                        die("user not found - %s", user_name);
>
>                if (!group_name)
> -                       gid = pass->pw_gid;
> +                       c->gid = pass->pw_gid;
>                else {
> -                       group = getgrnam(group_name);
> +                       struct group *group = getgrnam(group_name);
>                        if (!group)
>                                die("group not found - %s", group_name);
>
> -                       gid = group->gr_gid;
> +                       c->gid = group->gr_gid;
>                }
>        }

Sorry for the noise, but this is clearly incorrect and won't compile.
I guess replacing "c->" with "c." should do the trick :)

If I got this way, I'll obviously make sure it compiles! ;)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]