]> git.pld-linux.org Git - packages/coreutils.git/blobdiff - coreutils-runuser.patch
- updated for 8.5 (from TP)
[packages/coreutils.git] / coreutils-runuser.patch
index d1f4595b0898423e90fc03542dfce7098439266f..3dcd609a006f22bbab0969bdfb787c2e5f09b6a8 100644 (file)
@@ -3,9 +3,9 @@
 @@ -12,7 +12,7 @@
    factor false fmt fold groups head hostid hostname id install join kill
    link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
-   od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir
--  runcon runuser seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf
-+  runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf
+   nproc od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir
+-  runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf
++  runcon runuser seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf
    sleep sort split stat stdbuf stty su sum sync tac tail tee test timeout
    touch tr true truncate tsort tty uname unexpand uniq unlink uptime users
    vdir wc who whoami yes
  
  #if HAVE_PATHS_H
  # include <paths.h>
-@@ -150,6 +156,10 @@
- #ifndef USE_PAM
+@@ -149,6 +149,10 @@
  char *crypt (char const *key, char const *salt);
  #endif
 +#ifndef CHECKPASSWD
 +#define CHECKPASSWD 1
 +#endif
 +
- char *getusershell (void);
- void endusershell (void);
- void setusershell (void);
-@@ -157,7 +167,11 @@
- extern char **environ;
+ static void run_shell (char const *, char const *, char **, size_t,
+               const struct passwd *)
+ #ifdef USE_PAM
+@@ -154,7 +154,11 @@
+ #endif
  
  static void run_shell (char const *, char const *, char **, size_t,
--      const struct passwd *)
-+      const struct passwd *
+-              const struct passwd *)
++              const struct passwd *
 +#ifdef RUNUSER
-+                     , gid_t *groups, int num_groups
++              , gid_t *groups, int num_groups
 +#endif
-+      )
++              )
  #ifdef USE_PAM
        ;
  #else
  
  static void
  run_shell (char const *shell, char const *command, char **additional_args,
--         size_t n_additional_args, const struct passwd *pw)
-+         size_t n_additional_args, const struct passwd *pw
+-           size_t n_additional_args, const struct passwd *pw)
++           size_t n_additional_args, const struct passwd *pw
 +#ifdef RUNUSER
-+         , gid_t *groups, int num_groups
++           , gid_t *groups, int num_groups
 +#endif
-+      )
++  )
  {
    size_t n_args = 1 + fast_startup + 2 * !!command + n_additional_args + 1;
    char const **args = xnmalloc (n_args, sizeof *args);
        switch (optc)
        {
 @@ -701,6 +756,28 @@
-         shell = optarg;
-         break;
+           shell = optarg;
+           break;
  
 +#ifdef RUNUSER
 +      case 'g':
 +        break;
 +#endif
 +
-       case_GETOPT_HELP_CHAR;
+         case_GETOPT_HELP_CHAR;
  
-       case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
+         case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
 @@ -739,7 +816,20 @@
-                         : DEFAULT_SHELL);
+                           : DEFAULT_SHELL);
    endpwent ();
  
 -  if (!correct_password (pw))
      {
  #ifdef SYSLOG_FAILURE
        log_su (pw, false);
-@@ -771,8 +861,16 @@
+@@ -814,7 +814,11 @@
    modify_environment (pw, shell);
  
  #ifndef USE_PAM
 -  change_identity (pw);
 +  change_identity (pw
 +#ifdef RUNUSER
-+                 , groups, num_supp_groups
++                , groups, num_supp_groups
 +#endif
-+                 );
++                );
  #endif
  
+   /* error() flushes stderr, but does not check for write failure.
+@@ -825,5 +829,9 @@
+   if (ferror (stderr))
+     exit (EXIT_CANCELED);
 -  run_shell (shell, command, argv + optind, MAX (0, argc - optind), pw);
 +  run_shell (shell, command, argv + optind, MAX (0, argc - optind), pw
 +#ifdef RUNUSER
-+           , groups, num_supp_groups
++                , groups, num_supp_groups
 +#endif
-+           );
++                );
  }
 --- coreutils-6.10/src/Makefile.am.orig        2008-03-02 14:22:53.223435095 +0100
 +++ coreutils-6.10/src/Makefile.am     2008-03-02 14:25:58.317983032 +0100
-@@ -24,7 +24,7 @@
-   arch hostname su
- build_if_possible__progs = \
--  chroot df hostid nice pinky stdbuf libstdbuf.so stty su uname uptime users who
-+  chroot df hostid nice pinky stdbuf libstdbuf.so stty su runuser uname uptime users who
-
- AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
-
+@@ -101,6 +101,7 @@
+   rm          \
+   rmdir               \
+   runcon      \
++  runuser     \
+   seq         \
+   sha1sum     \
+   sha224sum   \
 @@ -135,6 +135,10 @@
  
  stat_LDADD = $(LDADD) $(LIB_SELINUX)
This page took 0.59778 seconds and 4 git commands to generate.