[patch xdm 2/4] Remove SCO, Unixware, OS/2 support

walter harms wharms at bfs.de
Wed Dec 2 04:47:29 PST 2015


Looks good to me.
while you are fixing the ifdef forrest

the is a line with:
# ifndef QNX4

IMHO that should read HAVE_INITGROUPS

re,
 wh


Am 02.12.2015 12:22, schrieb Matthieu Herrb:
> Signed-off-by: Matthieu Herrb <matthieu at herrb.eu>
> ---
>  config/Xsession.cpp | 18 ----------
>  greeter/verify.c    | 97 +----------------------------------------------------
>  include/dm.h        |  8 ++---
>  xdm/dm.c            |  7 ----
>  xdm/resource.c      |  8 ++---
>  xdm/session.c       | 78 +++++++-----------------------------------
>  6 files changed, 17 insertions(+), 199 deletions(-)
> 
> diff --git config/Xsession.cpp config/Xsession.cpp
> index 36ccbd0..aed2ab7 100644
> --- config/Xsession.cpp
> +++ config/Xsession.cpp
> @@ -62,23 +62,5 @@ else
>  	if [ -r "$resources" ]; then
>  		BINDIR/xrdb -load "$resources"
>  	fi
> -#if defined(__SCO__) || defined(__UNIXWARE__)
> -        [ -r /etc/default/xdesktops ] && {
> -                . /etc/default/xdesktops
> -        }
> -
> -        [ -r /etc/default/xdm ] && {
> -                . /etc/default/xdm
> -        }
> -
> -        XCOMM Allow the user to over-ride the system default desktop
> -        [ -r $HOME/.xdmdesktop ] && {
> -                . $HOME/.xdmdesktop
> -        }
> -
> -        [ -n "$XDESKTOP" ] && {
> -                exec `eval $XDESKTOP`
> -        }
> -#endif
>  	exec BINDIR/xsm
>  fi
> diff --git greeter/verify.c greeter/verify.c
> index b009e2b..cf1f47b 100644
> --- greeter/verify.c
> +++ greeter/verify.c
> @@ -49,9 +49,6 @@ from The Open Group.
>  # include	<login_cap.h>
>  # include	<stdarg.h>
>  # include	<bsd_auth.h>
> -#elif defined(USESECUREWARE)
> -# include       <sys/types.h>
> -# include       <prot.h>
>  #endif
>  
>  #include	"greet.h"
> @@ -226,99 +223,7 @@ Verify (struct display *d, struct greet_info *greet, struct verify_info *verify)
>  			break;
>  		}
>  	}
> -#elif defined(USESECUREWARE) /* !USE_BSDAUTH */
> -/*
> - * This is a global variable and will be referenced in at least session.c
> - */
> -struct smp_user_info *userp = 0;
> -
> -_X_INTERNAL
> -int
> -Verify (struct display *d, struct greet_info *greet, struct verify_info *verify)
> -{
> -  int ret, pwtries = 0, nis, delay;
> -  char *reason = 0;
> -  struct passwd	*p;
> -  char *shell, *home, **argv;
> -
> -  Debug ("Verify %s ...\n", greet->name);
> -
> -  p = getpwnam (greet->name);
> -  endpwent();
> -
> -  if (!p || strlen (greet->name) == 0) {
> -    LogError ("getpwnam() failed.\n");
> -    bzero(greet->password, strlen(greet->password));
> -    return 0;
> -  }
> -
> -  ret = smp_check_user (SMP_LOGIN, greet->name, 0, 0, &userp, &pwtries,
> -    &reason, &nis, &delay);
> -  if (ret != SMP_RETIRED && userp->retired)
> -    ret = userp->result = SMP_RETIRED;
> -  Debug ("smp_check_user returns %d\n", ret);
> -
> -  switch (ret) {
> -    case SMP_FAIL:
> -      Debug ("Out of memory in smp_check_user\n");
> -      goto smp_fail;
> -    case SMP_EXTFAIL:
> -      Debug ("SMP_EXTFAIL: %s", reason);
> -      goto smp_fail;
> -    case SMP_NOTAUTH:
> -      Debug ("Not authorized\n");
> -      goto smp_fail;
> -    case SMP_TERMLOCK:
> -      Debug ("Terminal is locked!\n");
> -      goto smp_fail;
> -    case SMP_ACCTLOCK:
> -      Debug ("Account is locked\n");
> -      goto smp_fail;
> -    case SMP_RETIRED:
> -      Debug ("Account is retired\n");
> -      goto smp_fail;
> -    case SMP_OVERRIDE:
> -      Debug ("On override device ... proceeding\n");
> -      break;
> -    case SMP_NULLPW:
> -      Debug ("NULL password entry\n");
> -      if (!greet->allow_null_passwd) {
> -        goto smp_fail;
> -      }
> -      break;
> -    case SMP_BADUSER:
> -      Debug ("User not found in protected password database\n");
> -      goto smp_fail;
> -    case SMP_PWREQ:
> -      Debug ("Password change required\n");
> -      goto smp_fail;
> -    case SMP_HASPW:
> -      break;
> -    default:
> -      Debug ("Unhandled smp_check_user return %d\n", ret);
> -smp_fail:
> -      sleep(delay);
> -      smp_audit_fail (userp, 0);
> -      bzero(greet->password, strlen(greet->password));
> -      return 0;
> -      break;
> -  }
> -
> -  if (ret != SMP_NULLPW) {
> -    /*
> -     * If we require a password, check it.
> -     */
> -    ret = smp_check_pw (greet->password, userp, &reason);
> -    switch (ret) {
> -      case SMP_CANCHANGE:
> -      case SMP_CANTCHANGE:
> -      case SMP_OVERRIDE:
> -        break;
> -      default:
> -        goto smp_fail;
> -    }
> -  }
> -#else /* !USE_BSDAUTH && !USESECUREWARE */
> +#else /* !USE_BSDAUTH */
>  _X_INTERNAL
>  int
>  Verify (struct display *d, struct greet_info *greet, struct verify_info *verify)
> diff --git include/dm.h include/dm.h
> index 13e7839..9116d6f 100644
> --- include/dm.h
> +++ include/dm.h
> @@ -78,10 +78,6 @@ from The Open Group.
>  #   include <sys/wait.h>
>  #  else
>  #   define _POSIX_SOURCE
> -#   ifdef __SCO__
> -#    include <sys/procset.h>
> -#    include <sys/siginfo.h>
> -#   endif
>  #   include <sys/wait.h>
>  #   undef _POSIX_SOURCE
>  #  endif
> @@ -498,8 +494,8 @@ extern void ProcessRequestSocket(int fd);
>  
>  # include <stdlib.h>
>  
> -# if defined(X_NOT_POSIX) || defined(__UNIXOS2__) || defined(__NetBSD__) && defined(__sparc__)
> -#  if defined(SYSV) || defined(__UNIXOS2__)
> +# if defined(X_NOT_POSIX) || defined(__NetBSD__) && defined(__sparc__)
> +#  if defined(SYSV)
>  #   define SIGNALS_RESET_WHEN_CAUGHT
>  #   define UNRELIABLE_SIGNALS
>  #  endif
> diff --git xdm/dm.c xdm/dm.c
> index 8a7aebc..6260324 100644
> --- xdm/dm.c
> +++ xdm/dm.c
> @@ -54,9 +54,6 @@ from The Open Group.
>  #ifdef __NetBSD__
>  # include <sys/param.h>
>  #endif
> -#ifdef USESECUREWARE
> -# include <prot.h>
> -#endif
>  
>  #ifndef sigmask
>  # define sigmask(m)  (1 << ((m - 1)))
> @@ -138,10 +135,6 @@ main (int argc, char **argv)
>      }
>  #endif
>  
> -#ifdef USESECUREWARE
> -    set_auth_parameters (argc, argv);
> -#endif
> -
>      /*
>       * Step 1 - load configuration parameters
>       */
> diff --git xdm/resource.c xdm/resource.c
> index 83901a2..316ace4 100644
> --- xdm/resource.c
> +++ xdm/resource.c
> @@ -128,12 +128,8 @@ int	choiceTimeout;	/* chooser choice timeout */
>  #ifndef DEF_RANDOM_FILE
>  # define DEF_RANDOM_FILE "/dev/mem"
>  #endif
> -#ifdef __SCO__
> -# define DEF_PRNGD_SOCKET "/etc/egd-pool"
> -#else
> -# ifndef DEF_PRNGD_SOCKET
> -#  define DEF_PRNGD_SOCKET "/tmp/entropy"
> -# endif
> +#ifndef DEF_PRNGD_SOCKET
> +# define DEF_PRNGD_SOCKET "/tmp/entropy"
>  #endif
>  #ifndef DEF_PRNGD_PORT
>  # define DEF_PRNGD_PORT "0"
> diff --git xdm/session.c xdm/session.c
> index 9382414..4f71d71 100644
> --- xdm/session.c
> +++ xdm/session.c
> @@ -50,9 +50,6 @@ from The Open Group.
>  #include <stdio.h>
>  #include <ctype.h>
>  #include <grp.h>	/* for initgroups */
> -#ifdef AIXV3
> -# include <usersec.h>
> -#endif
>  
>  #ifndef USE_PAM        /* PAM modules should handle these */
>  # ifdef SECURE_RPC
> @@ -67,10 +64,6 @@ extern int key_setnet(struct key_netstarg *arg);
>  # endif
>  #endif /* USE_PAM */
>  
> -#ifdef __SCO__
> -# include <prot.h>
> -#endif
> -
>  #ifdef USE_SELINUX
>  #include <selinux/selinux.h>
>  #include <selinux/get_context_list.h>
> @@ -141,7 +134,7 @@ extern	struct spwd	*getspnam(GETSPNAM_ARGS);
>  extern	void	endspent(void);
>  # endif
>  #endif
> -#if defined(CSRG_BASED) || defined(__GLIBC__) || defined(__UNIXWARE__) || defined(__SCO__)
> +#if defined(CSRG_BASED) || defined(__GLIBC__)
>  # include <pwd.h>
>  # include <unistd.h>
>  #else
> @@ -594,11 +587,6 @@ StartClient (
>      pam_handle_t *pamh = thepamh ();
>      int	pam_error;
>  #endif
> -#ifdef USESECUREWARE
> -    char *reason, **smpenv, *smpshell;
> -    int ret;
> -    extern struct smp_user_info *userp;
> -#endif
>  
>      if (verify->argv) {
>  	Debug ("StartSession %s: ", verify->argv[0]);
> @@ -624,60 +612,29 @@ StartClient (
>  
>  	/* Do system-dependent login setup here */
>  
> -#ifdef USESECUREWARE
> -        Debug ("set_identity: uid=%d\n", userp->pw.pw_uid);
> -        ret = smp_set_identity (userp, &reason, &smpenv, &smpshell);
> -        Debug ("smp_set_identity returns %d luid=%d\n", ret, getluid());
> -        switch (ret) {
> -          case SMP_FAIL:
> -            LogError ("Unable to set identity\n");
> -            smp_audit_fail (userp, 0);
> -            return 0;
> -          case SMP_EXTFAIL:
> -            LogError ("Unable to set identity: %s\n", reason);
> -            smp_audit_fail (userp, 0);
> -            return 0;
> -          case SMP_NOTAUTH:
> -            LogError ("Authorization failed\n");
> -            smp_audit_fail (userp, 0);
> -            return 0;
> -          case SMP_ACCTLOCK:
> -            LogError ("Account is locked\n");
> -            smp_audit_fail (userp, 0);
> -            return 0;
> -          case SMP_COMPLETE:
> -            break;
> -          default:
> -            LogError ("Unhandled identity error %d\n", ret);
> -            smp_audit_fail (userp, 0);
> -            return 0;
> -        }
> -#endif
> -
> -#ifndef AIXV3
> -# ifndef HAVE_SETUSERCONTEXT
> +#ifndef HAVE_SETUSERCONTEXT
>  	if (setgid (verify->gid) < 0) {
>  	    LogError ("setgid %d (user \"%s\") failed: %s\n",
>  		      verify->gid, name, _SysErrorMsg (errno));
>  	    return (0);
>  	}
> -#  if defined(BSD) && (BSD >= 199103)
> +# if defined(BSD) && (BSD >= 199103)
>  	if (setlogin (name) < 0) {
>  	    LogError ("setlogin for \"%s\" failed: %s\n",
>  		      name, _SysErrorMsg (errno));
>  	    return (0);
>  	}
> -#  endif
> -#  ifndef QNX4
> +# endif
> +# ifndef QNX4
>  	if (initgroups (name, verify->gid) < 0) {
>  	    LogError ("initgroups for \"%s\" failed: %s\n",
>  		      name, _SysErrorMsg (errno));
>  	    return (0);
>  	}
> -#  endif   /* QNX4 doesn't support multi-groups, no initgroups() */
> -# endif /* !HAVE_SETUSERCONTEXT */
> +# endif   /* QNX4 doesn't support multi-groups, no initgroups() */
> +#endif /* !HAVE_SETUSERCONTEXT */
>  
> -# ifdef USE_PAM
> +#ifdef USE_PAM
>  	if (pamh) {
>  	    long i;
>  	    char **pam_env;
> @@ -696,15 +653,15 @@ StartClient (
>  	    }
>  
>  	}
> -# endif
> +#endif
>  
> -# ifndef HAVE_SETUSERCONTEXT
> +#ifndef HAVE_SETUSERCONTEXT
>  	if (setuid(verify->uid) < 0) {
>  	    LogError ("setuid %d (user \"%s\") failed: %s\n",
>  		      verify->uid, name, _SysErrorMsg (errno));
>  	    return (0);
>  	}
> -# else /* HAVE_SETUSERCONTEXT */
> +#else /* HAVE_SETUSERCONTEXT */
>  	/*
>  	 * Set the user's credentials: uid, gid, groups,
>  	 * environment variables, resource limits, and umask.
> @@ -722,18 +679,7 @@ StartClient (
>  		      name, _SysErrorMsg (errno));
>  	    return (0);
>  	}
> -# endif /* HAVE_SETUSERCONTEXT */
> -#else /* AIXV3 */
> -	/*
> -	 * Set the user's credentials: uid, gid, groups,
> -	 * audit classes, user limits, and umask.
> -	 */
> -	if (setpcred(name, NULL) == -1) {
> -	    LogError ("setpcred for \"%s\" failed: %s\n",
> -		      name, _SysErrorMsg (errno));
> -	    return (0);
> -	}
> -#endif /* AIXV3 */
> +#endif /* HAVE_SETUSERCONTEXT */
>  
>  #ifndef USE_PAM		/* PAM modules should handle these */
>  	/*


More information about the xorg-devel mailing list