summaryrefslogtreecommitdiffstats
path: root/mount
diff options
context:
space:
mode:
authorKarel Zak2010-06-14 18:42:58 +0200
committerKarel Zak2010-06-14 18:42:58 +0200
commitb7481d6f74eadad6c65060a4a960da4830efa0cc (patch)
treee5d4d7e342e5db719663b1c0fcac74aa6bcefb2e /mount
parenttextual: fix typos (diff)
downloadkernel-qcow2-util-linux-b7481d6f74eadad6c65060a4a960da4830efa0cc.tar.gz
kernel-qcow2-util-linux-b7481d6f74eadad6c65060a4a960da4830efa0cc.tar.xz
kernel-qcow2-util-linux-b7481d6f74eadad6c65060a4a960da4830efa0cc.zip
mount: use %u for uid_t and gid_t
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount')
-rw-r--r--mount/mount.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mount/mount.c b/mount/mount.c
index 11936a620..c31892b2d 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -314,11 +314,11 @@ append_opt(char *s, const char *opt, const char *val)
}
static char *
-append_numopt(char *s, const char *opt, long num)
+append_numopt(char *s, const char *opt, unsigned int num)
{
char buf[32];
- snprintf(buf, sizeof(buf), "%ld", num);
+ snprintf(buf, sizeof(buf), "%u", num);
return append_opt(s, opt, buf);
}
@@ -1729,12 +1729,12 @@ usersubst(const char *opts) {
s = "uid=useruid";
if (opts && (w = strstr(opts, s)) != NULL) {
- sprintf(id, "uid=%d", getuid());
+ sprintf(id, "uid=%u", getuid());
opts = subst_string(opts, w, strlen(s), id);
}
s = "gid=usergid";
if (opts && (w = strstr(opts, s)) != NULL) {
- sprintf(id, "gid=%d", getgid());
+ sprintf(id, "gid=%u", getgid());
opts = subst_string(opts, w, strlen(s), id);
}
return xstrdup(opts);
@@ -2299,8 +2299,8 @@ main(int argc, char *argv[]) {
printf("mount: mtab path: \"%s\"\n", _PATH_MOUNTED);
printf("mount: lock path: \"%s\"\n", _PATH_MOUNTED_LOCK);
printf("mount: temp path: \"%s\"\n", _PATH_MOUNTED_TMP);
- printf("mount: UID: %d\n", getuid());
- printf("mount: eUID: %d\n", geteuid());
+ printf("mount: UID: %u\n", getuid());
+ printf("mount: eUID: %u\n", geteuid());
}
argc -= optind;
@@ -2331,7 +2331,7 @@ main(int argc, char *argv[]) {
if (ruid == 0 && euid != 0)
/* user is root, but setuid to non-root */
die (EX_USAGE, _("mount: only root can do that "
- "(effective UID is %d)"), euid);
+ "(effective UID is %u)"), euid);
die (EX_USAGE, _("mount: only root can do that"));
}