From 3752eaf521fb9fc0bad24bc3cfaa4841d9b74fa38d40275fb4f5b4c86335ee16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= Date: Thu, 19 Apr 2012 17:32:39 +0000 Subject: [PATCH] - Declare krb5_auth_con_set_req_cksumtype if the prototype does not exist. - Initialize bkupuid and bkupgid. OBS-URL: https://build.opensuse.org/package/show/network:samba:STABLE/cifs-utils?expand=0&rev=50 --- bku-uid-gid-uninitialized.diff | 19 ++++++++++ cifs-utils.changes | 6 +++ cifs-utils.spec | 4 ++ ...et_req_cksumtype-implicit-declaration.diff | 38 +++++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 bku-uid-gid-uninitialized.diff create mode 100644 krb5_auth_con_set_req_cksumtype-implicit-declaration.diff diff --git a/bku-uid-gid-uninitialized.diff b/bku-uid-gid-uninitialized.diff new file mode 100644 index 0000000..cd8072e --- /dev/null +++ b/bku-uid-gid-uninitialized.diff @@ -0,0 +1,19 @@ +Author: Lars Mueller +Subject: cifs-utils build warns bkupuid and bkupgid may be used uninitialized +Bugzilla: na + +Index: cifs-utils-5.4/mount.cifs.c +=================================================================== +--- cifs-utils-5.4.orig/mount.cifs.c ++++ cifs-utils-5.4/mount.cifs.c +@@ -863,8 +863,8 @@ parse_options(const char *data, struct p + int got_uid = 0; + int got_cruid = 0; + int got_gid = 0; +- uid_t uid, cruid = 0, bkupuid; +- gid_t gid, bkupgid; ++ uid_t uid, cruid = 0, bkupuid = 0; ++ gid_t gid, bkupgid = 0; + char *ep; + struct passwd *pw; + struct group *gr; diff --git a/cifs-utils.changes b/cifs-utils.changes index 8309814..1a00f6e 100644 --- a/cifs-utils.changes +++ b/cifs-utils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 19 17:29:11 UTC 2012 - lmuelle@suse.com + +- Declare krb5_auth_con_set_req_cksumtype if the prototype does not exist. +- Initialize bkupuid and bkupgid. + ------------------------------------------------------------------- Thu Apr 19 16:07:00 UTC 2012 - lmuelle@suse.com diff --git a/cifs-utils.spec b/cifs-utils.spec index 13a8327..4afd47b 100644 --- a/cifs-utils.spec +++ b/cifs-utils.spec @@ -28,6 +28,8 @@ Source1: cifs.init Source2: mkinitrd_scripts_boot-cifs.sh Source3: mkinitrd_scripts_setup-cifs.sh Patch: 8c6268cbbd4202631e5c4b30297adc0088a1d568.diff +Patch1: bku-uid-gid-uninitialized.diff +Patch2: krb5_auth_con_set_req_cksumtype-implicit-declaration.diff %if 0%{?suse_version} PreReq: insserv %{?fillup_prereq} mkinitrd %else @@ -77,6 +79,8 @@ the Linux CIFS filesystem. %prep %setup -q %patch -p1 +%patch1 -p1 +%patch2 -p1 %build autoreconf --force --install diff --git a/krb5_auth_con_set_req_cksumtype-implicit-declaration.diff b/krb5_auth_con_set_req_cksumtype-implicit-declaration.diff new file mode 100644 index 0000000..39544c3 --- /dev/null +++ b/krb5_auth_con_set_req_cksumtype-implicit-declaration.diff @@ -0,0 +1,38 @@ +Author: Lars Mueller +Subject: cifs-utils build breaks with krb5 < 1.7 +Bugzilla: na +Inspiration: https://bugzilla.samba.org/show_bug.cgi?id=6918 + +Index: cifs-utils-5.4/configure.ac +=================================================================== +--- cifs-utils-5.4.orig/configure.ac ++++ cifs-utils-5.4/configure.ac +@@ -178,6 +178,9 @@ if test $enable_cifsupcall != "no"; then + AC_CHECK_FUNCS([krb5_auth_con_setaddrs krb5_auth_con_set_req_cksumtype]) + fi + ++# MIT krb5 < 1.7 does not have this declaration but does have the symbol ++AC_CHECK_DECLS(krb5_auth_con_set_req_cksumtype, [], [], [#include ]) ++ + LIBS=$cu_saved_libs + + AM_CONDITIONAL(CONFIG_CIFSUPCALL, [test "$enable_cifsupcall" != "no"]) +Index: cifs-utils-5.4/cifs.upcall.c +=================================================================== +--- cifs-utils-5.4.orig/cifs.upcall.c ++++ cifs-utils-5.4/cifs.upcall.c +@@ -415,6 +415,14 @@ cifs_krb5_get_req(const char *host, cons + */ + in_data.data = discard_const_p(char, gss_cksum); + in_data.length = 24; ++ ++ /* MIT krb5 < 1.7 is missing the prototype, but still has the symbol */ ++#if !HAVE_DECL_KRB5_AUTH_CON_SET_REQ_CKSUMTYPE ++ krb5_error_code krb5_auth_con_set_req_cksumtype( ++ krb5_context context, ++ krb5_auth_context auth_context, ++ krb5_cksumtype cksumtype); ++#endif + ret = krb5_auth_con_set_req_cksumtype(context, auth_context, 0x8003); + if (ret) { + syslog(LOG_DEBUG, "%s: unable to set 0x8003 checksum",