Skip to content

Instantly share code, notes, and snippets.

View levaidaniel's full-sized avatar

Lévai Dániel levaidaniel

View GitHub Profile
@levaidaniel
levaidaniel / rcs_owner_auto.diff
Created April 30, 2020 18:58
Preserve ownership of files when RCSing!
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c
index 765b03a9388..d7212ad8365 100644
--- a/usr.bin/rcs/ci.c
+++ b/usr.bin/rcs/ci.c
@@ -565,6 +565,10 @@ checkin_update(struct checkin_params *pb)
/* Strip all the write bits */
pb->file->rf_mode = st.st_mode & ~(S_IWUSR|S_IWGRP|S_IWOTH);
+ /* Preserve the owner and group */
+ pb->file->rf_uid = st.st_uid;