]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
su: cosmetic changes after indent
authorKarel Zak <kzak@redhat.com>
Thu, 13 Oct 2016 11:14:58 +0000 (13:14 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 18 Sep 2017 09:48:56 +0000 (11:48 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/su-common.c

index bfcd4940593fa01cca351a1d8a3f5a712a8674d9..98774051cafcbd3edb4d4df9ba646e7f8053ff1e 100644 (file)
@@ -1,48 +1,26 @@
-/* su for Linux.  Run a shell with substitute user and group IDs.
-   Copyright (C) 1992-2006 Free Software Foundation, Inc.
-   Copyright (C) 2012 SUSE Linux Products GmbH, Nuernberg
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
-
-/* Run a shell with the real and effective UID and GID and groups
-   of USER, default `root'.
-
-   The shell run is taken from USER's password entry, /bin/sh if
-   none is specified there.  If the account has a password, su
-   prompts for a password unless run by a user with real UID 0.
-
-   Does not change the current directory.
-   Sets `HOME' and `SHELL' from the password entry for USER, and if
-   USER is not root, sets `USER' and `LOGNAME' to USER.
-   The subshell is not a login shell.
-
-   If one or more ARGs are given, they are passed as additional
-   arguments to the subshell.
-
-   Does not handle /bin/sh or other shells specially
-   (setting argv[0] to "-su", passing -c only to certain shells, etc.).
-   I don't see the point in doing that, and it's ugly.
-
-   Based on an implementation by David MacKenzie <djm@gnu.ai.mit.edu>.  */
-
-enum {
-       EXIT_CANNOT_INVOKE = 126,
-       EXIT_ENOENT = 127
-};
-
-#include <config.h>
+/*
+ * su(1) for Linux.  Run a shell with substitute user and group IDs.
+ *
+ * Copyright (C) 1992-2006 Free Software Foundation, Inc.
+ * Copyright (C) 2012 SUSE Linux Products GmbH, Nuernberg
+ * Copyright (C) 2016 Karel Zak <kzak@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.  You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ *
+ * Based on an implementation by David MacKenzie <djm@gnu.ai.mit.edu>.
+ */
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -50,9 +28,9 @@ enum {
 #include <grp.h>
 #include <security/pam_appl.h>
 #ifdef HAVE_SECURITY_PAM_MISC_H
-#include <security/pam_misc.h>
+# include <security/pam_misc.h>
 #elif defined(HAVE_SECURITY_OPENPAM_H)
-#include <security/openpam.h>
+# include <security/openpam.h>
 #endif
 #include <signal.h>
 #include <sys/wait.h>
@@ -62,6 +40,7 @@ enum {
 #include "err.h"
 
 #include <stdbool.h>
+
 #include "c.h"
 #include "xalloc.h"
 #include "nls.h"
@@ -71,6 +50,9 @@ enum {
 #include "strutils.h"
 #include "ttyutils.h"
 
+#include "logindefs.h"
+#include "su-common.h"
+
 /* name of the pam configuration files. separate configs for su and su -  */
 #define PAM_SRVNAME_SU "su"
 #define PAM_SRVNAME_SU_L "su-l"
@@ -83,9 +65,6 @@ enum {
 
 #define is_pam_failure(_rc)    ((_rc) != PAM_SUCCESS)
 
-#include "logindefs.h"
-#include "su-common.h"
-
 /* The shell to run if none is given in the user's passwd entry.  */
 #define DEFAULT_SHELL "/bin/sh"
 
@@ -96,6 +75,11 @@ enum {
 extern char **environ;
 #endif
 
+enum {
+       EXIT_CANNOT_INVOKE = 126,
+       EXIT_ENOENT = 127
+};
+
 static void run_shell(char const *, char const *, char **, size_t)
     __attribute__ ((__noreturn__));