Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
46b0dd7c
Kaydet (Commit)
46b0dd7c
authored
Mar 21, 2012
tarafından
Herbert Dürr
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
drop support for getspnam_r's ancient API
üst
6c8c5e06
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
122 deletions
+3
-122
acinclude.m4
acinclude.m4
+1
-120
security.c
sal/osl/unx/security.c
+2
-2
No files found.
acinclude.m4
Dosyayı görüntüle @
46b0dd7c
dnl @synopsis AX_FUNC_WHICH_GETSPNAM_R
dnl @synopsis PKG_CHECK_MODULES_MACHACK
dnl
dnl Determines which historical variant of the getspnam_r() call
dnl (taking four or five arguments) is available on the system
dnl and sets NEW_SHADOW_API=YES if there are five arguments.
dnl
dnl Originally named "AX_FUNC_WHICH_GETHOSTBYNAME_R". Rewritten
dnl for AX_FUNC_WHICH_GETSPNAM_R
dnl
dnl @author Caolan McNamara <caolan@skynet.ie>
dnl @author Daniel Richard G. <skunk@iskunk.org>
dnl @version 2006-05-01
dnl @license LGPL
AC_DEFUN([AX_FUNC_WHICH_GETSPNAM_R], [
AC_LANG_PUSH(C)
AC_MSG_CHECKING([how many arguments getspnam_r() takes])
AC_CACHE_VAL(ac_cv_func_which_getspnam_r, [
################################################################
ac_cv_func_which_getspnam_r=unknown
#
# ONE ARGUMENT (sanity check)
#
# This should fail, as there is no variant of getspnam_r() that takes
# a single argument. If it actually compiles, then we can assume that
# netdb.h is not declaring the function, and the compiler is thereby
# assuming an implicit prototype. In which case, we're out of luck.
#
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <sys/types.h>
#include <shadow.h>
]],
[[
const char *name = "myname";
getspnam_r(name) /* ; */
]])],
ac_cv_func_which_getspnam_r=no)
#
# FIVE ARGUMENTS
#
if test "$ac_cv_func_which_getspnam_r" = "unknown"; then
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <sys/types.h>
#include <shadow.h>
]],
[[
char buffer[[]] = { '\0' };
struct spwd spwdStruct;
const char *name = "myname";
getspnam_r(name, &spwdStruct, buffer, sizeof buffer, 0) /* ; */
]])],
ac_cv_func_which_getspnam_r=five)
fi
#
# FOUR ARGUMENTS
#
if test "$ac_cv_func_which_getspnam_r" = "unknown"; then
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <sys/types.h>
#include <shadow.h>
]],
[[
char buffer[[]] = { '\0' };
struct spwd spwdStruct;
const char *name = "myname";
getspnam_r(name, &spwdStruct, buffer, sizeof buffer) /* ; */
]])],
ac_cv_func_which_getspnam_r=four)
fi
################################################################
]) dnl end AC_CACHE_VAL
case "$ac_cv_func_which_getspnam_r" in
five)
AC_MSG_RESULT([five])
NEW_SHADOW_API=YES
;;
four)
AC_MSG_RESULT([four])
;;
no)
AC_MSG_RESULT([cannot find function declaration in shadow.h])
;;
unknown)
AC_MSG_RESULT([can't tell])
;;
*)
AC_MSG_ERROR([internal error])
;;
esac
AC_LANG_POP(C)
]) dnl end AC_DEFUN
dnl PKG_CHECK_MODULES_MACHACK is like PKG_CHECK_MODULES but sneaks in an extra
dnl PKG_CHECK_MODULES_MACHACK is like PKG_CHECK_MODULES but sneaks in an extra
dnl argument between the first and second, denoting a program to call instead of
dnl argument between the first and second, denoting a program to call instead of
...
...
sal/osl/unx/security.c
Dosyayı görüntüle @
46b0dd7c
...
@@ -583,7 +583,7 @@ osl_psz_loginUser(const sal_Char* pszUserName, const sal_Char* pszPasswd,
...
@@ -583,7 +583,7 @@ osl_psz_loginUser(const sal_Char* pszUserName, const sal_Char* pszPasswd,
char
buffer
[
1024
];
char
buffer
[
1024
];
struct
spwd
spwdStruct
;
struct
spwd
spwdStruct
;
buffer
[
0
]
=
'\0'
;
buffer
[
0
]
=
'\0'
;
#if
ndef NEW
_SHADOW_API
#if
def OLD
_SHADOW_API
if
(
getspnam_r
(
pszUserName
,
&
spwdStruct
,
buffer
,
sizeof
buffer
)
!=
NULL
)
if
(
getspnam_r
(
pszUserName
,
&
spwdStruct
,
buffer
,
sizeof
buffer
)
!=
NULL
)
#else
#else
if
(
getspnam_r
(
pszUserName
,
&
spwdStruct
,
buffer
,
sizeof
buffer
,
NULL
)
==
0
)
if
(
getspnam_r
(
pszUserName
,
&
spwdStruct
,
buffer
,
sizeof
buffer
,
NULL
)
==
0
)
...
@@ -597,7 +597,7 @@ osl_psz_loginUser(const sal_Char* pszUserName, const sal_Char* pszPasswd,
...
@@ -597,7 +597,7 @@ osl_psz_loginUser(const sal_Char* pszUserName, const sal_Char* pszPasswd,
if
(
strcmp
(
spwdStruct
.
sp_pwdp
,
cryptPasswd
)
==
0
)
{
if
(
strcmp
(
spwdStruct
.
sp_pwdp
,
cryptPasswd
)
==
0
)
{
nError
=
osl_Security_E_None
;
nError
=
osl_Security_E_None
;
}
else
if
(
getuid
()
==
0
&&
}
else
if
(
getuid
()
==
0
&&
#if
ndef NEW
_SHADOW_API
#if
def OLD
_SHADOW_API
(
getspnam_r
(
"root"
,
&
spwdStruct
,
buffer
,
sizeof
buffer
)
!=
NULL
))
(
getspnam_r
(
"root"
,
&
spwdStruct
,
buffer
,
sizeof
buffer
)
!=
NULL
))
#else
#else
(
getspnam_r
(
"root"
,
&
spwdStruct
,
buffer
,
sizeof
buffer
,
NULL
)
==
0
))
(
getspnam_r
(
"root"
,
&
spwdStruct
,
buffer
,
sizeof
buffer
,
NULL
)
==
0
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment