aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2009-03-21 11:31:50 +0000
committerEli Zaretskii2009-03-21 11:31:50 +0000
commit22749e9acb08d9a7ab78bdf930464b1f19012a63 (patch)
treebddda2f8f67fc48f7dd3c184f0e109fecc0139d4 /src
parentcc15c0f2167a8fa39d80f5d29672ee9d9eebd418 (diff)
downloademacs-22749e9acb08d9a7ab78bdf930464b1f19012a63.tar.gz
emacs-22749e9acb08d9a7ab78bdf930464b1f19012a63.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/w32.c22
2 files changed, 19 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1f95b2846d5..d2f88a31fee 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12009-03-21 Eli Zaretskii <eliz@gnu.org>
2
3 * w32.c (getpwuid): Change argument type to unsigned.
4 (struct w32_id): Change type of `rid' member to unsigned.
5 (w32_cached_id, w32_add_to_cache, get_name_and_id): Change type of
6 argument ID to unsigned. All callers changed.
7 (getuid, geteuid, getgid, getegid): Change return type to unsigned.
8
12009-03-20 Eli Zaretskii <eliz@gnu.org> 92009-03-20 Eli Zaretskii <eliz@gnu.org>
2 10
3 * editfns.c (Fuser_uid, Fuser_real_uid): If UID as EMACS_INT is 11 * 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 =
840 0, 840 0,
841}; 841};
842 842
843int 843unsigned
844getuid () 844getuid ()
845{ 845{
846 return dflt_passwd.pw_uid; 846 return dflt_passwd.pw_uid;
847} 847}
848 848
849int 849unsigned
850geteuid () 850geteuid ()
851{ 851{
852 /* I could imagine arguing for checking to see whether the user is 852 /* I could imagine arguing for checking to see whether the user is
@@ -855,20 +855,20 @@ geteuid ()
855 return getuid (); 855 return getuid ();
856} 856}
857 857
858int 858unsigned
859getgid () 859getgid ()
860{ 860{
861 return dflt_passwd.pw_gid; 861 return dflt_passwd.pw_gid;
862} 862}
863 863
864int 864unsigned
865getegid () 865getegid ()
866{ 866{
867 return getgid (); 867 return getgid ();
868} 868}
869 869
870struct passwd * 870struct passwd *
871getpwuid (int uid) 871getpwuid (unsigned uid)
872{ 872{
873 if (uid == dflt_passwd.pw_uid) 873 if (uid == dflt_passwd.pw_uid)
874 return &dflt_passwd; 874 return &dflt_passwd;
@@ -2894,7 +2894,7 @@ get_rid (PSID sid)
2894#endif 2894#endif
2895 2895
2896struct w32_id { 2896struct w32_id {
2897 int rid; 2897 unsigned rid;
2898 struct w32_id *next; 2898 struct w32_id *next;
2899 char name[GNLEN+1]; 2899 char name[GNLEN+1];
2900 unsigned char sid[FLEXIBLE_ARRAY_MEMBER]; 2900 unsigned char sid[FLEXIBLE_ARRAY_MEMBER];
@@ -2903,7 +2903,7 @@ struct w32_id {
2903static struct w32_id *w32_idlist; 2903static struct w32_id *w32_idlist;
2904 2904
2905static int 2905static int
2906w32_cached_id (PSID sid, int *id, char *name) 2906w32_cached_id (PSID sid, unsigned *id, char *name)
2907{ 2907{
2908 struct w32_id *tail, *found; 2908 struct w32_id *tail, *found;
2909 2909
@@ -2926,7 +2926,7 @@ w32_cached_id (PSID sid, int *id, char *name)
2926} 2926}
2927 2927
2928static void 2928static void
2929w32_add_to_cache (PSID sid, int id, char *name) 2929w32_add_to_cache (PSID sid, unsigned id, char *name)
2930{ 2930{
2931 DWORD sid_len; 2931 DWORD sid_len;
2932 struct w32_id *new_entry; 2932 struct w32_id *new_entry;
@@ -2953,7 +2953,7 @@ w32_add_to_cache (PSID sid, int id, char *name)
2953 2953
2954static int 2954static int
2955get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname, 2955get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname,
2956 int *id, char *nm, int what) 2956 unsigned *id, char *nm, int what)
2957{ 2957{
2958 PSID sid = NULL; 2958 PSID sid = NULL;
2959 char machine[MAX_COMPUTERNAME_LENGTH+1]; 2959 char machine[MAX_COMPUTERNAME_LENGTH+1];
@@ -3837,8 +3837,8 @@ system_process_attributes (pid)
3837 DWORD blen = 0; 3837 DWORD blen = 0;
3838 TOKEN_USER user_token; 3838 TOKEN_USER user_token;
3839 TOKEN_PRIMARY_GROUP group_token; 3839 TOKEN_PRIMARY_GROUP group_token;
3840 int euid; 3840 unsigned euid;
3841 int egid; 3841 unsigned egid;
3842 DWORD sess; 3842 DWORD sess;
3843 PROCESS_MEMORY_COUNTERS mem; 3843 PROCESS_MEMORY_COUNTERS mem;
3844 PROCESS_MEMORY_COUNTERS_EX mem_ex; 3844 PROCESS_MEMORY_COUNTERS_EX mem_ex;