(make_fileinfo): cast uid's and gid's to unsigned in printf, we don't

know what types they might be.
(lstat_file): conditionalize the kafs part on KRB4


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7284 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-10-29 21:20:20 +00:00
parent 5fb424fe88
commit cb5017700f

View File

@@ -129,7 +129,7 @@ make_fileinfo(const char *filename, struct fileinfo *file, int flags)
struct passwd *pwd; struct passwd *pwd;
pwd = getpwuid(st->st_uid); pwd = getpwuid(st->st_uid);
if(pwd == NULL) if(pwd == NULL)
asprintf(&file->user, "%d", st->st_uid); asprintf(&file->user, "%u", (unsigned)st->st_uid);
else else
file->user = strdup(pwd->pw_name); file->user = strdup(pwd->pw_name);
} }
@@ -137,7 +137,7 @@ make_fileinfo(const char *filename, struct fileinfo *file, int flags)
struct group *grp; struct group *grp;
grp = getgrgid(st->st_gid); grp = getgrgid(st->st_gid);
if(grp == NULL) if(grp == NULL)
asprintf(&file->group, "%d", st->st_gid); asprintf(&file->group, "%u", (unsigned)st->st_gid);
else else
file->group = strdup(grp->gr_name); file->group = strdup(grp->gr_name);
} }
@@ -281,9 +281,7 @@ log10(int num)
static int static int
lstat_file (const char *file, struct stat *sb) lstat_file (const char *file, struct stat *sb)
{ {
int ret; #ifdef KRB4
const int maxsize = 2048;
if (k_hasafs() if (k_hasafs()
&& strcmp(file, ".") && strcmp(file, ".")
&& strcmp(file, "..")) && strcmp(file, ".."))
@@ -292,6 +290,8 @@ lstat_file (const char *file, struct stat *sb)
char *last; char *last;
char *path_bkp; char *path_bkp;
static ino_t ino_counter = 0, ino_last = 0; static ino_t ino_counter = 0, ino_last = 0;
int ret;
const int maxsize = 2048;
path_bkp = strdup (file); path_bkp = strdup (file);
if (path_bkp == NULL) if (path_bkp == NULL)
@@ -348,9 +348,9 @@ lstat_file (const char *file, struct stat *sb)
sb->st_nlink = 3; sb->st_nlink = 3;
return 0; return 0;
} else {
return lstat (file, sb);
} }
#endif /* KRB4 */
return lstat (file, sb);
} }
static void static void