~ubuntu-branches/ubuntu/utopic/lightdm/utopic-proposed

« back to all changes in this revision

Viewing changes to tests/src/libsystem.c

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2014-09-30 15:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20140930151151-qnewlpmhhou8u25w
Tags: 1.12.0-0ubuntu1
* New upstream release:
  - Fix assumption that the display server is X when running scripts.
    (LP: #1305006)
  - Don't access .dmrc files until information from these files is required.
    (LP: #1370852)
* debian/patches/01_transition_ubuntu2d_ubuntu_desktop.patch:
  - Dropped, Unity 2D doesn't exist and all users will have been migrated in
    14.04 LTS

Show diffs side-by-side

added added

removed removed

Lines of Context:
346
346
    int (*_stat) (const char *path, struct stat *buf);
347
347
    gchar *new_path = NULL;
348
348
    int ret;
349
 
  
 
349
 
350
350
    _stat = (int (*)(const char *path, struct stat *buf)) dlsym (RTLD_NEXT, "stat");
351
351
 
352
352
    new_path = redirect_path (path);
378
378
    int (*___xstat) (int version, const char *path, struct stat *buf);
379
379
    gchar *new_path = NULL;
380
380
    int ret;
381
 
  
 
381
 
382
382
    ___xstat = (int (*)(int version, const char *path, struct stat *buf)) dlsym (RTLD_NEXT, "__xstat");
383
383
 
384
384
    new_path = redirect_path (path);
394
394
    int (*___xstat64) (int version, const char *path, struct stat64 *buf);
395
395
    gchar *new_path = NULL;
396
396
    int ret;
397
 
  
 
397
 
398
398
    ___xstat64 = (int (*)(int version, const char *path, struct stat64 *buf)) dlsym (RTLD_NEXT, "__xstat64");
399
399
 
400
400
    new_path = redirect_path (path);
410
410
    int (*___fxstatat) (int ver, int dirfd, const char *pathname, struct stat *buf, int flags);
411
411
    gchar *new_path = NULL;
412
412
    int ret;
413
 
  
 
413
 
414
414
    ___fxstatat = (int (*)(int ver, int dirfd, const char *pathname, struct stat *buf, int flags)) dlsym (RTLD_NEXT, "__fxstatat");
415
415
 
416
416
    new_path = redirect_path (pathname);
426
426
    int (*___fxstatat64) (int ver, int dirfd, const char *pathname, struct stat64 *buf, int flags);
427
427
    gchar *new_path = NULL;
428
428
    int ret;
429
 
  
 
429
 
430
430
    ___fxstatat64 = (int (*)(int ver, int dirfd, const char *pathname, struct stat64 *buf, int flags)) dlsym (RTLD_NEXT, "__fxstatat64");
431
431
 
432
432
    new_path = redirect_path (pathname);
449
449
    result = _opendir (new_path);
450
450
    g_free (new_path);
451
451
 
452
 
    return result; 
 
452
    return result;
453
453
}
454
454
 
455
455
int
556
556
free_user (gpointer data)
557
557
{
558
558
    struct passwd *entry = data;
559
 
  
 
559
 
560
560
    g_free (entry->pw_name);
561
561
    g_free (entry->pw_passwd);
562
562
    g_free (entry->pw_gecos);
649
649
getpwnam (const char *name)
650
650
{
651
651
    GList *link;
652
 
  
 
652
 
653
653
    if (name == NULL)
654
654
        return NULL;
655
 
  
 
655
 
656
656
    load_passwd_file ();
657
657
 
658
658
    for (link = user_entries; link; link = link->next)
690
690
free_group (gpointer data)
691
691
{
692
692
    struct group *entry = data;
693
 
  
 
693
 
694
694
    g_free (entry->gr_name);
695
695
    g_free (entry->gr_passwd);
696
696
    g_strfreev (entry->gr_mem);
847
847
        status_notify ("%s", status->str);
848
848
        g_string_free (status, TRUE);
849
849
    }
850
 
  
 
850
 
851
851
    if (strcmp (pamh->service_name, "test-remote") == 0)
852
852
    {
853
853
        int result;
856
856
 
857
857
        msg = malloc (sizeof (struct pam_message *) * 1);
858
858
        msg[0] = malloc (sizeof (struct pam_message));
859
 
        msg[0]->msg_style = PAM_PROMPT_ECHO_ON; 
 
859
        msg[0]->msg_style = PAM_PROMPT_ECHO_ON;
860
860
        msg[0]->msg = "remote-login:";
861
861
        result = pamh->conversation.conv (1, (const struct pam_message **) msg, &resp, pamh->conversation.appdata_ptr);
862
862
        free (msg[0]);
919
919
 
920
920
        msg = malloc (sizeof (struct pam_message *) * 1);
921
921
        msg[0] = malloc (sizeof (struct pam_message));
922
 
        msg[0]->msg_style = PAM_PROMPT_ECHO_ON; 
 
922
        msg[0]->msg_style = PAM_PROMPT_ECHO_ON;
923
923
        msg[0]->msg = LOGIN_PROMPT;
924
924
        result = pamh->conversation.conv (1, (const struct pam_message **) msg, &resp, pamh->conversation.appdata_ptr);
925
925
        free (msg[0]);
934
934
            free (resp);
935
935
            return PAM_CONV_ERR;
936
936
        }
937
 
      
 
937
 
938
938
        pamh->user = strdup (resp[0].resp);
939
939
        free (resp[0].resp);
940
940
        free (resp);
1072
1072
get_env_value (const char *name_value, const char *name)
1073
1073
{
1074
1074
    int j;
1075
 
  
 
1075
 
1076
1076
    for (j = 0; name[j] && name_value[j] && name[j] == name_value[j]; j++);
1077
1077
    if (name[j] == '\0' && name_value[j] == '=')
1078
1078
        return &name_value[j + 1];
1167
1167
{
1168
1168
    if (pamh == NULL || item == NULL)
1169
1169
        return PAM_SYSTEM_ERR;
1170
 
  
 
1170
 
1171
1171
    switch (item_type)
1172
1172
    {
1173
1173
    case PAM_SERVICE:
1174
1174
        *item = pamh->service_name;
1175
1175
        return PAM_SUCCESS;
1176
 
      
 
1176
 
1177
1177
    case PAM_USER:
1178
1178
        *item = pamh->user;
1179
1179
        return PAM_SUCCESS;
1185
1185
    case PAM_RUSER:
1186
1186
        *item = pamh->ruser;
1187
1187
        return PAM_SUCCESS;
1188
 
     
 
1188
 
1189
1189
    case PAM_USER_PROMPT:
1190
1190
        *item = LOGIN_PROMPT;
1191
1191
        return PAM_SUCCESS;
1192
 
      
 
1192
 
1193
1193
    case PAM_TTY:
1194
1194
        *item = pamh->tty;
1195
1195
        return PAM_SUCCESS;
1310
1310
        status_notify ("%s", status->str);
1311
1311
        g_string_free (status, TRUE);
1312
1312
    }
1313
 
  
 
1313
 
1314
1314
    if (!pamh->user)
1315
1315
        return PAM_USER_UNKNOWN;
1316
1316
 
1666
1666
    xcb_connection_t *c;
1667
1667
    gchar *socket_path;
1668
1668
    GError *error = NULL;
1669
 
  
 
1669
 
1670
1670
    c = malloc (sizeof (xcb_connection_t));
1671
1671
    c->display = g_strdup (display);
1672
1672
    c->error = 0;