View | Details | Raw Unified | Return to bug 249017
Collapse All | Expand All

(-)xtset.c (-4 / +5 lines)
Lines 49-54 Link Here
49
#include <pwd.h>
49
#include <pwd.h>
50
#include <grp.h>
50
#include <grp.h>
51
#include <sys/param.h>
51
#include <sys/param.h>
52
#include <sys/stat.h>
52
53
53
/* SVR3 header files frequently don't define MAXPATHLEN. They probably can't
54
/* SVR3 header files frequently don't define MAXPATHLEN. They probably can't
54
 * stomach a 1K path name, either, but this constant can err on the generous
55
 * stomach a 1K path name, either, but this constant can err on the generous
Lines 135-155 Link Here
135
136
136
  /* then the effective username */
137
  /* then the effective username */
137
138
138
  if (pwent = getpwuid (geteuid ()))
139
  if ((pwent = getpwuid (geteuid ())) != 0)
139
    eff_userid = strdup (pwent->pw_name);
140
    eff_userid = strdup (pwent->pw_name);
140
  else
141
  else
141
    eff_userid = "*no euid*";
142
    eff_userid = "*no euid*";
142
143
143
  /* then the real groupname */
144
  /* then the real groupname */
144
145
145
  if (grent = getgrgid (getgid ()))
146
  if ((grent = getgrgid (getgid ())) != 0)
146
    real_groupid = strdup (grent->gr_name);
147
    real_groupid = strdup (grent->gr_name);
147
  else
148
  else
148
    real_groupid = "*no gid*";			    /* yes, this can be valid */
149
    real_groupid = "*no gid*";			    /* yes, this can be valid */
149
  
150
  
150
  /* then the effective groupname */
151
  /* then the effective groupname */
151
  
152
  
152
  if (grent = getgrgid (getegid ()))
153
  if ((grent = getgrgid (getegid ())) != 0)
153
    eff_groupid = strdup (grent->gr_name);
154
    eff_groupid = strdup (grent->gr_name);
154
  else
155
  else
155
    eff_groupid = "*no egid*";			    /* yes, this can be valid */
156
    eff_groupid = "*no egid*";			    /* yes, this can be valid */
Lines 163-169 Link Here
163
    {
164
    {
164
    char *point;
165
    char *point;
165
    strcpy (short_host, our_host);
166
    strcpy (short_host, our_host);
166
    if (point = strchr (short_host, '.'))		    /* got a point, */
167
    if ((point = strchr (short_host, '.')) != 0)	    /* got a point, */
167
      *point = '\0';					    /* chop it off there */
168
      *point = '\0';					    /* chop it off there */
168
    }
169
    }
169
  if ( !getcwd (our_dir, MAXPATHLEN))			    /* or can't get wd */
170
  if ( !getcwd (our_dir, MAXPATHLEN))			    /* or can't get wd */

Return to bug 249017