shadow fails to compile with gcc-2
Mike Frysinger <[email protected]> Sat, 3 Sep 2005 17:46:00 -0400
| Newsgroups | gmane.linux.pld.shadow.general |
|---|---|
| Organization | wh0rd.org |
| Message-ID | <[email protected]> |
src/newgrp.c declares some variables in the middle of scope and gcc-2 rejects this ... the child/pid variables could either be moved up to the top of the if scope, or the USE_PAM code could be given a local scope ... ive attached a patch by Martin Schlemmer for the former behavior -mike
shadow-dont-declare-vars-mid-scope.patch
(text/x-diff, 806 B)
Index: src/newgrp.c
===================================================================
RCS file: /cvsroot/shadow/src/newgrp.c,v
retrieving revision 1.40
diff -u -p -r1.40 newgrp.c
--- src/newgrp.c 31 Aug 2005 17:25:00 -0000 1.40
+++ src/newgrp.c 3 Sep 2005 21:43:52 -0000
@@ -427,6 +427,9 @@ int main (int argc, char **argv)
if (getdef_bool ("SYSLOG_SG_ENAB")) {
char *loginname = getlogin ();
char *tty = ttyname (0);
+#ifdef USE_PAM
+ pid_t child, pid;
+#endif
if (loginname != NULL)
loginname = xstrdup (loginname);
@@ -459,7 +462,6 @@ int main (int argc, char **argv)
* avoid any possibility of the parent being stopped when it
* receives SIGCHLD from the terminating subshell. -- JWP
*/
- pid_t child, pid;
signal (SIGINT, SIG_IGN);
signal (SIGQUIT, SIG_IGN);