X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fpermissions.c;h=140c79ef27fe10a8f722624efb0573ef211b5f0a;hb=64f58bbdab17e4a09b725e713f4f82f567f44076;hp=8737e631e5fa093eb6cfbb0c121abb9c0919898e;hpb=b016884ff112ca57e89f9d0298eb70079fece20d;p=pspp-builds.git diff --git a/src/permissions.c b/src/permissions.c index 8737e631..140c79ef 100644 --- a/src/permissions.c +++ b/src/permissions.c @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #include #include "error.h" @@ -24,14 +24,16 @@ #include #include #include - +#include "settings.h" #include "command.h" #include "error.h" #include "lexer.h" #include "misc.h" +#include "stat-macros.h" #include "str.h" - +#include "gettext.h" +#define _(msgid) gettext (msgid) enum PER {PER_RO, PER_RW}; @@ -95,6 +97,13 @@ change_permissions(const char *filename, enum PER per) struct stat buf; mode_t mode; + if ( safer_mode() ) + { + msg (SE, _("This command not allowed when the SAFER option is set.")); + return CMD_FAILURE; + } + + if ( -1 == stat(filename, &buf) ) { const int errnum = errno;