Skip to content

Commit 250c00a

Browse files
committed
remove dependency of chown
1 parent 88c9e33 commit 250c00a

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
@@ -414,12 +414,6 @@ namespace TeeJee.FileSystem{
414414
return list;
415415
}
416416

417-
public bool chown(string dir_path, string user, string group = user){
418-
string cmd = "chown %s:%s -R '%s'".printf(user, group, escape_single_quote(dir_path));
419-
int status = exec_sync(cmd, null, null);
420-
return (status == 0);
421-
}
422-
423417
// misc --------------------
424418

425419
public string format_file_size (

0 commit comments

Comments
 (0)