summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2009-03-21 11:31:50 +0000
committerEli Zaretskii <eliz@gnu.org>2009-03-21 11:31:50 +0000
commit22749e9acb08d9a7ab78bdf930464b1f19012a63 (patch)
treebddda2f8f67fc48f7dd3c184f0e109fecc0139d4
parentcc15c0f2167a8fa39d80f5d29672ee9d9eebd418 (diff)
downloademacs-22749e9acb08d9a7ab78bdf930464b1f19012a63.tar.gz
inc/sys/stat.h (struct stat): Change the types of st_uid and st_gid to unsigned.
inc/pwd.h (struct passwd): Change the types of pw_uid and pw_gid to unsigned. (getpwuid): Argument is now unsigned. uid_t is now unsigned. ntlib.c (setuid): Argument is now unsigned. (getuid): Return value is now unsigned. (getpwuid): Argument is now unsigned. (fchown): UID and GID arguments are now unsigned. ntlib.h (fchown): UID and GID arguments are now unsigned. (getuid): Return value is now unsigned. (setuid): Argument is now unsigned. (getpwuid): Remove prototype (it's declared in nt/inc/pwd.h). w32.c (getpwuid): Change argument type to unsigned. (struct w32_id): Change type of `rid' member to unsigned. (w32_cached_id, w32_add_to_cache, get_name_and_id): Change type of argument ID to unsigned. All callers changed. (getuid, geteuid, getgid, getegid): Change return type to unsigned.
-rw-r--r--lib-src/ChangeLog12
-rw-r--r--lib-src/ntlib.c8
-rw-r--r--lib-src/ntlib.h7
-rw-r--r--nt/ChangeLog10
-rw-r--r--nt/inc/pwd.h20
-rw-r--r--nt/inc/sys/stat.h4
-rw-r--r--src/ChangeLog8
-rw-r--r--src/w32.c22
8 files changed, 60 insertions, 31 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 4838f807d06..b9c6f1318e6 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,15 @@
+2009-03-21 Eli Zaretskii <eliz@gnu.org>
+
+ * ntlib.c (setuid): Argument is now unsigned.
+ (getuid): Return value is now unsigned.
+ (getpwuid): Argument is now unsigned.
+ (fchown): UID and GID arguments are now unsigned.
+
+ * ntlib.h (fchown): UID and GID arguments are now unsigned.
+ (getuid): Return value is now unsigned.
+ (setuid): Argument is now unsigned.
+ (getpwuid): Remove prototype (it's declared in nt/inc/pwd.h).
+
2009-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
* emacsclient.c (main): Revert part of last change, so
diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c
index 4ca7ae40aa1..bce4ce10f31 100644
--- a/lib-src/ntlib.c
+++ b/lib-src/ntlib.c
@@ -119,20 +119,20 @@ cuserid (char * s)
return name;
}
-int
+unsigned
getuid ()
{
return 0;
}
int
-setuid (int uid)
+setuid (unsigned uid)
{
return 0;
}
struct passwd *
-getpwuid (int uid)
+getpwuid (unsigned uid)
{
return NULL;
}
@@ -185,7 +185,7 @@ getpass (const char * prompt)
}
int
-fchown (int fd, int uid, int gid)
+fchown (int fd, unsigned uid, unsigned gid)
{
return 0;
}
diff --git a/lib-src/ntlib.h b/lib-src/ntlib.h
index 4fe492241dd..7f9313c9ec4 100644
--- a/lib-src/ntlib.h
+++ b/lib-src/ntlib.h
@@ -35,11 +35,10 @@ char *getwd (char *dir);
int getppid(void);
char * getlogin ();
char * cuserid (char * s);
-int getuid ();
-int setuid (int uid);
-struct passwd * getpwuid (int uid);
+unsigned getuid ();
+int setuid (unsigned uid);
char * getpass (const char * prompt);
-int fchown (int fd, int uid, int gid);
+int fchown (int fd, unsigned uid, unsigned gid);
#ifndef BSTRING
#define bzero(b, l) memset(b, 0, l)
diff --git a/nt/ChangeLog b/nt/ChangeLog
index fcff1bca6ed..ad019fe5e7d 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,13 @@
+2009-03-21 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/sys/stat.h (struct stat): Change the types of st_uid and
+ st_gid to unsigned.
+
+ * inc/pwd.h (struct passwd): Change the types of pw_uid and pw_gid
+ to unsigned.
+ (getpwuid): Argument is now unsigned.
+ uid_t is now unsigned.
+
2009-02-24 Juanma Barranquero <lekktu@gmail.com>
* INSTALL: Add comment about TCC; fix typos.
diff --git a/nt/inc/pwd.h b/nt/inc/pwd.h
index 31c0df7ec30..d8a4ffc2e20 100644
--- a/nt/inc/pwd.h
+++ b/nt/inc/pwd.h
@@ -5,21 +5,21 @@
*/
struct passwd {
- char *pw_name;
- char *pw_passwd;
- int pw_uid;
- int pw_gid;
- int pw_quota;
- char *pw_gecos;
- char *pw_dir;
- char *pw_shell;
+ char *pw_name;
+ char *pw_passwd;
+ unsigned pw_uid; /* Vista's TrustedInstaller has a very large RID */
+ unsigned pw_gid;
+ int pw_quota;
+ char *pw_gecos;
+ char *pw_dir;
+ char *pw_shell;
};
-typedef int uid_t;
+typedef unsigned uid_t;
typedef uid_t gid_t;
struct passwd * getpwnam (char *);
-struct passwd * getpwuid (int);
+struct passwd * getpwuid (unsigned);
#endif /* _PWD_H_ */
diff --git a/nt/inc/sys/stat.h b/nt/inc/sys/stat.h
index a7c4c02ee06..4d93430803c 100644
--- a/nt/inc/sys/stat.h
+++ b/nt/inc/sys/stat.h
@@ -61,8 +61,8 @@ struct stat {
dev_t st_dev;
unsigned short st_mode;
short st_nlink;
- int st_uid;
- int st_gid;
+ unsigned st_uid; /* Vista's TrustedInstaller has a very large RID */
+ unsigned st_gid;
unsigned __int64 st_size;
dev_t st_rdev;
time_t st_atime;
diff --git a/src/ChangeLog b/src/ChangeLog
index 1f95b2846d5..d2f88a31fee 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2009-03-21 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (getpwuid): Change argument type to unsigned.
+ (struct w32_id): Change type of `rid' member to unsigned.
+ (w32_cached_id, w32_add_to_cache, get_name_and_id): Change type of
+ argument ID to unsigned. All callers changed.
+ (getuid, geteuid, getgid, getegid): Change return type to unsigned.
+
2009-03-20 Eli Zaretskii <eliz@gnu.org>
* editfns.c (Fuser_uid, Fuser_real_uid): If UID as EMACS_INT is
diff --git a/src/w32.c b/src/w32.c
index 999541b25ad..cd95f60e84f 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -840,13 +840,13 @@ static struct group dflt_group =
0,
};
-int
+unsigned
getuid ()
{
return dflt_passwd.pw_uid;
}
-int
+unsigned
geteuid ()
{
/* I could imagine arguing for checking to see whether the user is
@@ -855,20 +855,20 @@ geteuid ()
return getuid ();
}
-int
+unsigned
getgid ()
{
return dflt_passwd.pw_gid;
}
-int
+unsigned
getegid ()
{
return getgid ();
}
struct passwd *
-getpwuid (int uid)
+getpwuid (unsigned uid)
{
if (uid == dflt_passwd.pw_uid)
return &dflt_passwd;
@@ -2894,7 +2894,7 @@ get_rid (PSID sid)
#endif
struct w32_id {
- int rid;
+ unsigned rid;
struct w32_id *next;
char name[GNLEN+1];
unsigned char sid[FLEXIBLE_ARRAY_MEMBER];
@@ -2903,7 +2903,7 @@ struct w32_id {
static struct w32_id *w32_idlist;
static int
-w32_cached_id (PSID sid, int *id, char *name)
+w32_cached_id (PSID sid, unsigned *id, char *name)
{
struct w32_id *tail, *found;
@@ -2926,7 +2926,7 @@ w32_cached_id (PSID sid, int *id, char *name)
}
static void
-w32_add_to_cache (PSID sid, int id, char *name)
+w32_add_to_cache (PSID sid, unsigned id, char *name)
{
DWORD sid_len;
struct w32_id *new_entry;
@@ -2953,7 +2953,7 @@ w32_add_to_cache (PSID sid, int id, char *name)
static int
get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname,
- int *id, char *nm, int what)
+ unsigned *id, char *nm, int what)
{
PSID sid = NULL;
char machine[MAX_COMPUTERNAME_LENGTH+1];
@@ -3837,8 +3837,8 @@ system_process_attributes (pid)
DWORD blen = 0;
TOKEN_USER user_token;
TOKEN_PRIMARY_GROUP group_token;
- int euid;
- int egid;
+ unsigned euid;
+ unsigned egid;
DWORD sess;
PROCESS_MEMORY_COUNTERS mem;
PROCESS_MEMORY_COUNTERS_EX mem_ex;