Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1f32136

Browse files
committed
Fix compilation warnings with libselinux 3.1 in contrib/sepgsql/
Upstream SELinux has recently marked security_context_t as officiallydeprecated, causing warnings with -Wdeprecated-declarations. This isconsidered as legacy code for some time now by upstream assecurity_context_t got removed from most of the code tree during thedevelopment of 2.3 back in 2014.This removes all the references to security_context_t in sepgsql/ to beconsistent with SELinux, fixing the warnings. Note that this does notimpact the minimum version of libselinux supported.Reviewed-by: Tom LaneDiscussion:https://postgr.es/m/20200813012735.GC11663@paquier.xyz
1 parenta9306f1 commit1f32136

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

‎contrib/sepgsql/label.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ sepgsql_set_client_label(const char *new_label)
120120
tcontext=client_label_peer;
121121
else
122122
{
123-
if (security_check_context_raw((security_context_t)new_label)<0)
123+
if (security_check_context_raw(new_label)<0)
124124
ereport(ERROR,
125125
(errcode(ERRCODE_INVALID_NAME),
126126
errmsg("SELinux: invalid security label: \"%s\"",
@@ -453,9 +453,9 @@ sepgsql_get_label(Oid classId, Oid objectId, int32 subId)
453453
object.objectSubId=subId;
454454

455455
label=GetSecurityLabel(&object,SEPGSQL_LABEL_TAG);
456-
if (!label||security_check_context_raw((security_context_t)label))
456+
if (!label||security_check_context_raw(label))
457457
{
458-
security_context_tunlabeled;
458+
char*unlabeled;
459459

460460
if (security_get_initial_context_raw("unlabeled",&unlabeled)<0)
461461
ereport(ERROR,
@@ -487,7 +487,7 @@ sepgsql_object_relabel(const ObjectAddress *object, const char *seclabel)
487487
* context of selinux.
488488
*/
489489
if (seclabel&&
490-
security_check_context_raw((security_context_t)seclabel)<0)
490+
security_check_context_raw(seclabel)<0)
491491
ereport(ERROR,
492492
(errcode(ERRCODE_INVALID_NAME),
493493
errmsg("SELinux: invalid security label: \"%s\"",seclabel)));
@@ -725,7 +725,7 @@ exec_object_restorecon(struct selabel_handle *sehnd, Oid catalogId)
725725
char*objname;
726726
intobjtype=1234;
727727
ObjectAddressobject;
728-
security_context_tcontext;
728+
char*context;
729729

730730
/*
731731
* The way to determine object name depends on object classes. So, any

‎contrib/sepgsql/selinux.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -768,8 +768,8 @@ sepgsql_compute_avd(const char *scontext,
768768
* Ask SELinux what is allowed set of permissions on a pair of the
769769
* security contexts and the given object class.
770770
*/
771-
if (security_compute_av_flags_raw((security_context_t)scontext,
772-
(security_context_t)tcontext,
771+
if (security_compute_av_flags_raw(scontext,
772+
tcontext,
773773
tclass_ex,0,&avd_ex)<0)
774774
ereport(ERROR,
775775
(errcode(ERRCODE_INTERNAL_ERROR),
@@ -838,7 +838,7 @@ sepgsql_compute_create(const char *scontext,
838838
uint16tclass,
839839
constchar*objname)
840840
{
841-
security_context_tncontext;
841+
char*ncontext;
842842
security_class_ttclass_ex;
843843
constchar*tclass_name;
844844
char*result;
@@ -853,8 +853,8 @@ sepgsql_compute_create(const char *scontext,
853853
* Ask SELinux what is the default context for the given object class on a
854854
* pair of security contexts
855855
*/
856-
if (security_compute_create_name_raw((security_context_t)scontext,
857-
(security_context_t)tcontext,
856+
if (security_compute_create_name_raw(scontext,
857+
tcontext,
858858
tclass_ex,
859859
objname,
860860
&ncontext)<0)

‎contrib/sepgsql/uavc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ sepgsql_avc_unlabeled(void)
171171
{
172172
if (!avc_unlabeled)
173173
{
174-
security_context_tunlabeled;
174+
char*unlabeled;
175175

176176
if (security_get_initial_context_raw("unlabeled",&unlabeled)<0)
177177
ereport(ERROR,
@@ -216,7 +216,7 @@ sepgsql_avc_compute(const char *scontext, const char *tcontext, uint16 tclass)
216216
* policy is reloaded, validation status shall be kept, so we also cache
217217
* whether the supplied security context was valid, or not.
218218
*/
219-
if (security_check_context_raw((security_context_t)tcontext)!=0)
219+
if (security_check_context_raw(tcontext)!=0)
220220
ucontext=sepgsql_avc_unlabeled();
221221

222222
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp