only root can chown. However, when running as root privileges are dropped. As such, it doesn't make sense to have a function like change_owner()

This commit is contained in:
Björn Ketelaars
2015-09-04 16:24:02 +02:00
parent 053bd8d5d6
commit c42b8526f0
2 changed files with 0 additions and 10 deletions

View File

@@ -327,8 +327,6 @@ int create_directory(char *slug)
mkdir(BASEDIR, S_IRWXU | S_IRGRP | S_IROTH | S_IXOTH | S_IXGRP);
int result = mkdir(directory, S_IRWXU | S_IRGRP | S_IROTH | S_IXOTH | S_IXGRP);
change_owner(directory);
free(directory);
return result;
@@ -345,18 +343,11 @@ void save_to_file(char *slug, char *buffer, struct client_data data)
fprintf(fp, "%s", buffer);
fclose(fp);
change_owner(directory);
display_info(data, directory, "");
free(directory);
}
void change_owner(char *directory)
{
if (UID != -1 && GID != -1)
chown(directory, UID, GID);
}
void set_uid_gid(char *username)
{
struct passwd *userdata = getpwnam(username);