Changeset 4481:0a8cc5415d9b in roaraudio


Ignore:
Timestamp:
10/11/10 16:15:20 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

prepair stuff so we can set up auth stuff in main()

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/auth.c

    r4478 r4481  
    3636  g_auth_keyring[i].type = _NONE; 
    3737 } 
    38  
    39  // enable guest access. 
    40  if ( auth_addkey_anonymous(ACCLEV_ALL) == -1 ) 
    41   return -1; 
    4238 
    4339#if 0 
  • roard/roard.c

    r4469 r4481  
    13951395} 
    13961396 
     1397static int auth_setup (enum roard_client_acclev none_acclev, 
     1398                       enum roard_client_acclev trust_acclev, int trust_root, uid_t trust_uid, gid_t trust_gid) { 
     1399 union auth_typeunion * key; 
     1400 size_t i; 
     1401 
     1402 if ( auth_addkey_anonymous(none_acclev) == -1 ) 
     1403  return -1; 
     1404 
     1405 if ( (key = auth_regkey_simple(ROAR_AUTH_T_TRUST, trust_acclev)) == NULL ) 
     1406  return -1; 
     1407 
     1408 // zerosize all counters. 
     1409 memset(key, 0, sizeof(union auth_typeunion)); 
     1410 
     1411 i = 0; 
     1412 
     1413 if ( trust_uid != -1 ) 
     1414  key->trust.uids[i++] = trust_uid; 
     1415 
     1416#ifdef ROAR_ROOT_UID 
     1417 if ( trust_root ) 
     1418  key->trust.uids[i++] = ROAR_ROOT_UID; 
     1419#endif 
     1420 
     1421 key->trust.uids_len = i; 
     1422 
     1423 i = 0; 
     1424 
     1425 if ( trust_gid != -1 ) 
     1426  key->trust.gids[i++] = trust_gid; 
     1427 
     1428 key->trust.gids_len = i; 
     1429 
     1430 return 0; 
     1431} 
     1432 
    13971433 
    13981434// MAIN: 
     
    14551491 int    m_count   = 0; 
    14561492#endif 
     1493 enum roard_client_acclev none_acclev  = ACCLEV_ALL; 
     1494 enum roard_client_acclev trust_acclev = ACCLEV_ALL; 
     1495 int                      trust_root   = 1; 
    14571496#ifndef ROAR_WITHOUT_DCOMP_LIGHT 
    14581497 int    light_channels = LIGHT_CHANNELS_DEFAULT; 
     
    25032542#endif 
    25042543 
     2544 // setup auth: 
     2545 if ( auth_setup(none_acclev, trust_acclev, trust_root, getuid(), getgid()) == -1 ) { 
     2546  ROAR_ERR("Can not set up auth. Bad."); 
     2547  alive = 0; 
     2548 } 
     2549 
    25052550 // Register with OpenSLP: 
    25062551#ifdef ROAR_HAVE_LIBSLP 
Note: See TracChangeset for help on using the changeset viewer.