We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I needed the following patch to make it run:
diff --git a/src/backend/cups_backend/main.cpp b/src/backend/cups_backend/main.cpp index b0973d0..44bb236 100644 --- a/src/backend/cups_backend/main.cpp +++ b/src/backend/cups_backend/main.cpp @@ -63,6 +63,20 @@ static int getmod(const string &file) return 0; } +/************************************************ + * + ************************************************/ +static uid_t getown(const string &file) +{ + struct stat fstat; + if (stat(file.c_str(), &fstat) == 0) + { + return fstat.st_uid; + } + + return 0; +} + /************************************************ * @@ -113,13 +127,13 @@ static string mkUserDir(const string &baseDir, const string &user) return ""; } - if (chown(dir.c_str(), pwd->pw_uid, -1) != 0) + if (getown(dir) != pwd->pw_uid && chown(dir.c_str(), pwd->pw_uid, -1) != 0) { Log::error("Can't change owner on directory %s: %s", dir.c_str(), std::strerror(errno)); return ""; } - Log::debug("User directory %s saccefully created", dir.c_str()); + Log::debug("User directory %s succesfully created", dir.c_str()); return dir; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I needed the following patch to make it run:
The text was updated successfully, but these errors were encountered: