Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sddm-helper creates random name dirs in $HOME #1145

Closed
vladsol opened this issue Mar 9, 2019 · 7 comments
Closed

sddm-helper creates random name dirs in $HOME #1145

vladsol opened this issue Mar 9, 2019 · 7 comments
Assignees

Comments

@vladsol
Copy link

vladsol commented Mar 9, 2019

Issue with sddm-helper
Fedora 29, x86_64
sddm 0.18.0

.arg(QString::fromLocal8Bit(pw.pw_dir))

At this point, pw.pw_dir becomes garbage.
The reason is:

free(buffer);

@vladsol
Copy link
Author

vladsol commented Mar 9, 2019

Code to test this behavior:

#include <stdio.h>
#include <pwd.h>
 
int main()
{
    struct passwd pw;
    struct passwd *rpw;
    long bufsize = 16384;
    char *buffer = (char *)malloc(bufsize);
    getpwnam_r("user_name", &pw, buffer, bufsize, &rpw);
    printf("before: %s\r\n", pw.pw_dir);
    free(buffer);
    printf("after: %s\r\n", pw.pw_dir);
    return 0;
}

error checkings is omitted for simplicity.

@davidedmundson
Copy link
Member

Please check dev branch works for you.

Pier, if you're free could you cherry pick my commit and make a release?

@vladsol
Copy link
Author

vladsol commented Mar 9, 2019

Please check dev branch works for you.

Looks like it should work :)

@plfiorini plfiorini self-assigned this Mar 9, 2019
@plfiorini
Copy link
Member

@davidedmundson Ok but I think your commit is already in develop, so I will just merge develop into master and make a release

@davidedmundson
Copy link
Member

davidedmundson commented Mar 9, 2019 via email

@plfiorini
Copy link
Member

OK I will make a 0.18.1 hotfix release this week.

@Vogtinator
Copy link
Contributor

Resolved a while ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants