~ubuntu-branches/ubuntu/lucid/loop-aes-utils/lucid-security

« back to all changes in this revision

Viewing changes to misc-utils/write.c

  • Committer: Bazaar Package Importer
  • Author(s): Max Vozeler
  • Date: 2009-07-06 02:08:18 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090706020818-11pxao7bhgjenfv9
Tags: 2.15.1~rc1-2
Disable ncurses (--without-ncurses), not used in
mount/. Fixes FTBFS (closes: #535676).

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
#include <stdlib.h>
57
57
#include <signal.h>
58
58
#include <sys/param.h>
59
 
#include <sys/signal.h>
60
59
#include <sys/stat.h>
61
60
#include <sys/file.h>
62
61
#include <sys/time.h>
72
71
int term_chk(char *, int *, time_t *, int);
73
72
int utmp_chk(char *, char *);
74
73
 
 
74
static gid_t myegid;
 
75
 
75
76
int
76
77
main(int argc, char **argv) {
77
78
        time_t atime;
83
84
        bindtextdomain(PACKAGE, LOCALEDIR);
84
85
        textdomain(PACKAGE);
85
86
 
 
87
        myegid = getegid();
 
88
 
86
89
        /* check that sender has write enabled */
87
90
        if (isatty(fileno(stdin)))
88
91
                myttyfd = fileno(stdin);
267
270
                            "write: %s: %s\n", path, strerror(errno));
268
271
                return(1);
269
272
        }
270
 
        *msgsokP = (s.st_mode & (S_IWRITE >> 3)) != 0;  /* group write bit */
 
273
 
 
274
        /* group write bit and group ownership */
 
275
        *msgsokP = (s.st_mode & (S_IWRITE >> 3)) && myegid == s.st_gid;
271
276
        *atimeP = s.st_atime;
272
277
        return(0);
273
278
}