Changeset 745 for trunk/server/source3/smbd/sec_ctx.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source3/smbd/sec_ctx.c
r414 r745 3 3 uid/user handling 4 4 Copyright (C) Tim Potter 2000 5 5 6 6 This program is free software; you can redistribute it and/or modify 7 7 it under the terms of the GNU General Public License as published by 8 8 the Free Software Foundation; either version 3 of the License, or 9 9 (at your option) any later version. 10 10 11 11 This program is distributed in the hope that it will be useful, 12 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 GNU General Public License for more details. 15 15 16 16 You should have received a copy of the GNU General Public License 17 17 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 19 19 20 20 #include "includes.h" 21 #include "smbd/smbd.h" 21 22 #include "smbd/globals.h" 23 #include "libcli/security/security_token.h" 24 #include "auth.h" 25 #include "smbprofile.h" 22 26 23 27 extern struct current_user current_user; … … 27 31 ****************************************************************************/ 28 32 29 bool unix_token_equal(const UNIX_USER_TOKEN *t1, const UNIX_USER_TOKEN*t2)33 bool unix_token_equal(const struct security_unix_token *t1, const struct security_unix_token *t2) 30 34 { 31 35 if (t1->uid != t2->uid || t1->gid != t2->gid || … … 81 85 } 82 86 } 83 87 84 88 /* Set effective group id */ 85 89 … … 132 136 ****************************************************************************/ 133 137 134 static int get_current_groups(gid_t gid, size_t *p_ngroups, gid_t **p_groups)138 static int get_current_groups(gid_t gid, uint32_t *p_ngroups, gid_t **p_groups) 135 139 { 136 140 int i; … … 168 172 (*p_groups) = groups; 169 173 170 DEBUG( 3, ( "get_current_groups: user is in %u groups: ", ngroups));174 DEBUG( 4, ( "get_current_groups: user is in %u groups: ", ngroups)); 171 175 for (i = 0; i < ngroups; i++ ) { 172 DEBUG( 3, ( "%s%d", (i ? ", " : ""), (int)groups[i] ) );173 } 174 DEBUG( 3, ( "\n" ) );176 DEBUG( 4, ( "%s%d", (i ? ", " : ""), (int)groups[i] ) ); 177 } 178 DEBUG( 4, ( "\n" ) ); 175 179 176 180 return ngroups; … … 207 211 ctx_p->ut.gid = getegid(); 208 212 209 DEBUG( 3, ("push_sec_ctx(%u, %u) : sec_ctx_stack_ndx = %d\n",213 DEBUG(4, ("push_sec_ctx(%u, %u) : sec_ctx_stack_ndx = %d\n", 210 214 (unsigned int)ctx_p->ut.uid, (unsigned int)ctx_p->ut.gid, sec_ctx_stack_ndx )); 211 215 … … 301 305 ****************************************************************************/ 302 306 303 void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, NT_USER_TOKEN*token)307 void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, struct security_token *token) 304 308 { 305 309 struct sec_ctx *ctx_p = &sec_ctx_stack[sec_ctx_stack_ndx]; 306 310 307 311 /* Set the security context */ 308 312 309 DEBUG( 3, ("setting sec ctx (%u, %u) - sec_ctx_stack_ndx = %d\n",313 DEBUG(4, ("setting sec ctx (%u, %u) - sec_ctx_stack_ndx = %d\n", 310 314 (unsigned int)uid, (unsigned int)gid, sec_ctx_stack_ndx)); 311 315 312 debug_nt_user_token(DBGC_CLASS, 5, token);316 security_token_debug(DBGC_CLASS, 5, token); 313 317 debug_unix_user_token(DBGC_CLASS, 5, uid, gid, ngroups, groups); 314 318 … … 324 328 325 329 TALLOC_FREE(ctx_p->token); 326 330 327 331 if (ngroups) { 328 332 ctx_p->ut.groups = (gid_t *)memdup(groups, … … 415 419 current_user.nt_user_token = prev_ctx_p->token; 416 420 417 DEBUG( 3, ("pop_sec_ctx (%u, %u) - sec_ctx_stack_ndx = %d\n",421 DEBUG(4, ("pop_sec_ctx (%u, %u) - sec_ctx_stack_ndx = %d\n", 418 422 (unsigned int)geteuid(), (unsigned int)getegid(), sec_ctx_stack_ndx)); 419 423
Note:
See TracChangeset
for help on using the changeset viewer.