summaryrefslogtreecommitdiffstats
path: root/source/lib/util_sid.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-11-24 23:41:03 +0000
committerJeremy Allison <jra@samba.org>1998-11-24 23:41:03 +0000
commit362ba67d9f909e05bfa18798e4583bfeb55839b2 (patch)
treeee5929b2defbd931a5381529b3929b9166472ead /source/lib/util_sid.c
parent1c9b51fc536a33869da751253ec353e85a33b255 (diff)
downloadsamba-362ba67d9f909e05bfa18798e4583bfeb55839b2.tar.gz
samba-362ba67d9f909e05bfa18798e4583bfeb55839b2.tar.xz
samba-362ba67d9f909e05bfa18798e4583bfeb55839b2.zip
Added lib/doscalls.c : This file collects all the calls that use dos_to_unix()
to map filenames before accessing the UNIX filesystem. The other changes are to make the code that previously allways called the ambiguous functions (such as file_size(), that internally called dos_to_unix()) to be unambiguous. For example: file_size() becomes "dos_file_size()", that calls dos_to_unix(), and file_size(), that does not. It is now very explicit when we are calling a dos mapping call and when we are not. Also added string_to_sid unsigned fix by adding the strtoul from libg++ code into lib/replace.c and testing for strtoul in configure.in. Jeremy.
Diffstat (limited to 'source/lib/util_sid.c')
-rw-r--r--source/lib/util_sid.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/lib/util_sid.c b/source/lib/util_sid.c
index 9ca3a59ad47..a4d8a124721 100644
--- a/source/lib/util_sid.c
+++ b/source/lib/util_sid.c
@@ -39,11 +39,11 @@ char *sid_to_string(pstring sidstr_out, DOM_SID *sid)
(sid->id_auth[3] << 16) +
(sid->id_auth[2] << 24);
- slprintf(sidstr_out, sizeof(pstring) - 1, "S-%d-%d", sid->sid_rev_num, ia);
+ slprintf(sidstr_out, sizeof(pstring) - 1, "S-%u-%u", sid->sid_rev_num, ia);
for (i = 0; i < sid->num_auths; i++)
{
- slprintf(subauth, sizeof(subauth)-1, "-%d", sid->sub_auths[i]);
+ slprintf(subauth, sizeof(subauth)-1, "-%u", sid->sub_auths[i]);
pstrcat(sidstr_out, subauth);
}
@@ -76,7 +76,7 @@ BOOL string_to_sid(DOM_SID *sidout, char *sidstr)
}
/* Get the revision number. */
- sidout->sid_rev_num = atoi(tok);
+ sidout->sid_rev_num = (uint32)strtoul(tok, NULL, 10);
if (!next_token(&p, tok, "-", sizeof(tok))) {
DEBUG(0,("string_to_sid: Sid %s is not in a valid format.\n", sidstr));
@@ -84,7 +84,7 @@ BOOL string_to_sid(DOM_SID *sidout, char *sidstr)
}
/* identauth in decimal should be < 2^32 */
- ia = atoi(tok);
+ ia = (uint32)strtoul(tok, NULL, 10);
/* NOTE - the ia value is in big-endian format. */
sidout->id_auth[0] = 0;
@@ -103,7 +103,7 @@ BOOL string_to_sid(DOM_SID *sidout, char *sidstr)
* NOTE - the subauths are in native machine-endian format. They
* are converted to little-endian when linearized onto the wire.
*/
- sid_append_rid(sidout, atoi(tok));
+ sid_append_rid(sidout, (uint32)strtoul(tok, NULL, 10));
}
DEBUG(7,("string_to_sid: converted SID %s ok\n", sidstr));