{"id":165597,"date":"2020-10-10T03:09:06","date_gmt":"2020-10-09T19:09:06","guid":{"rendered":"http:\/\/4563.org\/?p=165597"},"modified":"2020-10-10T03:09:06","modified_gmt":"2020-10-09T19:09:06","slug":"linux-c-%e8%af%ad%e8%a8%80-setgid-%e5%92%8c-setgroups-%e7%9a%84%e5%8c%ba%e5%88%ab","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=165597","title":{"rendered":"Linux c \u8bed\u8a00 setgid \u548c setgroups \u7684\u533a\u522b"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Linux c \u8bed\u8a00 setgid \u548c setgroups \u7684\u533a\u522b               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zxCoder <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>setgid \u7684\u8bf4\u660e\u662f This function sets both the real and effective group ID of the process to newgid<\/p>\n<p>setgroups \u7684\u8bf4\u660e\u662f This function sets the process\u2019s supplementary group IDs.<\/p>\n<p>\u8bf7\u95ee\u533a\u522b\u662f\u4ec0\u4e48<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>3<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3658440\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : boboliu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/linux.die.net\/man\/2\/setgroups<\/p>\n<p>https:\/\/linux.die.net\/man\/3\/setgid<\/p>\n<p>https:\/\/en.wikipedia.org\/wiki\/Group_identifier#Supplementary_groups<\/p>\n<p>Gooooooooooogle it!                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3658441\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : julyclyde <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5173\u952e\u5728\u4e8e supplementary \u8fd9\u4e2a\u8bcd\u554a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3658442\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : zxCoder <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @julyclyde \u5e94\u8be5\u600e\u4e48\u7406\u89e3\u8fd9\u4e2a supplementary group \u5462\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Linux c \u8bed\u8a00 setgid&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/165597"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=165597"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/165597\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=165597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=165597"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=165597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}