Thread (7 messages) 7 messages, 3 authors, 2016-06-15

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

From: Erik Faye-Lund <hidden>
Date: 2016-06-15 22:49:50

Possibly related (same subject, not in this thread)

On Fri, Oct 22, 2010 at 12:00 AM, Erik Faye-Lund [off-list ref] 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! ;)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help