Skip to content

Commit

Permalink
meson: Check for shadow password symbols, GitHub #1777
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Nov 23, 2024
1 parent 332311e commit 23776f0
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -1734,13 +1734,28 @@ enable_shadow = get_option('with-shadow')
if not enable_shadow
have_shadow = false
else
have_shadow = (cc.has_header('shadow.h'))
if cc.has_header('shadow.h')
have_shadow = cc.compiles(
'''
#include <shadow.h>
struct spwd *sp;
getspnam("bork");
''',
)
else
have_shadow = cc.compiles(
'''
struct spwd *sp;
getspnam("bork");
''',
)
endif
if have_shadow
cdata.set('SHADOWPW', 1)
uams_options += 'shadow'
else
have_shadow = false
warning('Shadow password support requested but required header not found')
warning('Shadow password support requested but required symbols not found')
endif
endif

Expand Down Expand Up @@ -2434,6 +2449,7 @@ if have_quota
}
endif
summary_info += {
' Shadow passwords': have_shadow,
' Spotlight': have_spotlight,
' TCP wrapper': have_tcpwrap,
' Zeroconf': have_zeroconf,
Expand Down

0 comments on commit 23776f0

Please sign in to comment.