Ticket #47 (closed defect: fixed)

Opened 8 months ago

Last modified 4 months ago

Upgrading sudo removes sudoers file

Reported by: tsukasa Owned by: saurik
Priority: major Component: General
Keywords: sudo Cc: greg+telesphoreo@…

Description

When I upgraded a lot of my sudo package to 1.6.9p12-3, it removed my sudoers file.

This files should be marked as a configuration file in the deb to stop it from being changed.

Change History

Changed 8 months ago by saurik

  • status changed from new to accepted

I've now done this like two or three more times to you since you filed this bug. I'm really sorry about this. I didn't realize that conffiles are going to need special support from Cydia, so while I marked it as a conffile I just reverted that change as upgrading sudo then left unfixable error messages in the configuration of sudo on every install.

I'll look into how to handle that from a frontend.

Changed 8 months ago by tsukasa

Debian uses a postinst script that creates a default sudoers file if it doesn't exist.

The relevant part of the script is here:

#!/usr/bin/perl

# make sure we have a sudoers file
if ( ! -f "/etc/sudoers") {

    print "No /etc/sudoers found... creating one for you.\n";

    open (SUDOERS, "> /etc/sudoers");
    print SUDOERS "# /etc/sudoers\n",
      "#\n",
      "# This file MUST be edited with the 'visudo' command as root.\n",
      "#\n",
      "# See the man page for details on how to write a sudoers file.\n",
      "#\n\nDefaults\tenv_reset\n\n",
      "# Uncomment to allow members of group sudo to not need a password\n",
      "# %sudo ALL=NOPASSWD: ALL\n\n",
      "# Host alias specification\n\n",
      "# User alias specification\n\n",
      "# Cmnd alias specification\n\n",
      "# User privilege specification\nroot\tALL=(ALL) ALL\n";
    close SUDOERS;

}

# make sure sudoers has the correct permissions and owner/group
system ('chown root:root /etc/sudoers');
system ('chmod 440 /etc/sudoers');

Changed 7 months ago by saurik

  • status changed from accepted to closed
  • resolution set to fixed

Cydia now supports pmconffiles, which means that I can now start marking configuration files and have smooth upgrade paths (so you get little dialog boxes asking if you want to save the old one or take the new one).

Changed 7 months ago by saurik

  • status changed from closed to reopened
  • resolution deleted

I accidentally marked this closed.

Changed 4 months ago by saurik

  • status changed from reopened to closed
  • resolution set to fixed

Someone poked me about this, so this package is up for 2.0 (which I consider the stable build now).

Note: See TracTickets for help on using tickets.