Re: editing removes suid
- From: Pavel Roskin <proski gnu org>
- To: Nerijus Baliunas <nerijus users sourceforge net>
- Cc: mc-devel gnome org
- Subject: Re: editing removes suid
- Date: Wed, 6 Nov 2002 13:07:26 -0500 (EST)
Hello, Nerijus!
> When I edit suid perl script, after saving suid bit disappears:
> mc 4.5.55, didn't check with latest cvs, sorry.
Yes, I confirm the bug with the current version.
When restoring file permissions, chown should always be called before
chmod. I almost knew that mcedit does it wrong as soon as I read your
message, before even checking the sources.
Thank you! I'm applying this patch.
==========================
--- editcmd.c
+++ editcmd.c
@@ -229,8 +229,8 @@ int edit_save_file (WEdit * edit, const
} else
savename = g_strdup (filename);
- mc_chmod (savename, edit->stat1.st_mode);
mc_chown (savename, edit->stat1.st_uid, edit->stat1.st_gid);
+ mc_chmod (savename, edit->stat1.st_mode);
if ((fd = mc_open (savename, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY ,
edit->stat1.st_mode)) == -1)
==========================
--
Regards,
Pavel Roskin
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]