From a4b34c37331a8b13066d684d259d7cb1aa5d7d1c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 17 Jun 2016 20:12:50 -0400 Subject: whoops, add newlines in setuid --- bin/setuid.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/setuid.c b/bin/setuid.c index 7ae1105..aa8847b 100644 --- a/bin/setuid.c +++ b/bin/setuid.c @@ -44,7 +44,7 @@ static void disable_nss_module(void) { void *handle = dlopen(nss_module_soname, RTLD_LAZY | RTLD_NODELETE); err = dlerror(); if (handle == NULL) { - fprintf(stderr, SD_WARNING "NSS module %s not loaded: %s", nss_module_soname, err); + fprintf(stderr, SD_WARNING "NSS module %s not loaded: %s\n", nss_module_soname, err); return; } @@ -52,18 +52,18 @@ static void disable_nss_module(void) { char **version_info = dlsym(handle, nss_module_sym_version); err = dlerror(); if ((version_info != NULL) && (err == NULL)) { - fprintf(stderr, SD_DEBUG "NSS module %s version %s %s", nss_module_soname, + fprintf(stderr, SD_DEBUG "NSS module %s version %s %s\n", nss_module_soname, version_info[0], version_info[1]); } else { - fprintf(stderr, SD_WARNING "NSS module %s version missing: %s", nss_module_soname, err); + fprintf(stderr, SD_WARNING "NSS module %s version missing: %s\n", nss_module_soname, err); } dlerror(); int *enable_flag = dlsym(handle, nss_module_sym_enablelookups); err = dlerror(); if ((enable_flag == NULL) || (err != NULL)) { - fprintf(stderr, SD_WARNING "Unable to disable NSS ldap module for nslcd process: %s", err); + fprintf(stderr, SD_WARNING "Unable to disable NSS ldap module for nslcd process: %s\n", err); dlclose(handle); return; } @@ -87,22 +87,22 @@ int main(int argc, char *argv[]) { struct passwd *passwd = getpwnam(argv[1]); if (passwd == NULL) { - fprintf(stderr, SD_ERR "Could not look up user: %s", argv[1]); + fprintf(stderr, SD_ERR "Could not look up user: %s\n", argv[1]); return EXIT_FAILURE; } if (setgid(passwd->pw_gid) != 0) { - fprintf(stderr, SD_ERR "Could not setgid(%lu): %s", + fprintf(stderr, SD_ERR "Could not setgid(%lu): %s\n", (unsigned long int)passwd->pw_gid, strerror(errno)); return EXIT_NOPERMISSION; } if (setuid(passwd->pw_uid) != 0) { - fprintf(stderr, SD_ERR "Could not setuid(%lu): %s", + fprintf(stderr, SD_ERR "Could not setuid(%lu): %s\n", (unsigned long int)passwd->pw_gid, strerror(errno)); return EXIT_NOPERMISSION; } execvp(argv[2], &argv[2]); - fprintf(stderr, SD_ERR "Could not exec: %s", strerror(errno)); + fprintf(stderr, SD_ERR "Could not exec: %s\n", strerror(errno)); return EXIT_FAILURE; } -- cgit v1.2.2