diff options
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/mangle_hash2.c | 14 | ||||
-rw-r--r-- | source3/smbd/uid.c | 20 |
2 files changed, 5 insertions, 29 deletions
diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c index 959a93e07b..96ca7360b8 100644 --- a/source3/smbd/mangle_hash2.c +++ b/source3/smbd/mangle_hash2.c @@ -344,7 +344,6 @@ static BOOL check_cache(char *name) /* we found it - construct the full name */ strncpy(extension, name+9, 3); - extension[3] = 0; if (extension[0]) { M_DEBUG(0,("check_cache: %s -> %s.%s\n", name, prefix, extension)); @@ -436,19 +435,6 @@ static BOOL name_map(char *name, BOOL need83, BOOL cache83) /* find the '.' if any */ dot_p = strrchr(name, '.'); - if (dot_p) { - /* if the extension contains any illegal characters or - is too long or zero length then we treat it as part - of the prefix */ - for (i=0; i<4 && dot_p[i+1]; i++) { - if (! FLAG_CHECK(dot_p[i+1], FLAG_ASCII)) { - dot_p = NULL; - break; - } - } - if (i == 0 || i == 4) dot_p = NULL; - } - /* the leading character in the mangled name is taken from the first character of the name, if it is ascii otherwise '_' is used diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index ac0b535c13..864d3d6c66 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -546,12 +546,9 @@ DOM_SID *uid_to_sid(DOM_SID *psid, uid_t uid) return psid; } } - - /* Make sure we report failure, (when psid == NULL) */ - become_root(); - psid = local_uid_to_sid(psid, uid); - unbecome_root(); + local_uid_to_sid(psid, uid); + DEBUG(10,("uid_to_sid: local %u -> %s\n", (unsigned int)uid, sid_to_string(sid, psid))); return psid; @@ -614,14 +611,10 @@ BOOL sid_to_uid(DOM_SID *psid, uid_t *puid, enum SID_NAME_USE *sidtype) */ if ( (!winbind_lookup_sid(psid, dom_name, name, &name_type)) || (name_type != SID_NAME_USER) ) { - BOOL result; DEBUG(10,("sid_to_uid: winbind lookup for sid %s failed - trying local.\n", sid_to_string(sid_str, psid) )); - become_root(); - result = local_sid_to_uid(puid, psid, sidtype); - unbecome_root(); - return result; + return local_sid_to_uid(puid, psid, sidtype); } /* @@ -641,13 +634,9 @@ BOOL sid_to_uid(DOM_SID *psid, uid_t *puid, enum SID_NAME_USE *sidtype) */ if (!winbind_sid_to_uid(puid, psid)) { - BOOL result; DEBUG(10,("sid_to_uid: winbind lookup for sid %s failed.\n", sid_to_string(sid_str, psid) )); - become_root(); - result = local_sid_to_uid(puid, psid, sidtype); - unbecome_root(); - return result; + return local_sid_to_uid(puid, psid, sidtype); } DEBUG(10,("sid_to_uid: winbindd %s -> %u\n", @@ -678,6 +667,7 @@ BOOL sid_to_gid(DOM_SID *psid, gid_t *pgid, enum SID_NAME_USE *sidtype) if (!winbind_lookup_sid(psid, dom_name, name, &name_type)) { DEBUG(10,("sid_to_gid: winbind lookup for sid %s failed - trying local.\n", sid_to_string(sid_str, psid) )); + if (!local_sid_to_gid(pgid, psid, sidtype)) { /* this was probably a foreign sid - assume its a group rid and continue */ |