Deleted Added
full compact
su.c (103423) su.c (120945)
1/*
1/*
2 * Copyright (c) 1999 - 2002 Kungliga Tekniska H�gskolan
2 * Copyright (c) 1999 - 2003 Kungliga Tekniska H�gskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
28 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
32
33#include <config.h>
34
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
28 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
32
33#include <config.h>
34
35RCSID("$Id: su.c,v 1.25 2002/09/10 20:03:47 joda Exp $");
35RCSID("$Id: su.c,v 1.26.2.1 2003/05/06 12:06:44 joda Exp $");
36
37#include <stdio.h>
38#include <stdlib.h>
39#include <string.h>
40
41#include <syslog.h>
42
43#ifdef HAVE_PATHS_H

--- 7 unchanged lines hidden (view full) ---

51#include <pwd.h>
52
53#include "crypto-headers.h"
54#ifdef KRB5
55#include <krb5.h>
56#endif
57#ifdef KRB4
58#include <krb.h>
36
37#include <stdio.h>
38#include <stdlib.h>
39#include <string.h>
40
41#include <syslog.h>
42
43#ifdef HAVE_PATHS_H

--- 7 unchanged lines hidden (view full) ---

51#include <pwd.h>
52
53#include "crypto-headers.h"
54#ifdef KRB5
55#include <krb5.h>
56#endif
57#ifdef KRB4
58#include <krb.h>
59#include <kafs.h>
60#endif
59#endif
60#include <kafs.h>
61#include <err.h>
62#include <roken.h>
63#include <getarg.h>
64
65#ifndef _PATH_DEFPATH
66#define _PATH_DEFPATH "/usr/bin:/bin"
67#endif
68

--- 179 unchanged lines hidden (view full) ---

248 asprintf(&cc_name, "%s:%s", krb5_cc_get_type(context, ccache2),
249 krb5_cc_get_name(context, ccache2));
250 esetenv("KRB5CCNAME", cc_name, 1);
251
252 /* we want to export this even if we don't directly support KRB4 */
253 set_tkfile();
254 esetenv("KRBTKFILE", tkfile, 1);
255
61#include <err.h>
62#include <roken.h>
63#include <getarg.h>
64
65#ifndef _PATH_DEFPATH
66#define _PATH_DEFPATH "/usr/bin:/bin"
67#endif
68

--- 179 unchanged lines hidden (view full) ---

248 asprintf(&cc_name, "%s:%s", krb5_cc_get_type(context, ccache2),
249 krb5_cc_get_name(context, ccache2));
250 esetenv("KRB5CCNAME", cc_name, 1);
251
252 /* we want to export this even if we don't directly support KRB4 */
253 set_tkfile();
254 esetenv("KRBTKFILE", tkfile, 1);
255
256#ifdef KRB4
257 /* convert creds? */
258 if(k_hasafs()) {
259 if (k_setpag() == 0)
260 krb5_afslog(context, ccache2, NULL, NULL);
261 }
256 /* convert creds? */
257 if(k_hasafs()) {
258 if (k_setpag() == 0)
259 krb5_afslog(context, ccache2, NULL, NULL);
260 }
262#endif
263
264 krb5_cc_close(context, ccache2);
265 krb5_cc_destroy(context, ccache);
266 return 0;
267}
268#endif
269
270#ifdef KRB4

--- 270 unchanged lines hidden (view full) ---

541#ifdef KRB5
542 if (ok == 5)
543 krb5_start_session();
544#endif
545#ifdef KRB4
546 if (ok == 4)
547 krb_start_session();
548#endif
261
262 krb5_cc_close(context, ccache2);
263 krb5_cc_destroy(context, ccache);
264 return 0;
265}
266#endif
267
268#ifdef KRB4

--- 270 unchanged lines hidden (view full) ---

539#ifdef KRB5
540 if (ok == 5)
541 krb5_start_session();
542#endif
543#ifdef KRB4
544 if (ok == 4)
545 krb_start_session();
546#endif
549 {
550 char **p;
551 for(p = args; *p; p++)
552 printf("%s ", *p);
553 printf("\n");
554 }
555 execv(shell, args);
556 }
557
558 exit(1);
559}
547 execv(shell, args);
548 }
549
550 exit(1);
551}