Skip to content

Commit f61affa

Browse files
committed
remove dependency of chown
1 parent 6dd9930 commit f61affa

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

src/Utility/CronTab.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public class CronTab : GLib.Object {
306306
}
307307

308308
file_write(file_path, sh);
309-
chown(file_path, "root", "root");
309+
Posix.chown(file_path, 0, 0); // chown to root:root
310310
Posix.chmod(file_path, 0644);
311311

312312
log_msg(_("Added cron task") + ": %s".printf(file_path));

src/Utility/TeeJee.FileSystem.vala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -445,12 +445,6 @@ namespace TeeJee.FileSystem{
445445
return list;
446446
}
447447

448-
public bool chown(string dir_path, string user, string group = user){
449-
string cmd = "chown %s:%s -R '%s'".printf(user, group, escape_single_quote(dir_path));
450-
int status = exec_sync(cmd, null, null);
451-
return (status == 0);
452-
}
453-
454448
// misc --------------------
455449

456450
public string format_file_size (

0 commit comments

Comments
 (0)