1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtlogin: Resolve 27 compiler warnings

This commit is contained in:
Peter Howkins 2014-12-23 22:01:51 +00:00
parent 407aa2c4b7
commit bc842043d2
12 changed files with 90 additions and 34 deletions

View file

@ -361,10 +361,18 @@ MakeServerAuthFile (struct display *d)
sprintf (d->authFile, "%s/%s", authDir, authdir1);
r = stat(d->authFile, &statb);
if (r == 0) {
if (statb.st_uid != 0)
(void) chown(d->authFile, 0, statb.st_gid);
if ((statb.st_mode & 0077) != 0)
(void) chmod(d->authFile, statb.st_mode & 0700);
if (statb.st_uid != 0) {
if(-1 == chown(d->authFile, 0, statb.st_gid)) {
perror(strerror(errno));
return FALSE;
}
}
if ((statb.st_mode & 0077) != 0) {
if(-1 == chmod(d->authFile, statb.st_mode & 0700)) {
perror(strerror(errno));
return FALSE;
}
}
} else {
if (errno == ENOENT)
r = mkdir(d->authFile, 0700);
@ -1284,11 +1292,15 @@ SetUserAuthorization (struct display *d, struct verify_info *verify)
#ifdef NGROUPS
Debug ("SetUserAuthorization: chown(%s,%d,%d)\n",
envname, verify->uid, verify->groups[0]);
chown (envname, verify->uid, verify->groups[0]);
if(-1 == chown (envname, verify->uid, verify->groups[0])) {
perror(strerror(errno));
}
#else
Debug ("SetUserAuthorization: chown(%s,%d,%d)\n",
envname, verify->uid, verify->gid);
chown (envname, verify->uid, verify->gid);
if(-1 == chown (envname, verify->uid, verify->gid)) {
perror(strerror(errno));
}
#endif /* NGROUPS */
}
}