summaryrefslogtreecommitdiffstats
path: root/login-utils/newgrp.c
diff options
context:
space:
mode:
authorSami Kerola2014-12-20 13:37:58 +0100
committerSami Kerola2015-01-05 23:53:01 +0100
commit1fd15f04b3028276d77155c055e8382127a4b5b0 (patch)
treee6d8c27406f8d1eb4ca27227840a38dff6f222af /login-utils/newgrp.c
parentnewgrp: move shell determination closer where it is used (diff)
downloadkernel-qcow2-util-linux-1fd15f04b3028276d77155c055e8382127a4b5b0.tar.gz
kernel-qcow2-util-linux-1fd15f04b3028276d77155c055e8382127a4b5b0.tar.xz
kernel-qcow2-util-linux-1fd15f04b3028276d77155c055e8382127a4b5b0.zip
newgrp: set function arguments read-only when possible
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'login-utils/newgrp.c')
-rw-r--r--login-utils/newgrp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/login-utils/newgrp.c b/login-utils/newgrp.c
index 0fae08766..b1134e941 100644
--- a/login-utils/newgrp.c
+++ b/login-utils/newgrp.c
@@ -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);