]> granicus.if.org Git - sudo/commitdiff
Make alias_remove_recursive() return TRUE/FALSE as its callers
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 26 Oct 2011 15:07:11 +0000 (11:07 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 26 Oct 2011 15:07:11 +0000 (11:07 -0400)
expect and remove two unused arguments.  Fixes bug 519.

--HG--
branch : 1.7

visudo.c

index 7cf894f9a9e6af8d1819055e06001fdfaf282239..dd32387db0306aa21ade7ba0064594296e66b59a 100644 (file)
--- a/visudo.c
+++ b/visudo.c
@@ -1004,21 +1004,19 @@ get_hostname()
 }
 
 static int
-alias_remove_recursive(name, type, strict, quiet)
+alias_remove_recursive(name, type)
     char *name;
     int type;
-    int strict;
-    int quiet;
 {
     struct member *m;
     struct alias *a;
-    int error = 0;
+    int rval = TRUE;
 
     if ((a = alias_find(name, type)) != NULL) {
        tq_foreach_fwd(&a->members, m) {
            if (m->type == ALIAS) {
-               if (!alias_remove_recursive(m->name, type, strict, quiet))
-                   error = 1;
+               if (!alias_remove_recursive(m->name, type))
+                   rval = FALSE;
            }
        }
     }
@@ -1026,7 +1024,7 @@ alias_remove_recursive(name, type, strict, quiet)
     a = alias_remove(name, type);
     if (a)
        rbinsert(alias_freelist, a);
-    return error;
+    return rval;
 }
 
 static int
@@ -1122,7 +1120,7 @@ check_aliases(strict, quiet)
        tq_foreach_fwd(&us->users, m) {
            if (m->type == ALIAS) {
                alias_seqno++;
-               if (!alias_remove_recursive(m->name, USERALIAS, strict, quiet))
+               if (!alias_remove_recursive(m->name, USERALIAS))
                    error++;
            }
        }
@@ -1130,8 +1128,7 @@ check_aliases(strict, quiet)
            tq_foreach_fwd(&priv->hostlist, m) {
                if (m->type == ALIAS) {
                    alias_seqno++;
-                   if (!alias_remove_recursive(m->name, HOSTALIAS, strict,
-                       quiet))
+                   if (!alias_remove_recursive(m->name, HOSTALIAS))
                        error++;
                }
            }
@@ -1139,15 +1136,13 @@ check_aliases(strict, quiet)
                tq_foreach_fwd(&cs->runasuserlist, m) {
                    if (m->type == ALIAS) {
                        alias_seqno++;
-                       if (!alias_remove_recursive(m->name, RUNASALIAS,
-                           strict, quiet))
+                       if (!alias_remove_recursive(m->name, RUNASALIAS))
                            error++;
                    }
                }
                if ((m = cs->cmnd)->type == ALIAS) {
                    alias_seqno++;
-                   if (!alias_remove_recursive(m->name, CMNDALIAS, strict,
-                       quiet))
+                   if (!alias_remove_recursive(m->name, CMNDALIAS))
                        error++;
                }
            }
@@ -1174,7 +1169,7 @@ check_aliases(strict, quiet)
            for (m = binding; m != NULL; m = m->next) {
                if (m->type == ALIAS) {
                    alias_seqno++;
-                   if (!alias_remove_recursive(m->name, atype, strict, quiet))
+                   if (!alias_remove_recursive(m->name, atype))
                        error++;
                }
            }