components/krb5/patches/037-getuid-mod.patch
author Neng Xue <neng.xue@oracle.com>
Mon, 26 Sep 2016 15:58:55 -0700
changeset 6978 14cbeb78966a
parent 6867 87f7fd05f888
permissions -rw-r--r--
24669827 Update Userland krb5 to MIT 1.14.4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5490
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     1
#
6867
87f7fd05f888 22937668 Init auth through keytab as root doesn't work after credentials have expired
Will Fiveash <will.fiveash@oracle.com>
parents: 6599
diff changeset
     2
# This patch provides support for programs like gssd to control how
87f7fd05f888 22937668 Init auth through keytab as root doesn't work after credentials have expired
Will Fiveash <will.fiveash@oracle.com>
parents: 6599
diff changeset
     3
# expand_userid() determines the UID of the running process so those apps can
87f7fd05f888 22937668 Init auth through keytab as root doesn't work after credentials have expired
Will Fiveash <will.fiveash@oracle.com>
parents: 6599
diff changeset
     4
# proxy for other users and thus influence the construction of the default
87f7fd05f888 22937668 Init auth through keytab as root doesn't work after credentials have expired
Will Fiveash <will.fiveash@oracle.com>
parents: 6599
diff changeset
     5
# ccache path so the krb code accesses that user's ccache.  This patch in
87f7fd05f888 22937668 Init auth through keytab as root doesn't work after credentials have expired
Will Fiveash <will.fiveash@oracle.com>
parents: 6599
diff changeset
     6
# conjuction with the patch that allows root to auto-acquire an init cred via
87f7fd05f888 22937668 Init auth through keytab as root doesn't work after credentials have expired
Will Fiveash <will.fiveash@oracle.com>
parents: 6599
diff changeset
     7
# the system keytab also allows a process to influence that fall-back behavior.
87f7fd05f888 22937668 Init auth through keytab as root doesn't work after credentials have expired
Will Fiveash <will.fiveash@oracle.com>
parents: 6599
diff changeset
     8
# See Solaris/getuid.c and search for instances of app_krb5_user_uid in ON12.
87f7fd05f888 22937668 Init auth through keytab as root doesn't work after credentials have expired
Will Fiveash <will.fiveash@oracle.com>
parents: 6599
diff changeset
     9
# Eventually this patch should be removed when the various ON components that
87f7fd05f888 22937668 Init auth through keytab as root doesn't work after credentials have expired
Will Fiveash <will.fiveash@oracle.com>
parents: 6599
diff changeset
    10
# rely on it are modified to remove that reliance.
5490
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    11
#
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    12
# This is Solaris specific behavior that MIT will not take upstream.
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    13
# Patch source: in-house
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    14
#
6867
87f7fd05f888 22937668 Init auth through keytab as root doesn't work after credentials have expired
Will Fiveash <will.fiveash@oracle.com>
parents: 6599
diff changeset
    15
6978
14cbeb78966a 24669827 Update Userland krb5 to MIT 1.14.4
Neng Xue <neng.xue@oracle.com>
parents: 6867
diff changeset
    16
--- a/src/include/k5-int.h
14cbeb78966a 24669827 Update Userland krb5 to MIT 1.14.4
Neng Xue <neng.xue@oracle.com>
parents: 6867
diff changeset
    17
+++ b/src/include/k5-int.h
14cbeb78966a 24669827 Update Userland krb5 to MIT 1.14.4
Neng Xue <neng.xue@oracle.com>
parents: 6867
diff changeset
    18
@@ -2353,4 +2353,6 @@ void k5_change_error_message_code(krb5_context ctx, krb5_error_code oldcode,
6599
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    19
 #define k5_prependmsg krb5_prepend_error_message
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    20
 #define k5_wrapmsg krb5_wrap_error_message
5490
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    21
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    22
+uid_t krb5_getuid();
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    23
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    24
 #endif /* _KRB5_INT_H */
6978
14cbeb78966a 24669827 Update Userland krb5 to MIT 1.14.4
Neng Xue <neng.xue@oracle.com>
parents: 6867
diff changeset
    25
--- a/src/lib/krb5/os/Makefile.in
14cbeb78966a 24669827 Update Userland krb5 to MIT 1.14.4
Neng Xue <neng.xue@oracle.com>
parents: 6867
diff changeset
    26
+++ b/src/lib/krb5/os/Makefile.in
14cbeb78966a 24669827 Update Userland krb5 to MIT 1.14.4
Neng Xue <neng.xue@oracle.com>
parents: 6867
diff changeset
    27
@@ -24,6 +24,7 @@ STLIBOBJS= \
6599
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    28
 	gen_port.o	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    29
 	genaddrs.o	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    30
 	gen_rname.o	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    31
+	getuid.o	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    32
 	hostaddr.o	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    33
 	hostrealm.o	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    34
 	hostrealm_dns.o \
6978
14cbeb78966a 24669827 Update Userland krb5 to MIT 1.14.4
Neng Xue <neng.xue@oracle.com>
parents: 6867
diff changeset
    35
@@ -71,6 +72,7 @@ OBJS= \
6599
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    36
 	$(OUTPRE)gen_port.$(OBJEXT)	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    37
 	$(OUTPRE)genaddrs.$(OBJEXT)	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    38
 	$(OUTPRE)gen_rname.$(OBJEXT)	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    39
+	$(OUTPRE)getuid.$(OBJEXT)	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    40
 	$(OUTPRE)hostaddr.$(OBJEXT)	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    41
 	$(OUTPRE)hostrealm.$(OBJEXT)	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    42
 	$(OUTPRE)hostrealm_dns.$(OBJEXT) \
6978
14cbeb78966a 24669827 Update Userland krb5 to MIT 1.14.4
Neng Xue <neng.xue@oracle.com>
parents: 6867
diff changeset
    43
@@ -118,6 +120,7 @@ SRCS= \
6599
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    44
 	$(srcdir)/gen_port.c	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    45
 	$(srcdir)/genaddrs.c	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    46
 	$(srcdir)/gen_rname.c	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    47
+	$(srcdir)/getuid.c	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    48
 	$(srcdir)/hostaddr.c	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    49
 	$(srcdir)/hostrealm.c	\
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 5490
diff changeset
    50
 	$(srcdir)/hostrealm_dns.c \
6978
14cbeb78966a 24669827 Update Userland krb5 to MIT 1.14.4
Neng Xue <neng.xue@oracle.com>
parents: 6867
diff changeset
    51
--- a/src/lib/krb5/os/expand_path.c
14cbeb78966a 24669827 Update Userland krb5 to MIT 1.14.4
Neng Xue <neng.xue@oracle.com>
parents: 6867
diff changeset
    52
+++ b/src/lib/krb5/os/expand_path.c
14cbeb78966a 24669827 Update Userland krb5 to MIT 1.14.4
Neng Xue <neng.xue@oracle.com>
parents: 6867
diff changeset
    53
@@ -291,7 +291,7 @@ static krb5_error_code
5490
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    54
 expand_userid(krb5_context context, PTYPE param, const char *postfix,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    55
               char **str)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    56
 {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    57
-    if (asprintf(str, "%lu", (unsigned long)getuid()) < 0)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    58
+    if (asprintf(str, "%lu", (unsigned long)krb5_getuid()) < 0)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    59
         return ENOMEM;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    60
     return 0;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    61
 }