]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
newgrp: set function arguments read-only when possible
authorSami Kerola <kerolasa@iki.fi>
Sat, 20 Dec 2014 12:37:58 +0000 (12:37 +0000)
committerSami Kerola <kerolasa@iki.fi>
Mon, 5 Jan 2015 22:53:01 +0000 (22:53 +0000)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
login-utils/newgrp.c

index 0fae08766e2f25e32ac454e32a6749d1dc93d5b1..b1134e941c922dd5a0b5ae48e98a6d6f6b4b613c 100644 (file)
@@ -74,7 +74,7 @@ static int memset_s(void *v, size_t sz, const int c)
 }
 
 /* try to read password from gshadow */
-static char *get_gshadow_pwd(char *groupname)
+static char *get_gshadow_pwd(const char *groupname)
 {
 #ifdef HAVE_GETSGNAM
        struct sgrp *sgrp;
@@ -117,7 +117,7 @@ static char *get_gshadow_pwd(char *groupname)
 #endif /* HAVE_GETSGNAM */
 }
 
-static int allow_setgid(struct passwd *pe, struct group *ge)
+static int allow_setgid(const struct passwd *pe, const struct group *ge)
 {
        char **look;
        int notfound = 1;
@@ -160,7 +160,7 @@ static int allow_setgid(struct passwd *pe, struct group *ge)
        return FALSE;
 }
 
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(FILE *out)
 {
        fprintf(out, USAGE_HEADER);
        fprintf(out, _(" %s <group>\n"), program_invocation_short_name);